[Jprogramming] Newbie question about {.&>
Roger Hui
rhui000 at shaw.ca
Thu May 14 10:35:16 HKT 2009
> It does save a pair of '()' but that seems to be not a good
> practice as it
> doesn't use the 'primary' functionality of '>' which is to unbox
Who's to say what the "primary functionality" of
something is? I have on occasion used the monad
":&.> to produced formatted numbers individually boxed:
":&.> 0 1 1 2 3 5 8 13
+-+-+-+-+-+-+-+--+
|0|1|1|2|3|5|8|13|
+-+-+-+-+-+-+-+--+
where > is used to effect box (rather than unbox),
among other effects. Other examples:
; i.&.> 4 5 2
0 1 2 3 0 1 2 3 4 0 1
; 4 5 2 {.&.> 1
1 0 0 0 1 0 0 0 0 1 0
----- Original Message -----
From: gary ng <garyng2000 at gmail.com>
Date: Wednesday, May 13, 2009 19:11
Subject: Re: [Jprogramming] Newbie question about {.&>
To: Programming forum <programming at jsoftware.com>
> On Wed, May 13, 2009 at 6:53 PM, bill lam
> <bbill.lam at gmail.com> wrote:
>
> > On Wed, 13 May 2009, gary ng wrote:
> > > Are there any hidden 'gem' or reason to say '{.&>' rather
> than '({."0)'
> > as
> > > to me the only reason for the &> is to modify the rank of {. ?
> >
> > If the argument is un-boxed, why would you use {.&> ?
> What effect did
> > you expect from that > ?
> >
>
> That is what puzzled me. This is the original code I came across :
>
> (,|.@}:)(,.|.@}:"1)({.&>~#{.i:@#)(65}.a.)(>:@i.{.[)'E'
>
> from http://www.craigmurphy.com/blog/?p=1417#comment-66863
>
> It does save a pair of '()' but that seems to be not a good
> practice as it
> doesn't use the 'primary' functionality of '>' which is to unbox
More information about the Programming
mailing list