Control structures in APL 
Author Message
 Control structures in APL

Further comments on Kim Whitelaw's proposal:

There are many easy ways to simulate most of Kim's proposal.  For example,
to get rid of the '' ugliness one can use a single backquote ` or a doublequote
" inside a code string.  To mark a string as code one can insert matched {} at
the beginning and end.  Nested blocks simply use nested {}.  A user-defined
execute can preprocess this string.  Multi-line blocks can be written using
easily defined functions

  'F' IS '...'
     AND '...'
     etc.

which either join them with "diamond" or create a nested structure to be passed

using a dummy name, or preprocessed away.  Local functions can also be defined
using a trailer

     END 'F'


  'G' CALLS 'F'

and have CALLS check their fix times and (re)fix F if G is more current.
It works okay.  My point is that these techniques have been around a long
time, and people already use them, so I don't think Kim's proposal will
necessarily add much if any new structure to APL.  Another way to look at it
is that APL already has this kind of dynamically scoped local/"first class"
functions--namely the string.

Regarding the difficulty of implementing lexical scope, I want to point out
that a _tree_ of environments is only necessary for the so-called "upward
funarg", i.e. a function that is created and then passed _out_ of its
definition enviroment, which dies (exited) while the function remains dangling;
otherwise it is still a stack.  By keeping local functions local, this problem
does not arise.




Mon, 24 Feb 1997 06:05:10 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. Proposal for control structures in APL

2. Proposal for control structures in APL

3. Proposal for control structures in APL (SAMSON)

4. Control Structures in APL

5. Control Structures in APL

6. Control structures in APL

7. Control structures in APL

8. control structures in APL

9. Control Structures in APL

10. Control structures in APL

11. APL Control Structures

12. APL control structures -- new

 

 
Powered by phpBB® Forum Software