|
Boost-Build : |
From: Rene Rivera (grafik666_at_[hidden])
Date: 2002-08-08 10:52:33
[2002-08-08] Vladimir Prus wrote:
>Rene Rivera wrote:
>
>> >> Acceptable, but also (I think) unneccessary. Assuming you have a
module
>>
>> to
>>
>> >> work with (e.g. jamfile.jam), you could store the __attributes__ for a
>> >> given jamfile in $(jamfile-name).__attributes__ in that module. You
>> >> could also implement a jamfile.get-attribute ( jamfile attribute) rule
>> >> which extracts the value of a given attribute for a particular
jamfile.
>
>> While having to implement the same thing for project-root I came up with
a
>> somewhat less anoying syntax for these uses. Instead of having to get the
>> object, then make calls on the object. I just pass along what call I want
>> to make to the single access function and it makes the call. For project
>> root one use looks like:
>>
>> ECHO [ project-root get-location ] ;
>
>That's convenient in fact. Only you have to be in a scope where
>"project-root" is defined.
Yes, otherwise you need to get the module first:
local project-root-module = <get module> ;
ECHO [ $(project-root-module).project-root get-location ] ;
>> It sould replace the above with:
>>
>> local requirements = [ project.attribute get requirements ] ;
>
>I could not understand this sentence. What is "It" and why replace the
above?
Sorry I was refering to the top of the original message. The syntax would go
from the current:
local attributes = [ project.attributes $(__name__) ] ;
local project-root-module = [ $(attributes).get project-root-module ] ;
To (this is from code I have in project-root.jam):
local project-root-module = [ $(__name__).project-attributes get
project-root-module ] ;
Or if you are in the context:
local project-root-module = [ project-attributes get project-root-module ] ;
-- grafik - Don't Assume Anything
-- rrivera_at_[hidden] - grafik_at_[hidden]
-- 102708583_at_icq - Grafik666_at_AIM - Grafik_at_[hidden]
Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk