J gurus (and non gurus) many thanks and your suggestions worked!
The parsing rule is what i needed to understand.
Sent from my iPhone
On Apr 15, 2017, at 10:18 AM, chris burke wrote:
>> Why will it not accept NP in the place of the numeric literal 50?
>
> "50 1" and "NP 1" are parsed differ
> Why will it not accept NP in the place of the numeric literal 50?
"50 1" and "NP 1" are parsed differently:
;: '50 1'
++
|50 1|
++
;: 'NP 1'
+--+-+
|NP|1|
+--+-+
There is no rule for executing the noun noun pair in the second example, so
you need the alternatives already suggest
NP is a noun, and a strange one at that.
Not sure how it is intended to be different than shpX
(NP, 1) $ 1 might do what you intend?
From: Michael Goodrich
To: programm...@jsoftware.com
Sent: Saturday, April 15, 2017 9:42 AM
Subject: [Jprogramming] J
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 wrote:
Subject: [Jprogramming] J weirdness 0
To: programm...@jsoftware.com
Date: Saturday, April 15, 2017, 10:41 PM
OK J gur
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