Perl's lack of 'in' keyword

Paul LeoNerd Evans leonerd at leonerd.org.uk
Thu Oct 9 00:49:15 BST 2008


On Wed, 08 Oct 2008 16:22:20 +0100
Nigel Rantor <wiggly at wiggly.org> wrote:

> Jonathan Stowe wrote:
> > 2008/10/8 Nigel Rantor <wiggly at wiggly.org>:
> > 
> >> If anyone comes back and tell me that they think ~~ scans nicely in english,
> >> is easier to type and provides a better, clearer explanation of what it does
> >> in code than 'in' I will say no more on the subject because we would just be
> >> dealing with a huge gulf in our mental models of the world.
> >>
> > 
> > '~~' is not exactly the same as 'in' - it is 'smart match' and I'm
> > guessing it was chosen because of its similarity to '=~' which
> > everyone thinks of as 'match'.  I would hazard that finding a single
> > short unambiguous English word that would do instead might be
> > problematic.  If you need to say or think it out loud then "smart
> > match" is fine.
> 
> Yes, I saw Andy's previous post.
> 
> One of the things I like about perl is the fact that we have nice names 
> for things in addition to the concise versions, how's about an english 
> name for smart matching in addition to the ~~ operator? (can't we all 
> just get along, etc)

What??

  my $foo = $a + $b;

I suppose you'd suggest this can be written

  my scalar foo is scalar a add scalar b end statement

and somehow that is more readable?? As the previous poster said; if you
wanted COBOL you know where to find it. "ADD 1 TO COBOL GIVING COBOL" and
so on...


One of the things _I_ like about Perl is that it accepts the fact that
larger alphabets yield shorter sentences. Perl isn't afraid to use
symbols if it means they tend to give shorter statements that are quicker
to read or write.

-- 
Paul "LeoNerd" Evans

leonerd at leonerd.org.uk
ICQ# 4135350       |  Registered Linux# 179460
http://www.leonerd.org.uk/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://london.pm.org/pipermail/london.pm/attachments/20081009/a6aa2bee/signature.pgp


More information about the london.pm mailing list