1. Request for enhancement
- Posted by rforno at tutopia.com
Sep 03, 2001
Rob:
I think that it would be very handy and probably not difficult to allow
variables private to a program be known in programs they call. This way,
repetitive code fragments could use these variables without resorting to
local variables or using them as parameters and returning them modified.
2. Re: Request for enhancement
rforno writes:
> I think that it would be very handy and probably not difficult to allow
> variables private to a program be known in programs they call. This way,
> repetitive code fragments could use these variables without resorting to
> local variables or using them as parameters and returning them modified.
Derek Parnell writes:
> This sort of data-binding of modules is considered
> dangerous programming practice because it can easily
> lead to hard-to-find bugs over time.
This is the dynamic scoping system that APL uses,
and I know that you (rforno) are very familiar with APL.
This would not be an easy or desirable change in my opinion.
I would agree with Derek here.
I used to program a lot in APL, and it has many nice
features, but I don't think this is one of them.
On more than one occasion I spent hours debugging an APL
program because a subroutine that I called was accidentally
modifying a variable I was using, simply because the author
of the routine (maybe me) had forgotten to declare that variable
locally to his own routine.
With dynamic scope, Euphoria would no longer be able to
report an error (probably not even a warning),
when you forget to declare a variable in a routine.
Regards,
Rob Craig
Rapid Deployment Software
http://www.RapidEuphoria.com