On Fri, Dec 5, 2008 at 6:54 AM, Igor Zhuravlov <[EMAIL PROTECTED]> wrote:
> I have the following definition (simplified model):
>
> a=: 1 : 0
> :
> if. 1 < # y do.
> x $: (}. y)
> else.
> x u y
> end.
> )
>
> And I got stack error here:
> 7 + a 1 2 3
> |stack error
> | x $:(}.y)
>
> I know about working variant:
>
> a2=: 1 : 0
> :
> x (u`($: }.) @. (1 < ([EMAIL PROTECTED]))) y
> )
>
> but it's not desirable (more precisely, I've failed to convert it to tacit
> form). I'd like $: in adverb a to be the verb (+ a) or whatever called. Is it
> possible?
Note that this looks like a workalike for a2, for the domain you
have choosen:
a2b=: 1 :0
:
x u (}.~ <:@#) y
)
Or, if the shape isn't really an issue for you, you could
replace that parenthesized expression with {:
That said, I think I know how to do the sort of recursion you are
trying for, I just need to consider things a bit more carefully.
--
Raul
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm