Re: ooeu [was Re: Proposal for math.e (2007-08-23)]
Kat wrote:
>
> CChris wrote:
>
> <snip>
>
> > This is why I had suggested in the past having nested functions the way
> > Pascal
> > does. You could still call_func() dynamicallly, and yet protect all needed
> > variables
> > inside the main routine. And it can be done without any extra keyword, which
> > is of paramount importance here. But somehow this hasn't picked much
> > support,
> > even though it works fine in my own copy of the interpreter.
>
> I have asked for that in the past also, i found it a great way to make
> variable scope
> between local and global. Putting the entire nested set of
> procedures/functions
> in a separate include work somewhat, but can place the global vars from
> the original
> (i hate this idiotic web interface, scrolling back and forth... ,
> inserting <cr> everywhere... i have a 17inch monitor, and am typing in a
> little 3x8 box with less text displayed than a 10inch 40column screen...
> copy/pasting to a text editor now.... shirt, i had 80-120col on
> a C64, grrr...)
What is that box? Wonder if I was born when it was built lol (probably)
> out of scope for the include holding the now-non-nested pseudo-pascal-nested
> procedures/functions. I think it worked in pascal because every procedure
> was a new
> "program" and it's var scope extended up to the previous procedure
> or program
> declaration, whichever came first, plus globals. It was a cheap way
> to get around
> in segmented memory on a dos box, with all it's 64k psp declarations, which
>
> is prolly why this never evolved in Euphoria with it's flat memory model. It
>
> was a bug fix to get around dos
> in pascal, and turned out to be beneficial. It can always be added
> as a new feature tho, as you did.
>
You are probably right. Pascal had "units", and a routine could be a unit on its
own. And each unit had its object file, with all the niceties about segment
grouping and all.
> I also asked for merging the best of pascal, mirc, and existing
> euphoria,,, 8 years ago? While none of what i had in mind has been added,
> other things have been added. Maybe i should have asked for things i
> *didn't* need
> in
> order to get the good stuff?
>
Could be.
One thing I haven't implemented though is some control over call_func()ing a
nested routine in an unauthorised way (only calls to direct descendant and direct
desce,dant of any ancestor are allowed, for consistency between local symbol
tables). To do that, I must keep the parent routine information for all routines
at runtime (including for translator). Not fun.
>
> Kat
CChris
|
Not Categorized, Please Help
|
|