develooper Front page | perl.perl6.language | Postings from June 2004

Re: Semantics of vector operations (Damian)

Thread Previous | Thread Next
From:
George Woolley
Date:
June 14, 2004 15:40
Subject:
Re: Semantics of vector operations (Damian)
Message ID:
200406141559.38117.george@metaart.org
Well, I'd speak up 
for intentionally allowing some silly alternatives
except that's IMO unnecessary.
With all the apparently-wonderful new possibilities
which we'll soon have
(OK, maybe not as soon as we'd like),
it seems most likely 
that some will turn out to be silly.
George "tim toady"


On Monday 14 June 2004 2:58 pm, Matthew Walton wrote:
> Austin Hastings wrote:
> > Perhaps we could consider the junctive lvalues as a sort of implied
> > ?= operation:
> >
> >    junction(@list) = value
> >
> > means
> >
> >    unless junction(@list) == value
> >    {
> >      given junction {
> >      when 'none' { (@list.grep value) = undef; }
> >      when 'any'  { for 0 .. random(@list) { @list[random(@list)] =
> > undef; } }
> >      when 'one'  { @list[random(@list)] = undef; }
> >      when 'all'  { @list = $(@list) x undef; }
> >      }
> >    }
> >
> > (which would make for some interesting use cases around 'any', at least
> > ;-)
>
> This is extremely scary. The thought of anybody actually using 'any' in
> their code is... umm... well, let's just say the Haskell programmer me
> is curling up in fright and screaming his head off, because the idea is
> entirely abhorrent to him. Gadget Matthew says it's a substanceless
> 'wow' feature. Both are also skeptical about 'one', and my psychiatrist
> is rattling pill bottles.
>
> 'none' could be useful, but it would be better to explicitly just say
>
> (@list.grep value) = undef
>
> although I think that might be supposed to be
>
> (@list.grep value) ยป= undef;
>
> as shouldn't list.grep return a list of matches? Which we assume are
> aliases to the original elements.
>
> I'm with Damian. TMTOWTDI yes, but there's a line between 'nice to have
> the alternative' and 'silly'.
>
> Oh, and the example appears to have forgotten that only 'none' should be
> assigning undef, the rest should be assigning value - shouldn't they? I
> think they should, otherwise it doesn't make any sense at all. Or
> perhaps it does, and I need to go to bed.
>
> Ciao.


Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About