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

[CVS ci] eval changes

8 views
Skip to first unread message

Leopold Toetsch

unread,
Nov 9, 2004, 12:18:05 PM11/9/04
to Perl 6 Internals
There is of course no "eval" in Parrot. Anyway:

* the signature of a Parrot compiler PMC is now "PIt" - it returns
a Sub PMC directly - or more precisely an Eval PMC, which is a
Closure
* attached onto this Closure is the compiled bytecode
* this Closure's are named EVAL_n (n = 1...)
* it can (or has to) be invoked like any other sub according to calling
conventions.
* this also means that the compiled code has to end with "invoke P1".
* compiled code that just "end"s terminates the run-loop
* the compiled code has the life-time of the returned Sub PMC

TODOs:
* implement the @MAIN and @LOAD pragmas
* provide an @ANON pragma, so that globals are not effected by compiled
subroutine names
* adjust imcc tests
* cleanup

The forth compiler snippet works with s/end/invoke P1/ for the compiled
code.

see t/pmc/eval.t for examples

leo

0 new messages