Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Global storage access

0 views
Skip to first unread message

Klaas-Jan Stol

unread,
Dec 5, 2005, 3:58:00 PM12/5/05
to perl6-i...@perl.org
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?

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

Leopold Toetsch

unread,
Dec 6, 2005, 6:09:41 AM12/6/05
to Klaas-Jan Stol, perl6-i...@perl.org

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']

You can't replace the globals hash but all manipulations of the hash
are currently allowed.

> regards,
>
> klaas-jan

leo

Klaas-Jan Stol

unread,
Dec 6, 2005, 7:08:16 AM12/6/05
to Leopold Toetsch, perl6-i...@perl.org
Leopold Toetsch wrote:

>
> 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

0 new messages