in reply to Make sure Perl 6 is introspective enough

Well, there's going to be quite a number of p6 features (as I understand them) for what you want to do.

First off, let me qualm your major fear: perl6 is going to be at least as, and possibly quite a bit more, introspective as perl5. Symbol tables aren't going away, though they are changing a bit -- globs are going away, and the sigil will be stored in the symbol table, which is just a highly magical hash. New to perl6 is the $MY:: and $CALLER:: magic packages, which are like the symbol tables, but for lexical variables, in your and your caller's scopes. (Exactly what they're called and the semantics of $CALLER:: seem to vary depending on the phase of the moon, who'se talking, and what Larry had for breakfast.)

Also, all objects, including PMCs, will be able to (and most probably will) define a serilization method. Data::Dumper could use this.

Objects implemented in Perl, while not exactly hashes anymore, will be fully iteratable and serializable... I think.

Objects implemented as PMC (Parrot Magic Cookies) will likely not be iteratable, but will be serializable, if sensable. This isn't anything new, really -- objects implemented in XS can't be iterated over in perl5.


Warning: Unless otherwise stated, code is untested. Do not use without understanding. Code is posted in the hopes it is useful, but without warranty. All copyrights are relinquished into the public domain unless otherwise stated. I am not an angel. I am capable of error, and err on a fairly regular basis. If I made a mistake, please let me know (such as by replying to this node).

  • Comment on Re: Make sure Perl 6 is introspective enough

Replies are listed 'Best First'.
Re: Re: Make sure Perl 6 is introspective enough
by theorbtwo (Prior) on Dec 02, 2002 at 17:33 UTC

    Oh, I forgot a couple more forms of introspection: You'll be able to read yourself as a parse tree, as PASM (Parrot Assembler) code, and possibly as bytecode. These might be possible only at certian times in the life of the program -- the parse tree, in purticular, will probably get thrown out if unreferenced when we begin assembley. It will probably be possible to modify these semi-on-the-fly. It'll be possible to modify the parser during parsetime with BEGIN{} blocks.

    It'll probably even be possible to make perl programs that contain inline PASM, and possibly even to write to coderefs in pasm.


    Warning: Unless otherwise stated, code is untested. Do not use without understanding. Code is posted in the hopes it is useful, but without warranty. All copyrights are relinquished into the public domain unless otherwise stated. I am not an angel. I am capable of error, and err on a fairly regular basis. If I made a mistake, please let me know (such as by replying to this node).