On Wed, Apr 9, 2014 at 3:20 PM, robert therriault <[email protected]> wrote:
> Hi Ray
>
> 1. You are right that   x y $ 5 is a syntax error so you first make x and y 
> into a list using ,   result is (x,y) $ 5 which should work.


You might be wondering "why!?"

A series of numbers is automatically converted to a list

We can confirm with match
(http://www.jsoftware.com/jwiki/Vocabulary/minusco#dyadic)

[True]
2 3 -: (2,3)
1

But what is x and y?

x=.2
y=.3

x y

|syntax error
| x y

It's a syntax error since it's two nouns with no operand

We can combine those two nouns into a list with append
(http://www.jsoftware.com/jwiki/Vocabulary/comma#dyadic)

(x,y) $ 1
1 1 1
1 1 1

That's why 2 3 $ 1 works but not x y $ 1
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to