develooper Front page | perl.perl6.language | Postings from May 2005

Re: (1,(2,3),4)[2]

Thread Previous | Thread Next
From:
Uri Guttman
Date:
May 25, 2005 16:07
Subject:
Re: (1,(2,3),4)[2]
Message ID:
x7acmirjl5.fsf@mail.sysarch.com
>>>>> "w" == wolverian  <wolv@sci.fi> writes:

  w> On Wed, May 25, 2005 at 01:38:27PM -0500, Rod Adams wrote:
  >> Or use
  >> 
  >> @a <== 1,2,3;

  w> I would just like to say that I like this idiom immensely.

  w>     my @foo <== 1, 2, 3;

  w> reads extremely well to me, especially since I've always disliked the
  w> usage of '=' as an operator with side effects. (I'm strange like that.)

please don't use <== for simple assignments as it will confuse too many
newbies and auch. it (and its sister ==>) are for pipelining ops like
map/grep and for forcing assignment to the slurpy array arg of funcs
(hey, i think i said that correctly! :). = is still fine for basic
assignment and everyone will understand it immediately.

the only advantage in the above case is the different prececences of =
and <== which allows dropping of parens with the latter. i don't
consider that so important a win as to be used often. and they are at
equal huffman levels as the =() is matched in length by <==.

uri

-- 
Uri Guttman  ------  uri@stemsystems.com  -------- http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs  ----------------------------  http://jobs.perl.org

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