The problem stems from $: .
When you have
('cd' foo (<'ef')) &.<
the whole thing is the verb phrase, so when $: is executed
it goes all the way back to the &.< and you get the
extra boxing.
Henry Rich
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf Of bill lam
> Sent: Monday, August 28, 2006 11:40 PM
> To: Programming forum
> Subject: Re: [Jprogramming] how to write adverb with rank
>
> Thank to Raul for help too.
>
> I found something strange
>
> in_foo=: 2 : 0
> :
> x,(>y),m,(>n)
> )
>
> foo=: 2 : '''default''&$: : (m in_foo n)"0 1 0'
>
> 'ab'('cd' foo (<'ef'))<'gh'
> abghcdef
> ('cd' foo (<'ef'))<'gh'
> defaultghcdef
> > ('cd' foo (<'ef')) < 'gh'
> defaultghcdef
> ('cd' foo (<'ef')) &.< 'gh'
> |domain error
> | x,(>y) ,m,(>n)
>
> in debug windows values becomes
> m n 2$'cd'
> n n <2$'ef'
> u n 2$'cd'
> v n <2$'ef'
> x n <7$'default'
> y n {boxed}
>
> x
> +-------+
> |default|
> +-------+
> y
> +----+
> |+--+|
> ||gh||
> |+--+|
> +----+
>
> for &.< it seems x and y are boxed before passing into
> in_foo, why this happen
> and what will be workaround?
>
> --
> regards,
> bill
> ----------------------------------------------------------------------
> For information about J forums see
> http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm