home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / lang / apl / 1375 < prev    next >
Encoding:
Text File  |  1993-01-25  |  1.2 KB  |  33 lines

  1. Newsgroups: comp.lang.apl
  2. Path: sparky!uunet!gatech!purdue!mentor.cc.purdue.edu!mentor!weg
  3. From: weg@mace.cc.purdue.edu (Eythan Weg)
  4. Subject: Re: $: (self-reference) difficulties
  5. In-Reply-To: abalje47@ursa.calvin.edu's message of Mon, 25 Jan 1993 01:32:23 GMT
  6. Message-ID: <WEG.93Jan25115650@mace.cc.purdue.edu>
  7. Sender: news@mentor.cc.purdue.edu (USENET News)
  8. Organization: Purdue University
  9. References: <abalje47.727925543@ursa>
  10. Date: Mon, 25 Jan 1993 16:56:50 GMT
  11. Lines: 20
  12.  
  13. In article <abalje47.727925543@ursa> abalje47@ursa.calvin.edu (Alan Baljeu) writes:
  14.  
  15.        NB. The following four lines were copied (cut and paste) from
  16.        NB. tut19.js which I got at watserv1.waterloo.edu from the file
  17.        NB. /languages/apl/j/tutorial.tar.  It was placed there in March,
  18.        NB. while the executable arrived in October '92
  19.  
  20.       a=. '$.=. 2-0=y.' ; '1'
  21.       b=. 'y. * $: y.-1'
  22.       factorial=. (a,<b) : ''
  23.       factorial 5
  24.    limit error
  25.    [2] y. * $: y.-1
  26.  
  27. The manual (version 5) says that $: means essentially the phrase in
  28. which it occurs.  For anything to behave properly there should be a
  29. way out of the resulting self reference (recursion).  Hence the limit
  30. error.
  31.  
  32. Eythan
  33.