[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: suggestion for backwards compatible "global"
- From: "Russell Y. Webb" <rw20@...>
- Date: Fri, 15 Sep 2000 09:28:44 -0700
Good idea! I suggested it about 2 years ago and didn't get anywhere with
it. Perhaps times have changed...
I believe my suggestion was to use "method" or "routine" as the new keyword;
there doesn't seem to be an entirely satisfying word available though.
> From: "Tom " <email@example.com>
> Reply-To: firstname.lastname@example.org
> Date: Fri, 15 Sep 2000 09:13:58 -0000
> To: Multiple recipients of list <email@example.com>
> Subject: suggestion for backwards compatible "global"
> One approach to introduce global/local without breaking old
> code or habits might be to have two keywords for function
> A function declared with the "function" keyword would
> continue to behave as it always has.
> A function declared with another keyword (say, "fun"
> or "proc") would use the new semantics, and only in
> that context would the "global" keyword be valid.
> This would also allow people who prefer the old semantics
> (say, for writing configuration files) to keep using them.
> The documentation could describe the more error-prone
> "function" as deprecated and discourage its use.
> To help with converting old code, the interpreter
> might warn about any use of the "function" keyword when
> run with a special flag. Of course, any new keyword
> may break a small percentage of old code; for full backwards
> compatibility, another flag could turn off recognition of
> the new keyword.