[Jprogramming] Mask from list of indices with multiplicity
Don Guinn
donguinn at gmail.com
Mon Sep 6 19:16:34 HKT 2010
Is it really applying to a bigger-than-primitive, or is applying to the /. ?
f=.<
f/.!.0
+------+--+-+
|+-+--+|!.|0|
||f|/.|| | |
|+-+--+| | |
+------+--+-+
<!.0
+-+--+-+
|<|!.|0|
+-+--+-+
f!.0
|domain error
| f!.0
It certainly can't apply to the f because !. applies only to primitives.
Besides, the < is being used as monadic. It is /. that does the comparisons.
Never thought about it before, but this is a case where !. applies to a
non-verb. Shouldn't /. be added to the list of primitives to which !.
applies in the Dictionary?
On Sun, Sep 5, 2010 at 11:03 PM, Henry Rich <HenryHRich at nc.rr.com> wrote:
> You just need to get rid of the ~ :
>
> 1 [`]`(0 $~>:@(>./)@])} ia
>
> This is the implementation I would use. I don't see the need for
> special code, since the old code seems fast enough.
>
>
>
> On your earlier point, !. can be used on bigger-than-primitives:
>
> f/.!.0
>
> is one I use. It makes sure that intolerant comparison is used on the
> grouping performed by /. .
>
> Henry Rich
>
>
>
More information about the Programming
mailing list