Boost logo

Boost-Build :

From: K. Noel Belcourt (kbelco_at_[hidden])
Date: 2006-09-09 00:54:22


On Sep 8, 2006, at 10:42 PM, Rene Rivera wrote:

> K. Noel Belcourt wrote:
>> I want to initialize a constant using a command line value if one is
>> supplied by the user or with some default of my choosing if no
>> argument is supplied. Something like this though clearly this is
>> illegal since you can't change a constant.
>>
>> constant sierra-root = [ MATCH "^--sierradir=(.*)" : $(argv) ] ;
>> sierra-root ?= /sierra/Release ;
>>
>> So how can I initialize a constant in one step, either with a value
>> from the command line or with some specified default value.
>
> You can't do it in one assignment if that's your question.
Yup, that was the question.

> What you
> have, except for the "constant", seems fine to me. Is there some
> reason
> you need to do it in one assignment?
Make clear to our other, less knowledgeable BBv2, users that they
shouldn't mess with this value. Strongly typed, clear to the casual
reader, the standard spiel. I know the value should never be changed
but other users won't and once I release this build system for
general use, someone will assume it's mutable, mutate it's value and
hose the build system.

Not critical, just desirable from a maintenance perspective.

-- Noel


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