Boost logo

Boost-Build :

From: Rene Rivera (grafik.list_at_[hidden])
Date: 2005-06-04 17:23:04


Jonathan Turkanis wrote:
> Rene Rivera wrote:
>
>>It's simple ;-) "return 1 ;" sets the return value to the strings
>>["1"] (all values Jam are string lists). When the rule finishes, by
>>getting to the last statement, the return value is passed back to the
>>caller.
>
> Ugh!!! I thought of this, but found the following at perforce
> (http://public.perforce.com/public/jam/src/Jam.html):
>
> "return values ;
>
> Within a rule body, the return statement sets the return value
> for an invocation of the rule and terminates the rule's execution."
>
> I guess this is wrong/obsolete. Is there an correct/up-to-date Jam language
> reference?

Don't if it's wrong or obsolete. The documentation for bjam, the variant
we use is at:

http://www.boost.org/tools/build/jam_src/Jam.html

And it says in that relative same place:

return values ;

Within a rule body, the return statement sets the return value for
an invocation of the rule. It does not cause the rule to return; a
rule's value is actually the value of the last statement executed, so a
return should be the last statement executed before the rule "naturally"
returns.

Not sure about the discrepancy. It would be kind of strange for Perforce
to change the semantics of something like "return".

-- 
-- Grafik - Don't Assume Anything
-- Redshift Software, Inc. - http://redshift-software.com
-- rrivera/acm.org - grafik/redshift-software.com
-- 102708583/icq - grafikrobot/aim - Grafik/jabber.org
 

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