Re: [taskjuggler] Redefinition of macros?

From: Chris Schlaeger (cs_at_suse.de)
Date: Wed Apr 06 2005 - 16:11:15 CEST


From: Chris Schlaeger <cs@suse.de>
Date: Wed, 6 Apr 2005 08:11:15 -0600
Message-Id: <200504060811.21468.cs@suse.de>
Subject: Re: [taskjuggler] Redefinition of macros?


On Wednesday 06 April 2005 07:49, Ulrich Hammel wrote:
> Chris,
>
> I have to apologize not to explain the purpose of my request. The idea
> behind is that I do have to schedule many different projects in parallel
> tightly connected by usage of shared resources. I therefore find it more
> comfortable to define one huge TaskJuggler project rather than following
> the approach outlined in http://www.taskjuggler.org/example.php "The Big
> Project".
>
> In my approach each project is mapped to "level 0" TaskJuggler task
> which is stored in a separate .tji-file including its subtasks. The
> tji-files are maintained by different people. To ease definition of such
> a task, and because many of these tasks (each representing a project)
> are quite similar in structure, I would like to provide a sort of
> template. Such template would start with a couple of macro definitions
> that will be reused inside the body of such level 0 task. As a
> consequence the redefinition of macros at the beginning of each
> .tji-file is required.
>
> Of course this approach assumes a local scope for macro definitions with
> respect to macro and parameter substitution. Thus, macro redefinition
> might not really lead to the solution I have in mind.

You can do this actually today. The macro lifetime extends over the included
files, but not over global file scope. So there is a difference between

taskjuggler a.tjp (where a.tjp includes b.tji)

and

taskjuggler a.tjp b.tji (where a.tjp does not include b.tji).

In the second case a macro defined in b.tji is only valid in b.tji. So if you
have

taskjuggler a.tjp b.tji c.tji

the macro defined in b.tji is not known in c.tji. Maybe that helps.

> P.S.: I like the 2.1 version including the TaskJuggler UI very much.
> Great job! Do you plan to enable the printing of these nice Gantt-Charts
> of the project view?

Yes, this is on my TODO list. As soon as I have some time for a larger coding
job, I will start with this.

Chris

>
> Chris Schlaeger wrote:
> > Hi Ulrich,
> >
> > On Tuesday 05 April 2005 07:20, Ulrich Hammel wrote:
> >>Hi there,
> >>
> >>is it possible to redefine or undefine a macro?
> >
> > no this is currently not supported. The TaskJuggler syntax was designed
> > to be very error resistant. So all items need to be declared first or
> > redefinitions result in an error message.
> >
> > In that sense an 'undefine' statement for macros would be the right way
> > to implement it. So far nobody asked for it but it would not be much work
> > to add it. What do you need it for?
> >
> > I'm generally very familiar with macro languages such as the C
> > preprocessor or even m4. I added the macros to TJ because it is a
> > powerful feature, but hoped that people would use it only scarcely. I
> > guess you proved me wrong now. ;)
> >
> > Chris

-- 
KDE 3.3: Conquer your Enterprise Desktop!  See http://www.kde.org!
GPG Key: 1024D/0500838B  A5FE C051 2AFC 9A14 768A  5125 5829 5750 0500 838B




This archive was generated by hypermail 2.1.7 : Wed Apr 06 2005 - 16:11:56 CEST