Leo --

I'm going to chuck the idea of collecting stuff, and use
this:

  .sub _INLINE_{N}
    # a chunk of stuff
    goto _INLINE_{N+1}
  .end

to wrap each contiguous piece. I don't want symbols defined
at point X in the code to be visible to subs introduced at
points prior to X.

I think the collection path is A Bad Idea (TM) for a language with
scripting style (like Jako, Perl, Python, etc.). Whether its
good for other languages is open for discussion, although I
suspect most languages would choke on code analogous to this:

  sub foo {
    print $X;
  }

  global $X = 43;

and the collection approach you suggest would make it not choke
in IMCC. I want the visibility of my symbols in IMCC to match
their visibility in the source language. Of course, if I didn't
care about the extra visibility, then collection would be A Fine
Idea (TM).


Regards,

-- Gregor

On Sat, 2003-09-20 at 12:59, Leopold Toetsch wrote:
> Gregor N. Purdy <[EMAIL PROTECTED]> wrote:
> > All --
> 
> > It used to emit the constants as .const right where the were found
> > lexically, but I've introduced code motion to collect all inline
> > code into the __MAIN sub at the end, which put the .const stuff
> > there (which I've changed to .globalconst in the case where it
> > is something from the top level File block).
> 
> [ snip ]
> 
> > So, where am I supposed to put these .globalconsts if they
> > have to be in a .sub?
> 
> You could emit .globalconst here:
> 
>    .sub ___MAIN
> 
> or just emit .const as they are seen. They get folded anyway, so it's no
> penalty.
> 
> > Generally, making me move the code around like this is a bit
> > of a PITA, since technically lexical accessibility of variables
> > inside subroutines defined after them but not those defined
> > before them ends up being a problem.
> 
> I think you should collect all code first and then emit "main" and subs
> in that order.
> 
> > -- Gregor
> 
> leo
-- 
Gregor Purdy                            [EMAIL PROTECTED]
Focus Research, Inc.               http://www.focusresearch.com/

Reply via email to