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.