[futurebasic] Re: What about Pascal VARs ??

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : April 2001 : Group Archive : Group : All Groups

From: lcs@...
Date: Sun, 22 Apr 2001 03:30:48 +0200 (MEST)

Hi All,

Speaking of the absence of Pascal VARs in FB, I wrote:

 > I will argue in my next post (be warned and duck if you 
 > want) that this is an unfortunate consequence of accidents 
 > that came to pass over 10 years ago and that it is time to 
 > rethink the fundamentals and enrich FB's notion of FN. 

Let me be brief.  GOSUB and the intimately related ZBasic
construct LONG FN offered plenty of VARs; but they justifiably
had a very bad reputation for VAR promiscuity and clandistinity.
That does not mean that VARs are bad; it just means we have to
find non-promiscuous but syntactically clear and simple ways of
exploiting them.

My last two posts mention two promising ways of doing so. The
one involving the sample lines

 >  LOCAL FN AssignSevenTo(~X&)
 >  // ~ asks that X& be a VAR (in RAM)
 >    X&=7
 >  END FN

is new syntax (because of ~), and seems to me to be the one that
would get widest acceptance. It requires that Andy G. implement
it deep in the compiler.

There is another mentioned in the FBII Handbook:

 > Use LOCAL MODE to make totally protected functions. A
 > limited form of globals can be made by defining a pointer
 > or a handle to hold records. This will not conflict with
 > other globals.

This is a bit sybilline, but you will understand it when you 
reread my last post called "Cleaner Param Block Passing".
In fact, it provides one answer to to the last comment there
tho not exactly what I had in mind.

            Cheers

                   Laurent S.