accessing properties from namespace object

rohit jangid rohit.nsit08 at gmail.com
Sun Jul 3 10:16:41 UTC 2011


hi,

I am trying to access the namespace's properties using object notation

.namespace []
.sub main
$P0 = box "hello"
set_global ["rj"], "bill", $P0
$P1 = get_global ["rj"], "bill"
say $P1
$P2 = get_namespace ["rj"]
say $P2
$P3 = get_global $P2, "bill"            # using $P2 for accessing
"bill" property.
say $P3
.end

output

[droid at localhost ~]$ parrot new.pir
hello
rj
Null PMC in say
current instr.: 'main' pc 22 (new.pir:1)

___________________________________________________________

according to me if I have access to namespace object, I can get all
the properties stored in it.

while the above is giving Null PMC
it's alternative
$P3 = get_global ["rj"], "bill" is working perfectly

am I missing some point ?

thanks...
-- 
Rohit Jangid
Under Graduate Student,
Deptt. of Computer Engineering
NSIT, Delhi University, India


More information about the parrot-dev mailing list