At 17:59 -0400 2006/11/18, Arved Sandstrom wrote:
Hello,
I am a novice at J, and experimenting with the explicit to tacit converter.
The simplest cases I find straightforward. For example,
filtgt =. 13 : '(y > x) # y'
filtgt
______________
| | | |
| < | # | ] |
|____|____|____|
was easy enough to see as (<#]). However, I then tried
filtgtsq =. 13 : '(y^2 > x) # y'
filtgtsq
___________________________________________
| | _______ | _______________________ |
| ] | | | | | | | | ___________ | |
| | | # | ~ | | | ] | ^ | | | | | | |
| | |___|___| | | | | | 2 | > | [ | | |
| | | | | | |___|___|___| | |
| | | |___|___|_______________| |
|___|___________|___________________________|
and I am having no joy with translating this. Not yet. I am simply not a dab
hand yet with hooks, forks, &, @ and so forth. Just seeing how this would be
rendered would answer a bunch of questions.
Thanks.
AHS
I think part of your difficulty may be that (I'm guessing) you
didn't mean to say -
filtgtsq =. 13 : '(y^2 > x) # y'
filtgtsq
] #~ ] ^ 2 > [
but rather -
filtgtsq =. 13 : '((y^2) > x) # y'
filtgtsq
] #~ [ < 2 ^~ ]
Bill Harris' explanation was good too, this (more likely in
my opinion) experiment involves another argument swap for ^
That is, return members of y where y squared is greater than x.
The mistake (if it was one) is likely caused by there being no
precedence rules in j - so y^2 > x means y ^ (2 > x) which
seems like an odd, likely unintended, thing...
- joey
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm