On 4/18/07, Terrence Brannon <[EMAIL PROTECTED]> wrote:
1 0 1 0 0 0 # 3 1 4 1 5 9
...
Operand Pairing:
I don't know what you are doing here.
The frames are the same length, so we just go pair-wise
1 # 3
0 # 1
1 # 4
0 # 1
0 # 5
0 # 9
Not exactly. This sounds like
1 0 1 0 0 0 #("0) 3 1 4 1 5 9
but it is not clear what is being returned in the '0 # n' cases and how
the isolated pair-wise actions, some of which return a value and some
of which do not, are accumulated into a return value. Please advise on
this.
Try this:
1 0 1 0 0 0 <@#("0) 3 1 4 1 5 9
Hopefully it's clear that this verb applies # pairwise, and places each
result in a box.
In essence, a 1 on the left side makes one copy of the corresponding
item from the right side, while a 0 on the left side makes zero copies
of the corresponding item from the left side.
(append (# 1 3) (# 0 1) (# 1 4) (# 0 1) (# 0 5) (# 0 9) )
(append 3 nil 4 nil nil nil )
(append 3 4)
'(3 4)
Yes. In J, you could express this as
; 1 0 1 0 0 0 <@#("0) 3 1 4 1 5 9
(This does not precisely emulate all the steps lisp goes
through, but does create an intermediate result which
could be inspected.)
--
Raul
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm