Newsgroups: comp.lang.apl
Path: watmath!watserv1!utgpu!cs.utexas.edu!qt.cs.utexas.edu!yale.edu!jvnc.net!phage!wchang
From: wchang@cshl.org (Bill Chang)
Subject: Re: APL Transliteration (was Re: APL slash bang (Repost))
Message-ID: <1992Mar24.205846.13357@cshl.org>
Summary: Regarding J
Sender: news@cshl.org (NO MAIL)
Organization: Cold Spring Harbor Laboratory
References: <ROCKWELL.92Mar20072450@socrates.umd.edu> <1992Mar23.151511.27848@cshl.org> <ROCKWELL.92Mar23223711@socrates.umd.edu>
Date: Tue, 24 Mar 92 20:58:46 GMT
Lines: 60

In article <ROCKWELL.92Mar23223711@socrates.umd.edu> rockwell@socrates.umd.edu 
(Raul Deluth Miller-Rockwell) writes:
>Uh... J has workspaces as well as scripts.
>
>Scripts have more visibility, because they are more suitable for
>posting to the net.  But I'd give a lot to have J's level of workspace
>support available in the APL interpreter we have at work.

Thanks for the correction.  

>   Short of having true object orientation, dynamic scoping is
>   arguably superior to static scoping in this regard.
>
>'true object orientation'?  I'm not quite sure what you mean by that
>phrase, but I'd argue that J's implementation of nested arrays is
>adequate to meet the needs that dynamic scoping fills in current APLs.

In an object oriented system like Smalltalk, the "caller" sends a
message "do so-and-so with such-and-such parameters" to the "callee".
The parameters that are sent can be a subset of those actually needed;
the rest are taken from the "callee" object's state.  This mechanism 
has been simulated using nested arrays for messages (recent conferences).

Is it true that there are no non-global free variables in J?  Also no 
local functions, right?  If true, complex states have to be packaged 
into nested arrays in order to become arguments to function calls.  
Kind of like C and C structures.  (But C is pointer based, so this 
kind of thing is cheap.)

This is obviously a design decision with significant consequences...
We need to see more examples.

>   But ambiguity from ambivalent functions we can do without!
>
>That, I think, is going to have to wait till we get a larger symbol
>set...

You can't be serious :-)  J has more symbols (complex ones) than APL;
they all got filled with functions.  In fact, there are (I think) six
functions associated with each ASCII letter or punctuation: monadic
and dyadic x x. x: (perhaps not all are taken at the moment).  That's
a lot of functions.  

We could have had more adverbs x; x! x? etc. instead of overloading.
But this is just another of Iverson et al.'s design decisions: to be 
maximally comprehensive.  Why would an even larger symbol set make any 
difference?  

I'm afraid we are treading into deeper waters...  These are basic 
issues in the design of programming languages, and there are tradeoffs
with each method, perhaps too difficult to discuss on Usenet.

What we need is a good collection of examples of J programming style
(yes I know they exist, but I can't read them yet :-).


-- Bill Chang (wchang@cshl.org)        Cold Spring Harbor Lab., NY



