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:35
Subject:
Re: (1,(2,3),4)[2]
Message ID:
x7sm0aq3qe.fsf@mail.sysarch.com
>>>>> "w" == wolverian  <wolv@sci.fi> writes:

  w> On Wed, May 25, 2005 at 07:07:02PM -0400, Uri Guttman wrote:
  >> 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.

  w> I thought the op is visually so obvious it wouldn't need any
  w> explanation, even for newbies.

  w> Too bad what I _think_ is often not what actually _is_.

well, = has massive history on its side and almost all commonly used
languages use it for assignment (pascal is NOT common anymore,
thankfully and lisp isn't common enough :). so there is zero learning
curve for that. you do need to learn about perl's precedences which need
() for assigning a list. but <== may seem obvious to you and for sure to
anyone here but imagining what newbies would make of it boggles me. if
there is a way to misunderstand it and abuse it, it will happen. :) so
consider it just a style rule that i would encourage. damian should add
it to his P6BP book when it comes out next christmas. :)

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