Re: request for feature in Phix

new topic     » goto parent     » topic index » view thread      » older message » newer message

Well, I shall answer the question anyway.

If you go to https://bitbucket.org/petelomax/phix/src and navigate to builtins/VM/prtnidN.e you can see how to get a (local) copy of the symtab that you can play with.
Also in builtins/VM, pDiagN.e has routines getGvarValue() and getTvarValue() that contain code (somewhat overcomplicated for error trapping reasons) to retrieve values.

You may baulk at the inline assembly, but it is all fairly straightforward stuff, and significantly easier than attempting for example an ebp-relative hll peek().

One trick I should mention is that {}=routine_id("dummy") (assuming dummy does not exist) will ensure the symbol table is populated with string names when interpreting.
Obviously both prtnidN.e and pDiagN.e are designed to work the same when compiled and interpreted.

You may also be interested in http://rosettacode.org/wiki/Nested_function#Phix for some clues to retrieving local values from somewhere earlier in the call stack.

Pete

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu