Newsgroups: comp.lang.apl
Path: watmath!watserv2.uwaterloo.ca!torn!cs.utexas.edu!sun-barr!ames!haven.umd.edu!uunet!gatech!gsusgi1.gsu.edu!gsusgi1.gsu.edu!qmdbms
From: qmdbms@gsusgi2.gsu.edu (Brian Schott)
Subject: J explicit def'n result?
Message-ID: <qmdbms.716615108@gsusgi1.gsu.edu>
Organization: Georgia State University
Date: Wed, 16 Sep 1992 03:45:08 GMT
Lines: 40

Below is some cooked up j code.  I frequently require some rather
long calculations such as a simulation and put the results in an
array.  After the simulation I compute some statistical summary
of the results which have been put into an array.  But I cannot
seem to make the statistical calculations the last line of the
explicit function which has already done the simulation.  

So I cooked up the simple functions(?) s and t below to see
why I get errors on the final summary.  By errors I mean that I
usually get domain error or syntax error or the like.  Well I
am not getting such errors in the cooked up example, but I do
not understand what is going on and suspect that the misunder--
standing is related to the real errors I get on my real jobs.
--------------------------

s =. 0 0 $''
s =. s, 'y. - 2'      NB. to summarize result of t
t =. 0 0 $''
t =. t, 'z=: i. 5'    NB. in reality a long calculation
t =. t, 'S z'         NB. now do the summarization
S =. s : ''
   t
z=: i. 5
S z     
   S
+---+-++
|z-2|:||
+---+-++
    ". t
 0  1 2 3 4
_2 _1 0 1 2
-----------------------------   
Where does the 0 1 2 3 4 come from?

(B=)
-- 
Brian Schott/Decision Sciences Dept.             qmdbms@gsusgi2.gsu.edu
College of Business Administration                         404-651-4070
Georgia State University                  interests: approx. reasoning,
Atlanta, Georgia USA 30303-3083     (B=)       decision support systems
