[Jprogramming] J weirdness 0
'Jon Hough' via Programming
programming at jsoftware.com
Sat Apr 15 13:52:34 UTC 2017
I'm no J guru, but
instead of
NP 1 $ 1
you should probably do
(NP, 1) $ 1
--------------------------------------------
On Sat, 4/15/17, Michael Goodrich <michael.goodrich at gmail.com> wrote:
Subject: [Jprogramming] J weirdness 0
To: programming at jsoftware.com
Date: Saturday, April 15, 2017, 10:41 PM
OK J gurus, I fail to understand what appears
to be an irregularity in J:
X =. readtable 'X.txt'
shpX =. $X
dimX =. #shpX
NP =. >{shpX
Ones =. NP 1 $ 1
|syntax error
readtable => as defined in the
primer
X.txt a column of 50 numbers one on
each line
the idea here is to determine how many
numbers are in X which is what NP is
set to. J appears to agree with
me that NP is the proper number (and is
indeed a number) since:
NP
50
NP+1
51
And J is happy if do:
Ones0 =. 50 1 $ 1
Why will it not accept NP in the place
of the numeric literal 50???????
I await your wisdom ...
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm
More information about the Programming
mailing list