Newsgroups: comp.lang.apl
Path: watmath!watserv1!utgpu!news-server.csri.toronto.edu!rpi!usc!elroy.jpl.nasa.gov!sdd.hp.com!apollo!keil
From: keil@apollo.hp.com (Mark Keil)
Subject: problems converting to tacit form
Lines: 92
Message-ID: <1992Jan31.235032.26030@apollo.hp.com>
Keywords: J tacit
Sender: netnews@apollo.hp.com (USENET posting account)
Nntp-Posting-Host: thor.ch.apollo.hp.com
Organization: 2 x 4
Distribution: comp
Date: Fri, 31 Jan 1992 23:50:32 GMT

 I'm having trouble with the convert to tacit conjunction.
 It seems very fragile, and sometimes very slow.
 It would sure be helpful if J would give a clue where in an expression an error lies.
 I would really like to see the tacit form of some of these expressions
 Particularly the w expression ( a table lookup with linear interpolation expresssion)
 (w was translated from an APLSV function, and I know that it could be more concise,
  or rewritten to be more elegant. I was going through the interesting exercise of
  translating from to J)

 Thanks for any insight.

Mark

$ j_3.4_sun4
J 3.4   Copyright (c) 1990 1991, Iverson Software Inc.  All Rights Reserved.

   m=. '(+/ % #) y.'        <<<< from programming in J
   m ttt
syntax error
   g1 =. m ttt
syntax error
   i=.'(y.-0{x.)%2{x.'
   i ttt
syntax error
   i=.'3+(y.-0{x.)%2{x.'
   i ttt
syntax error
   i=.'2{x.'
   i ttt
syntax error
   i=.'y.+2{x.'
   i ttt
syntax error
   i=.'y.+2'
   i ttt
syntax error
   i=.'y.+x.'
   i ttt
syntax error
   i=.'x.+y.'
   i ttt
syntax error
   
   ttt =. : 11
   f =. 'x.+y.'
   f ttt
+-+-+-+
|[|+|]|                    <<<< ok, this one works...
+-+-+-+


   qlmt=.0 5 1 0.2 1 1.7 2.3 2.7 2.9
   w =. '' : '(x{x.)+(((x+-.(x+1)=$x.){x.)-((x=.<.x){x.))*1|x=.3+(y.-0{x.)%2{x.'
   qlmt w 2.3
1.88
   w : 11
domain error               <<<< say what? , and where?

   d=. '3+(y.-0{x.)%2{x.'
   d
3+(y.-0{x.)%2{x.
   d ttt
index error                  <<<< what does this mean in this context?
           
Memory fault - core dumped   <<<< happens a few seconds after the index error
$


$ j_3.4_sun4
J 3.4   Copyright (c) 1990 1991, Iverson Software Inc.  All Rights Reserved.

   i=. 'y.+2'
   ttt =. : 11
   i ttt
+-------+-+-+
|+-+-+-+|@|]|
||+|&|2|| | |
|+-+-+-+| | |
+-------+-+-+
   w =. '(x{x.)+(((x+-.(x+1)=$x.){x.)-((x=.<.x){x.))*1|x=.3+(y.-0{x.)%2{x.'
   w ttt
index error

i=.'y.+2'                     <<<< AH, there has to be a space after =.
i ttt
Memory fault - core dumped
$

-- 
 Mark Keil               HP/Apollo Computer,  Chelmsford MA 01824
 +1 508-256-6600 x4542   keil@apollo.hp.com  /  {decvax,mit-erl,yale}!apollo!keil

