Boost logo

Boost-Build :

From: 김영현 (yhyun.kim_at_[hidden])
Date: 2007-10-16 21:01:53


Hello.

Please, look at that code below.

# Jamroot

import xxx ;

# in xxx.jam file

SOME_DIR_PATH1 = /home/user/test ;

rule path-constants ( name )
{
    SOME_DIR_PATH2 = /home/user/test ;

    return $($(name)) ;
}

class Test
{
   rule __init__ ( )
   {
      echo "[" $(SOME_DIR_PATH1) "]" ;
      echo "[" [ path-constants SOME_DIR_PATH2 ] "]" ;
   }
}

import "class" : new ;

t = [ new Test ] ;

# outputs
$> bjam
[ ] *"echo $(SOME_DIR_PATH1) - value is empty"
*/home/user/test/test.jam:16: in object(Test)@15.__init__
rule *path-constants unknown* in module object(Test)@15.
...
...

I can't access variables and rules that are in different scope, I mean not
in class scope. why?
Are there any rule or something ? How can I solve this? Are there any
solution?

Thanks in advance.



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