At 5:16 PM +0200 8/31/04, Leopold Toetsch wrote:
Dan Sugalski wrote:

... The inability to compile and return truly anonymous subs in PIR is, by itself, enough to warrant the change.

Ok. What about:

.sub @ANON
.end

Still runs into the issue of not returning a sub PMC to use.

I can see not wanting to burden the PIR parser with figuring out whether a chunk of PIR it gets is 'normal' source with subs and all, or an anonymous sub. Having an alternate PIR parser that just wraps a ".sub/.end" around the code and returns the PMC for the resulting sub wouldn't be out of line.

The AST processor is going to have to deal with this -- there are a lot of languages, including perl, that are going to want to throw unmarked compilation units, and nested compilation units, at it.

What else is needed for anoymous subs? How do we get at the subroutine object, if the anon sub is compiled statically?

If it's compiled statically you can't get to it, so they're kinda useless there. (Unless we want to get into PMC constants, in which case I could see them being useful)
--
Dan


--------------------------------------it's like this-------------------
Dan Sugalski                          even samurai
[EMAIL PROTECTED]                         have teddy bears and even
                                      teddy bears get drunk

Reply via email to