Newsgroups: comp.lang.apl
Path: watmath!watserv1!utgpu!news-server.csri.toronto.edu!torsqnt!jtsv16!itcyyz!yrloc!hui
From: hui@yrloc.ipsa.reuter.COM (Roger Hui)
Subject: Re: a j question and problem
Message-ID: <1991Oct12.035226.9823@yrloc.ipsa.reuter.COM>
Organization: Iverson Software Inc.
References: <WEG.91Oct8182431@mace.cc.purdue.edu> <1991Oct9.171353.10409@csi.jpl.nasa.gov> <1991Oct10.161942.7706@ctr.columbia.edu>
Date: Sat, 12 Oct 91 03:52:26 GMT

Eythan Weg writes of J/VAX:
>    axis
> +-----------------------------+-++
> |(1{y.)+(i.>:0{y.)*%~`(-~)/y. |:||
> +-----------------------------+-++
>    simpson
> +------------------------------------------------+-+-+
> |x=.axis y.                                      |:|2|
> |(3%~(%~)`(-~)/y.)*+/(1|. 1 1 ,(<:0{y.)$4 2)*x. x| | |
> +------------------------------------------------+-+-+
>    ...
>
>    l1=.'z=.x. simpson (4,2{.y.)'
>    rec=.l1 : 2
>    ^rec 0 1 4
> Memory fault - core dumped
 
Sam Sirlin writes of a similar problem on J/Sun4:
>    ^rec 0 1 4
> Segmentation fault
 
These are manifestations of a user-defined infinite recursion
more simply demonstrated by:
 
   conj =. 'x. 3' : 2
   'x.'~ conj +
 
I will fix the system to report the problem more gracefully than
by crashing.
 
Sam Sirlin writes of J/Sun4:
> My favorite is still
>    2=<2
> Bus error
 
Inspection of the source reveals that the logic is such that on some
machines (and it looks like on the Sun4) a memory fault or bus error
could result.  (I am not certain because I don't have ready access to
a Sun4 to try this now.)  I think I have now fixed this error, and the
fix will be distributed with J 3.5 and subsequent versions.  Thank you
for reporting this error (and sorry for ruining your favorite bug :-).
 
Peter Shenkin writes of J 2.9/SGI:
> How about:
>    2/2
> Segmentation fault (core dumped)
>
> under J-2.9 on a Personal Iris.
 
The phrase 2/2 correctly signals domain error on J 3.4/PC, and inspection
of the source reveals no obvious reason why the behaviour should be
different on other machines.  It is possible that the error has been
fixed since J-2.9/SGI (the last available version at Waterloo is J 3.2/SGI).
When I next have access to an SGI I will try this.

--------------------------------
Roger Hui, Iverson Software Inc., 33 Major Street, Toronto, Ontario  M5S 2K9
(416) 925 6096; Fax: (416) 488 7559
