develooper Front page | perl.perl6.language | Postings from May 2005

Fully introspectable Code objects?

Thread Next
From:
Ingo Blechschmidt
Date:
May 29, 2005 07:18
Subject:
Fully introspectable Code objects?
Message ID:
d7cimt$msm$1@sea.gmane.org
Hi,

while responding to nothingmuch++'s post "function signatures?", I
thought that it'll be great if Code objects were fully introspectable.

I.e.:
  &foo.statements;             # List of statements
  &foo.statements[0]           # First statement
  &foo.statements[2] = ...;    # Statement modification?

And all objects returned from the introspection methods should stringify
appropriately, so that...
  say ~sub { 42 + $^a };   # prints
  sub ($a) { return 42 + $a; }

Is this going too far?
Is this wanted?
Is it useful?

(At least readonly access would be nice, as allowing writes to
&foo.statements will make compiler optimisations much
harder/impossible.)


--Ingo

-- 
Linux, the choice of a GNU | self-reference, n. - See self-reference  
generation on a dual AMD   | 
Athlon!                    | 


Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About