Newsgroups: comp.lang.apl
Path: watmath!watserv1!utgpu!cs.utexas.edu!wupost!darwin.sura.net!haven.umd.edu!socrates!socrates!rockwell
From: rockwell@socrates.umd.edu (Raul Deluth Miller-Rockwell)
Subject: Re: yet more questions on J
In-Reply-To: sam@csi.jpl.nasa.gov's message of Mon, 3 Feb 1992 17:18:45 GM
Message-ID: <ROCKWELL.92Feb3232258@socrates.umd.edu>
Sender: rockwell@socrates.umd.edu (Raul Deluth Miller-Rockwell)
Organization: Traveller
References: <1992Feb3.171845.18367@csi.jpl.nasa.gov>
Date: Tue, 4 Feb 1992 04:22:58 GMT

Sam Sirlin:
   I just tried J 4 on my pc.  Wow!  couldn't even )out!  and of
   course f1 doesn't work if (as usual) you aren't in the j directory.

Hmm.. I couldn't find a de-arc-er, so I haven't got to use it on the
pc yet.  [But on the RS6000, I've got my profile.js set up with this
line:
   NB.  use  0!:55 ''   to exit
because I've got the  )off  habit.]

   Anyway (the main question), I noticed that $: is changed. How? This
   used to work (<v4):

      com=. ' '''''''',y.,'''''''' ' : ' 1 |. ($: y.); x. '

   (useful to me for comments in function scripts, I was amazed at how
   many quotes I needed!), but now gives a limit error.  It must be
   doing some sort of recursion? Of course substituing "com" for "$:"
   makes it work, but I thought the point of J was to get away from
   names?

Well, this seems to work:
   com=. ' '''''''',y.,'''''''' ' : (' 1 |. ($: y.); x. ' :11)

and is equivalent to this:
   com=. ''''&, @(,&'''') : (1&|. @(;~ $:))

I think $: refers to the current "tacit function", instead of the
current "explicit function".  But note that 'com' gives a domain error
when you do
   'abc' com 'def' com 'ghi'
Because it attempts to compute '''',('def';'''ghi'''),''''

Also, while I'm on this topic, a caution:  Be careful when using f. on
a function which uses other functions built using $:  This is
definitely a case where the semantics of the result of f. are not the
semantics of its argument.


By the way, anyone know what to call the results of '..' and '.:' in
J 4?  For example:

   f .. g
+-+---------+-------+
|f|+--+--+-+|+-+-+-+|
| ||-:|@:|+|||f|&|g||
| |+--+--+-+|+-+-+-+|
+-+---------+-------+
   f .: g
+-+---------+-------+
|f|+--+--+-+|+-+-+-+|
| ||-:|@:|-|||f|&|g||
| |+--+--+-+|+-+-+-+|
+-+---------+-------+

Looks like averaging of some sort, but I'm not sure I know how to use
this.

-- 
Raul Deluth Miller-Rockwell                  <rockwell@socrates.umd.edu>
The U.S. Federal government went another billion dollars into debt today.
