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

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

Thread Previous | Thread Next
Uri Guttman
May 25, 2005 16:07
Re: (1,(2,3),4)[2]
Message ID:
>>>>> "w" == wolverian  <> 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 Guttman  ------  --------
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs  ----------------------------

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About