if I understood correctly, the global storage is implemented as a hash
table.
If so, will it be possible to load this global hash table in a P register?
So, for example, are there any plans to support this:
$P0 = get_globals # put a reference to the global storage into
register $P0
and
set_globals $P0 # set the hash table referenced by $P0 as the global
storage.
regards,
klaas-jan
> hi,
>
> if I understood correctly, the global storage is implemented as a hash
> table.
> If so, will it be possible to load this global hash table in a P
> register?
It is possible right now. See the introspection interface of the
interpreter:
perldoc classes/parrotinterpreter.pmc
interp = getinterp
glob_hash = interp['globals']
You can't replace the globals hash but all manipulations of the hash
are currently allowed.
> regards,
>
> klaas-jan
leo
>
> On Dec 5, 2005, at 21:58, Klaas-Jan Stol wrote:
>
>> hi,
>>
>> if I understood correctly, the global storage is implemented as a
>> hash table.
>> If so, will it be possible to load this global hash table in a P
>> register?
>
>
> It is possible right now. See the introspection interface of the
> interpreter:
> perldoc classes/parrotinterpreter.pmc
>
> interp = getinterp
> glob_hash = interp['globals']
>
great! thanks, seems I didn't look in the right place then.
> You can't replace the globals hash but all manipulations of the hash
> are currently allowed.
kjs