[Jprogramming] monad vs. dyad
Roger Hui
rhui000 at shaw.ca
Wed Mar 21 23:23:46 HKT 2007
Sorry, there was a typo in the description.
It should be
z=. y
while. proposition z do. z=. f z end.
For example:
f=: 1 + 3 * ]
proposition=: 1e5&>
foo=: 3 : 0
z=. y
while. proposition z do. z=. f z end.
)
f^:proposition^:(_) 3
206671
foo 3
206671
----- Original Message -----
From: Geoff Canyon <geoffc at inspiredlogic.com>
Date: Wednesday, March 21, 2007 7:29 am
Subject: Re: [Jprogramming] monad vs. dyad
>
> On Mar 20, 2007, at 3:08 AM, Roger Hui wrote:
>
> > 3. Yes, for example:
> >> : ^: (1 < [: #@~. [: /:~@":"0 (>:i.6) * ]) ^: _ ] 1
> > 142857
> >
> > f^:proposition^:_ y is a common construct, meaning
> > z=. y
> > while. proposition y do. z=. f z end.
>
> The above gives a syntax error and I'm not finding any
> documentation
> on this construct. Do you mean something like this:
>
> (1&+)^:(z<y)^:_ 3
>
> It just displays itself, so that can't be right, but it's my best
> limited understanding.
More information about the Programming
mailing list