Re: Perl's lack of 'in' keyword

2008-10-08 Thread Iain Barnett

On 9 Oct 2008, at 12:59 am, Paul LeoNerd Evans wrote:


Perhaps a better comparison may be

  my $foo = $a + $b[5];

and

  add scalar a to the fifth element of array b and assign to new  
scalar

foo



How about...?

foo = a + b[5]

The [EMAIL PROTECTED] etc signs are misplaced in modern perl (which is shown  
through Ruby's better use of them). A lot of the braces and brackets  
and ; could all be (to a large extent) kicked out of the language.  
Ruby manages it. Haskell manages it. C# is getting closer to it. I  
don't know more than a drop of Python but it looks cleaner (from a  
distance). Why keep in a load of stuff just because it was there in  
version 4 and just because a (new language) version called Perl6 may  
be completed soon.




but then does it really buy all that much?


For me, it says what I mean vs doing what I mean, which is why a lot  
of projects choose other languages which may be more verbose or "less  
expressive", but ultimately are easier to read than perl.



if $a ~~ $b #this could mean several things

if $a in $b #it is clear what this means

if a in b   #this is even better IMO


Iain




Re: Perl's lack of 'in' keyword

2008-10-08 Thread Paul LeoNerd Evans
On Thu, 9 Oct 2008 00:49:15 +0100
Paul LeoNerd Evans <[EMAIL PROTECTED]> wrote:

>   my $foo = $a + $b;
> 
> I suppose you'd suggest this can be written
> 
>   my scalar foo is scalar a add scalar b end statement

I suppose this is a little unfair, since my brain is sortof wired to
understand perl and English. Perhaps a better comparison may be

  my $foo = $a + $b[5];

and

  add scalar a to the fifth element of array b and assign to new scalar
foo



-- 
Paul "LeoNerd" Evans

[EMAIL PROTECTED]
ICQ# 4135350   |  Registered Linux# 179460
http://www.leonerd.org.uk/


signature.asc
Description: PGP signature


Re: Perl's lack of 'in' keyword

2008-10-08 Thread Nigel Rantor

Paul LeoNerd Evans wrote:


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


You suppose wrong.

Better luck next time.



Re: Perl's lack of 'in' keyword

2008-10-08 Thread Paul LeoNerd Evans
On Wed, 08 Oct 2008 16:08:21 +0100
Andy Wardley <[EMAIL PROTECTED]> wrote:

> However, I certainly would be in favour of having an extra 'in' keyword

There's always a danger when adding new keywords that they'll clash with
existing functions in existing code, given as they're barewords. That's
why 5.10 has the 'use feature' pragma for switch/etc...

I suppose you could

  use feature qw( in );

but then does it really buy all that much?

-- 
Paul "LeoNerd" Evans

[EMAIL PROTECTED]
ICQ# 4135350   |  Registered Linux# 179460
http://www.leonerd.org.uk/


signature.asc
Description: PGP signature


Re: Perl's lack of 'in' keyword

2008-10-08 Thread Paul LeoNerd Evans
On Wed, 08 Oct 2008 16:22:20 +0100
Nigel Rantor <[EMAIL PROTECTED]> wrote:

> Jonathan Stowe wrote:
> > 2008/10/8 Nigel Rantor <[EMAIL PROTECTED]>:
> > 
> >> 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

[EMAIL PROTECTED]
ICQ# 4135350   |  Registered Linux# 179460
http://www.leonerd.org.uk/


signature.asc
Description: PGP signature


Complaining (was: Re: Perl's lack of 'in' keyword

2008-10-08 Thread Chris Benson
On Wed, Oct 08, 2008 at 03:51:18PM +0100, Dominic Thoreau wrote:
> If there was nothing else to complain about, they'd complain that
> things were too nice.

In msg just received from the SO, currently on south coast of Crete:


P.S. Just overhead a neighbour say, "I don't like that beach, there's
too much sand." 



-- 
Chris Benson


EMERGENCY: Bright and Early Monday Morning

2008-10-08 Thread jesse
So, I find myself transiting Heathrow with a somewhat questionable
layover once more.

I'll be arriving in London this Sunday evening at about 9pm. I fly out
of Heathrow at 2:15pm on Monday.

The last couple times we've tried to breakfast at The Wolseley, we've
failed due to a lack of reservations.  If you'd like to eat breakfast on 
Monday, reply to me off-list with acceptable times and I'll attempt to
sort something out.

Best,
Jesse



Re: London.pm on Upcoming

2008-10-08 Thread David Cantrell
On Wed, Oct 08, 2008 at 05:58:39PM +0100, Dave Cross wrote:

> I don't have any problem with that at all. At least a couple of 
> london.pm'ers will be at the Python meeting. I was planning to go 
> myself, but I had to change my plans at the last minute.

I was going to go, but have decided to hack on interesting code instead,
because I've run into a limitation in an application that I use.

Said application is, amusingly, written in python :-)

-- 
David Cantrell | London Perl Mongers Deputy Chief Heretic

Seven o'clock in the morning is something that
happens to those less fortunate than me


Re: London.pm on Upcoming

2008-10-08 Thread Andy Armstrong

On 8 Oct 2008, at 17:58, Dave Cross wrote:
I don't have any problem with that at all. At least a couple of  
london.pm'ers will be at the Python meeting. I was planning to go  
myself, but I had to change my plans at the last minute.


Python is not the enemy. Dynamic languages should unite and fight  
the true enemy - The Judean Popular Front.



For some reason the phrase "The narcissism of small differences" has  
been on my mind a lot so far this week :)


--
Andy Armstrong, Hexten





Re: London.pm on Upcoming

2008-10-08 Thread David Dorward
Andrew Black wrote:
>   Other Events Like This
>   Wed, Oct 8 London Python meetup
> Discuss
>
Beer.
P-languages.
Beer.

-- 
David Dorward
http://dorward.me.uk/



Re: London.pm on Upcoming

2008-10-08 Thread Léon Brocard
2008/10/8 Andrew Black <[EMAIL PROTECTED]>:

>  Wed, Oct 8London Python meetup

http://upcoming.yahoo.com/event/1135363/

See you there!

Leon


Re: London.pm on Upcoming

2008-10-08 Thread Dave Cross

Andrew Black wrote:

Dave Cross wrote:


  http://upcoming.yahoo.com/group/12343/


Which says
  Other Events Like This
  Wed, Oct 8 London Python meetup
Discuss


I don't have any problem with that at all. At least a couple of 
london.pm'ers will be at the Python meeting. I was planning to go 
myself, but I had to change my plans at the last minute.


Python is not the enemy. Dynamic languages should unite and fight the 
true enemy - The Judean Popular Front.


Dave...



Re: London.pm on Upcoming

2008-10-08 Thread Andrew Black

Dave Cross wrote:


  http://upcoming.yahoo.com/group/12343/


Which says
  Other Events Like This
  Wed, Oct 8London Python meetup
Discuss


London.pm on Upcoming

2008-10-08 Thread Dave Cross


Just a reminder about the london.pm group on Upcoming. If you're 
planning to attend any of our forthcoming events and you've got an 
Upcoming account then please mark your attendance on Upcoming.


  http://upcoming.yahoo.com/group/12343/

Cheers,

Dave...



Re: Perl's lack of 'in' keyword

2008-10-08 Thread Magnus Erixzon
On Wed, Oct 8, 2008 at 4:20 PM, Nigel Rantor <[EMAIL PROTECTED]> wrote:

> But hey, it's my birthday, I'm allowed.

Happy birthday!

/m


Re: Perl's lack of 'in' keyword

2008-10-08 Thread Nigel Rantor

Andy Wardley wrote:

Nigel Rantor wrote:
Let's take "~~" for example. It's arguably harder to type than "in". 
And by that I mean for *me* it is harder to type. 


I agree.  ~~ is particularly hard for me to type on keyboards that put 
it at
the bottom left right next to the shift key (i.e. Macs).  'in' is much 
easier
to type, and also much easier to read.  Although ~~ is somewhat easier 
to read

in my head, now that I know it's called "wiggly wiggly".  ;-)


Yay!

As others have pointed out, '~~' isn't quite the same thing as 'in'.  It 
would

be potentially confusing in this kind of situation:

@foo ~~ @bar  # arrays are identical
@foo in @bar  # not what it looks like!


Indeed. I missed that initially.

However, I certainly would be in favour of having an extra 'in' keyword 
just

for those special cases where it does make sense.  It would be nice if we
could re-use it in for loops, too:

   print $x for $x in @y;

I'm sure it'll be easy to add it in Perl6.


Well, I'm quite happy with "foreach [] LIST"...but you're right, 
it'll prolly be in P6.


  n


Re: Perl's lack of 'in' keyword

2008-10-08 Thread Nigel Rantor

Jonathan Stowe wrote:

2008/10/8 Nigel Rantor <[EMAIL PROTECTED]>:


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)



"If you want COBOL you know where to find it"


No I don't, but google could probably help me.


Re: Perl's lack of 'in' keyword

2008-10-08 Thread Nigel Rantor

Nigel Metheringham wrote:


On 8 Oct 2008, at 14:51, Nigel Rantor <[EMAIL PROTECTED]> wrote:

If anyone comes back and tell me that they think ~~ scans nicely in 
english



Considering your email address I would have thought you would be very
much in favour of ~~ and have a good way of pronouncing it


*fnaar*

Good work fella. You're right, I just wanted to retain the possibility 
of using ~~ for my own nefarious ends in a yet-to-be-written Perl source 
filter *cue evil laughter*


Although, if people are going to start calling it the "wiggly" operator 
that wouldn't be too bad either. B-)






Re: Perl's lack of 'in' keyword

2008-10-08 Thread Peter Corlett

On 8 Oct 2008, at 16:12, James Laver wrote:
[...]
I also seem to recall the 'inchworm on a stick', '~-'. I had to  
google to
find out what it does, but it seems to be a high precedence  
decrement[1]


It's a rather sneaky trick based on how two's complement works.

Come steal my copy of "Hacker's Delight" sometime. It's chock full of  
sneaky number tricks like this.





Re: Perl's lack of 'in' keyword

2008-10-08 Thread Nigel Rantor

Andy Armstrong wrote:

On 8 Oct 2008, at 14:51, Nigel Rantor wrote:
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.



But ~~ isn't the same as in - it's a smart match not an inclusion test.


mea culpa.

and as it's an operator in the sense of ==, &&, || etc how about we 
simply have another name for it like 'and', 'or' and 'not' for those of 
us who want to talk English in Perl?


Yes, I realise I just started another two wars with the above comment. 
But hey, it's my birthday, I'm allowed.


  n


Re: Perl's lack of 'in' keyword

2008-10-08 Thread Peter Corlett

On 8 Oct 2008, at 15:51, Dominic Thoreau wrote:
[...]

This is the world's biggest lie. People will complain about
everything. The price of $commodity. The traffic. The weather (it's
too hot/too cold/too changing/too consistent).
If there was nothing else to complain about, they'd complain that
things were too nice.


Hence the old joke from Australia: "How do you know a plane full of  
Poms has just arrived? The whining continues after they turn the  
engines off."





Re: Perl's lack of 'in' keyword

2008-10-08 Thread James Laver
On 2008-10-08 15:55, "Philippe Bruhat (BooK)" <[EMAIL PROTECTED]>
wrote:
> 
> Note that the ~~ secret operator (the one that does "scalar" and works
> with Perls older than 5.10, not "smart-match") is called "inchworm".
> 
> Example usage:
> 
> perl -le'print~~localtime'

Again the name relevance is a question of font.

I also seem to recall the 'inchworm on a stick', '~-'. I had to google to
find out what it does, but it seems to be a high precedence decrement[1]

Now at least we can identify the london.pm members who should spend less
time golfing...

Cheers,
--James

[1] http://www.mail-archive.com/[EMAIL PROTECTED]/msg03450.html




Re: Perl's lack of 'in' keyword

2008-10-08 Thread Andy Wardley

Nigel Rantor wrote:
Let's take "~~" for example. It's arguably harder to type than "in". And 
by that I mean for *me* it is harder to type. 


I agree.  ~~ is particularly hard for me to type on keyboards that put it at
the bottom left right next to the shift key (i.e. Macs).  'in' is much easier
to type, and also much easier to read.  Although ~~ is somewhat easier to read
in my head, now that I know it's called "wiggly wiggly".  ;-)

As others have pointed out, '~~' isn't quite the same thing as 'in'.  It would
be potentially confusing in this kind of situation:

@foo ~~ @bar  # arrays are identical
@foo in @bar  # not what it looks like!

However, I certainly would be in favour of having an extra 'in' keyword just
for those special cases where it does make sense.  It would be nice if we
could re-use it in for loops, too:

   print $x for $x in @y;

I'm sure it'll be easy to add it in Perl6.

A



Re: Perl's lack of 'in' keyword

2008-10-08 Thread Dominic Thoreau
2008/10/8 Nigel Rantor <[EMAIL PROTECTED]>:
>
> I like Perl, but I complain about it all the time.

As I'm only known to London.pm as an email contributor atm, I'll
delurk a little more by giving out more information.

Since I wasn't born in this *hemisphere*, I've come to realize some
things about the British character.

Two people meet in the street, and the usual pleasantries ensue:
- How are you?
- Oh, I can't complain...

This is the world's biggest lie. People will complain about
everything. The price of $commodity. The traffic. The weather (it's
too hot/too cold/too changing/too consistent).
If there was nothing else to complain about, they'd complain that
things were too nice.

People can always complain - this is not a big problem. It's the
things they aren't complaining about that are really bothering them.

And to reply to another message in this one:
> "If you want COBOL you know where to find it"

No. I don't know where to find it. And I'm interested in having it
stay that way. I studied it briefly. Just enough exposure to the
language to cause extreme aversion. You cannot afford to make write
that. We're talking mega-oligarch rates here.
-- 
No train here, but still:
The sign says: "Ready to Leave"
Normal service, yes?


Re: Perl's lack of 'in' keyword

2008-10-08 Thread Philippe Bruhat (BooK)
On Wed, Oct 08, 2008 at 03:36:18PM +0100, Paul Makepeace wrote:
> On Wed, Oct 8, 2008 at 3:22 PM, Nigel Metheringham
> <[EMAIL PROTECTED]> wrote:
> >
> > On 8 Oct 2008, at 14:51, Nigel Rantor <[EMAIL PROTECTED]> wrote:
> >
> >> If anyone comes back and tell me that they think ~~ scans nicely in
> >> english
> >
> >
> > Considering your email address I would have thought you would be very
> > much in favour of ~~ and have a good way of pronouncing it
> 
> OMG ROFL!
> 
> If this operator doesn't have a well-established way of being
> pronounced I think it ought to have this one!

Note that the ~~ secret operator (the one that does "scalar" and works
with Perls older than 5.10, not "smart-match") is called "inchworm".

Example usage:

perl -le'print~~localtime'

-- 
 Philippe Bruhat (BooK)

 There is no greater magic than knowing exactly who and what you are.
 (Moral from Groo #2 (Image))


Re: Perl's lack of 'in' keyword

2008-10-08 Thread Ovid
--- On Wed, 8/10/08, Nigel Metheringham <[EMAIL PROTECTED]> wrote:

> > If anyone comes back and tell me that they think ~~
> scans nicely in  
> > english
> 
> 
> Considering your email address I would have thought you
> would be very
> much in favour of ~~ and have a good way of pronouncing
> it

Ooh!  Nigel versus Nigel and Nigel wins!

Seriously, though ... when I first saw the regex binding operator "=~", I 
thought the same thing.  Now I don't even blink.  If people find smart match 
useful enough, this operator will become so commonplace that many might 
complain, but few will be worried about it.

Beer.

Cheers,
Ovid
--
Buy the book - http://www.oreilly.com/catalog/perlhks/
Tech blog- http://use.perl.org/~Ovid/journal/
Twitter  - http://twitter.com/OvidPerl
Official Perl 6 Wiki - http://www.perlfoundation.org/perl6



Re: [Gllug-Social] [ANNOUNCE] Croyden.pm: cancelled

2008-10-08 Thread Gordon Joly

At 16:06 +0100 7/10/08, David Cantrell wrote:

Croyden.pm this evening is cancelled due to lack of interest.




Funny, I was thinking of attending a nearby beer festival...


http://www.croydoncamra.org.uk/

9th to 11th Oct - Wallington Beer Festival

Wallington Hall, Stafford Road, Wallington, SM6 9AQ.

Gordo


--
"Think Feynman"/
http://pobox.com/~gordo/
[EMAIL PROTECTED]///


Re: Perl's lack of 'in' keyword

2008-10-08 Thread Iain Barnett

On 8 Oct 2008, at 3:22 pm, Abigail wrote:



Note that ~~ is easier to search for in a text file due to getting
far less false positives on ~~ than when searching with 'in'.


`in`?


On 8 Oct 2008, at 3:13 pm, Jonathan Stowe wrote:

guessing it was chosen because of its similarity to '=~'


That makes a lot of sense. Thanks.


On 8 Oct 2008, at 2:51 pm, Nigel Rantor wrote:


I like Perl, but I complain about it all the time.


Me too. Actually, I complain about everything, it distracts people  
from my own shoddy work/life :)



Iain


Re: Perl's lack of 'in' keyword

2008-10-08 Thread Paul Makepeace
On Wed, Oct 8, 2008 at 3:22 PM, Nigel Metheringham
<[EMAIL PROTECTED]> wrote:
>
> On 8 Oct 2008, at 14:51, Nigel Rantor <[EMAIL PROTECTED]> wrote:
>
>> If anyone comes back and tell me that they think ~~ scans nicely in
>> english
>
>
> Considering your email address I would have thought you would be very
> much in favour of ~~ and have a good way of pronouncing it

OMG ROFL!

If this operator doesn't have a well-established way of being
pronounced I think it ought to have this one!


Re: Perl's lack of 'in' keyword

2008-10-08 Thread Jonathan Stowe
2008/10/8 Nigel Rantor <[EMAIL PROTECTED]>:

>
> 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.

"If you want COBOL you know where to find it"


Re: Perl's lack of 'in' keyword

2008-10-08 Thread Nigel Metheringham


On 8 Oct 2008, at 14:51, Nigel Rantor <[EMAIL PROTECTED]> wrote:

If anyone comes back and tell me that they think ~~ scans nicely in  
english



Considering your email address I would have thought you would be very
much in favour of ~~ and have a good way of pronouncing it

Nigel.
--
[ Nigel Metheringham [EMAIL PROTECTED] ]
[ - Comments in this message are my own and not ITO opinion/policy - ]



Re: Perl's lack of 'in' keyword

2008-10-08 Thread Abigail
On Wed, Oct 08, 2008 at 02:51:51PM +0100, Nigel Rantor wrote:
>
> I'm not necessarily saying that we need to replace anything that is  
> already there in the language, but why must we *add* more things that  
> that look like noise?
>
> Let's take "~~" for example. It's arguably harder to type than "in". And  
> by that I mean for *me* it is harder to type. I need to hit shift to do  
> it, so it's slower than 'in'.

That's streching it, and the difference is so minimal, I don't think
it's relevant. Yes, for ~~ one needs the shift key, but a shift key can
be pressed at the same time as another key (and there are shift keys
on both sides of most keyboards), and ~~ requires no replacement of
fingers between the keystrokes. 'in' requires movement of the fingers -
of the same hand even - between the two characters.

Note that ~~ is easier to search for in a text file due to getting
far less false positives on ~~ than when searching with 'in'.

>   It is not shorter than 'in' so doesn't win  
> on speed nor brevity. It also doesn't scan like english, so whilst  
> something like:
>
> die "can't find it guv!" unless $thing in @set;
>
> reads quite nicely,
>
> die "can't find it guv!" unless $thing ~~ @set;
>
> doesn't.

But 

  die "..." unless $thing in $sub;

is just plain weird. While '~~' isn't "obvious" (but then, neither is =~,
or even '=' for that matter), it certainly doesn't confuse people as
'in' would were it used to replace '~~'.



Abigail


Re: Perl's lack of 'in' keyword

2008-10-08 Thread Andy Armstrong

On 8 Oct 2008, at 14:51, Nigel Rantor wrote:
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.



But ~~ isn't the same as in - it's a smart match not an inclusion test.

--
Andy Armstrong, Hexten





Re: Perl's lack of 'in' keyword

2008-10-08 Thread Nigel Rantor

Andy Armstrong wrote:

On 8 Oct 2008, at 12:18, Nigel Rantor wrote:
And, having already read Iain's reply, I agree. That's not the winning 
attitude that Perl advocates should aim to present.



I wasn't whining. In fact I don't think I do whining. It was a serious 
question - should we allow the design of the language to be influenced 
by a focus group consisting of people who dislike it?


Okay, good, I didn't think you were whining, just being a little 
aggressive. But that's e-mail for you, no tone or register.


On topic, I would say that someone "complaining" that something looks 
too much like line noise is not necessarily someone who "dislikes" the 
language.


I like Perl, but I complain about it all the time.

For example, threads? Please? POE sucks arse in lots of areas where a 
threading implementation that worked somewhat like POSIX would be 
infinitely easier to use and debug. I complain less about this publicly 
because I do not have enough time to do it myself, and getting the 
obligatory "quicker if you help" answer to "when" isn't always helpful.


There's a difference between complaining so you can call something crap 
and complaining to get something made better. I think complaining that 
~~ is easily confused with -- is fairly valid. I also think that 
complaining that ~~ does not immediately tell you what it does is also 
valid.


I take your point that perhaps some Perl people would also like to move 
away from the line noise look. My view on that is that it's probably a 
bit late for Perl 5 to change the habit of a lifetime so they should be 
early adopters of Perl 6 where they can make the language look exactly 
how they want it to :)


I'm not necessarily saying that we need to replace anything that is 
already there in the language, but why must we *add* more things that 
that look like noise?


Let's take "~~" for example. It's arguably harder to type than "in". And 
by that I mean for *me* it is harder to type. I need to hit shift to do 
it, so it's slower than 'in'. It is not shorter than 'in' so doesn't win 
on speed nor brevity. It also doesn't scan like english, so whilst 
something like:


die "can't find it guv!" unless $thing in @set;

reads quite nicely,

die "can't find it guv!" unless $thing ~~ @set;

doesn't.

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.


  n



Re: Apple service providers

2008-10-08 Thread Peter Corlett

On 8 Oct 2008, at 13:25, David Cantrell wrote:
[...]
Given the number of crazy people who shouted at me for paying  
someone to

put some memory in my new machine, saying that I should have done it
myself to save an insignificant number of pennies, I was sure that one
of them would want a broken machine on the cheap that they could  
waste a

great many hours fixing.


Offer it to thebookyard.com to break for spares.

Although if you're going to do that, and assuming they parts are  
compatible with my broken PowerBook, I'd quite like the DC-IN board  
and PSU. (TBY would charge me about £80 for those bits.)






Re: Apple service providers

2008-10-08 Thread Dave Hodgkinson


On 8 Oct 2008, at 13:25, David Cantrell wrote:


On Wed, Oct 08, 2008 at 02:56:35AM -0700, [EMAIL PROTECTED] wrote:


You're seriously expecting this to have some resale value?


Given the number of crazy people who shouted at me for paying  
someone to

put some memory in my new machine, saying that I should have done it
myself to save an insignificant number of pennies, I was sure that one
of them would want a broken machine on the cheap that they could  
waste a

great many hours fixing.



I shouted at you because it really is so easy. Even I did it.

And the dodgy screen thing is pretty damn unfixable. I've had
two old powerbooks epically fail on that.

--
Dave HodgkinsonMSN: [EMAIL PROTECTED]
Site: http://www.davehodgkinson.com   UK: +44 7768 49020
Blog: http://davehodg.blogspot.comNL: +31 654 982906
Photos: http://www.flickr.com/photos/davehodg







Re: Perl's lack of 'in' keyword

2008-10-08 Thread Ovid
--- On Wed, 8/10/08, Paul Makepeace <[EMAIL PROTECTED]> wrote:

> > Smart-match smells too much of DWIMmery for me to be
> comfortable with
> > it.
> 
> Does calling it polymorphism help?

Heh :)

++

Cheers,
Ovid
--
Buy the book - http://www.oreilly.com/catalog/perlhks/
Tech blog- http://use.perl.org/~Ovid/journal/
Twitter  - http://twitter.com/OvidPerl
Official Perl 6 Wiki - http://www.perlfoundation.org/perl6




Re: Perl's lack of 'in' keyword

2008-10-08 Thread Paul Makepeace
On Wed, Oct 8, 2008 at 12:56 PM, David Cantrell <[EMAIL PROTECTED]> wrote:
> On Tue, Oct 07, 2008 at 09:57:38PM +0100, Iain Barnett wrote:
>
>> I agree with both your points, but that also doesn't invalidate the
>> point that perl might benefit from less "line noisy" syntax at times,
>> just as ~~ doesn't necessarily obviate the need for an "in" operator.
>> The smart match does look good though.
>
> Smart-match smells too much of DWIMmery for me to be comfortable with
> it.

Does calling it polymorphism help?

P


Re: Perl's lack of 'in' keyword

2008-10-08 Thread Iain Barnett


On 8 Oct 2008, at 10:05 am, Tom Hukins wrote:


On Tue, Oct 07, 2008 at 09:57:38PM +0100, Iain Barnett wrote:

Ok, no problem. I read it that way because the default monger
response to any criticism of perl is the old Wimbledon chant, "No one
likes us but we don't care".


I think you mean Millwall, although Wimbledon 2.0 (MK Dons) have
adopted this chant probably because they're less popular than
Millwall.  To paraphrase John Lennon.  Badly.

Some people eat pie at football matches, so I declare this post
on-topic.

Tom



You are, of course, all on both counts (though I wouldn't trust the  
pie at football matches).


Iain


Re: Apple service providers

2008-10-08 Thread David Cantrell
On Wed, Oct 08, 2008 at 02:56:35AM -0700, [EMAIL PROTECTED] wrote:

> You're seriously expecting this to have some resale value?

Given the number of crazy people who shouted at me for paying someone to
put some memory in my new machine, saying that I should have done it
myself to save an insignificant number of pennies, I was sure that one
of them would want a broken machine on the cheap that they could waste a
great many hours fixing.

-- 
David Cantrell | Enforcer, South London Linguistic Massive

  engineer: n. one who, regardless of how much effort he puts in
to a job, will never satisfy either the suits or the scientists


Re: Perl's lack of 'in' keyword

2008-10-08 Thread David Cantrell
On Tue, Oct 07, 2008 at 09:57:38PM +0100, Iain Barnett wrote:

> I agree with both your points, but that also doesn't invalidate the  
> point that perl might benefit from less "line noisy" syntax at times,  
> just as ~~ doesn't necessarily obviate the need for an "in" operator.  
> The smart match does look good though.

Smart-match smells too much of DWIMmery for me to be comfortable with
it.

-- 
David Cantrell | Official London Perl Mongers Bad Influence

What a lovely day!  Now watch me spoil it for you.


Re: Perl's lack of 'in' keyword

2008-10-08 Thread Andy Armstrong

On 8 Oct 2008, at 12:18, Nigel Rantor wrote:
And, having already read Iain's reply, I agree. That's not the  
winning attitude that Perl advocates should aim to present.



I wasn't whining. In fact I don't think I do whining. It was a serious  
question - should we allow the design of the language to be influenced  
by a focus group consisting of people who dislike it?


I take your point that perhaps some Perl people would also like to  
move away from the line noise look. My view on that is that it's  
probably a bit late for Perl 5 to change the habit of a lifetime so  
they should be early adopters of Perl 6 where they can make the  
language look exactly how they want it to :)


--
Andy Armstrong, Hexten





Re: Perl's lack of 'in' keyword

2008-10-08 Thread Nigel Rantor

Andy Armstrong wrote:

On 7 Oct 2008, at 17:50, Iain Barnett wrote:

Why wait for Perl 6? Perl 5 has had it for almost a year now. It's
spelled ~~ though.


Is there some reason why -- was picked over 'in' ? It just seems to 
pander to those who think perl reads like line noise.



It's ~~ not -- and it's not just in - it's a general purpose adaptive 
match whose semantics are determined by the things being matched.


And (meta) who cares about people who think that Perl reads like line 
noise. Should the language bend to the preferences of those who dislike it?


People who care about Perl, like it, and want more people to do the same.

Do you not recall the amount of disagreement caused when the list 
discussed some perl 6 features syntax that split people horribly into 
the "it's just so much line noise" vs "what's wrong with line noise" camps?


And, having already read Iain's reply, I agree. That's not the winning 
attitude that Perl advocates should aim to present.


  n


Re: Perl's lack of 'in' keyword

2008-10-08 Thread Matt S Trout
On Tue, Oct 07, 2008 at 04:20:57PM +0100, Dagfinn Ilmari Mannsåker wrote:
> "Paul Makepeace" <[EMAIL PROTECTED]> writes:
> 
> > ... is starting to frustrate me. It's the one feature I am finding I'm
> > really missing from That Other Language.
> >
> >   if ($bar in @foo) {
> > # ...
> >   }
> 
> use Perl6::Junction qw/any/;
> 
> if ($bar eq any(@foo)) {
>   # ...
> }

And note that Perl6::Junction is a relatively crack-free module - no
non-core deps and a pretty clean implementation. The only real crack in
there is the heavy use of operator overloading, and I've kinda reached the
point where that doesn't count as crack at all to me :)

-- 
  Matt S Trout   Need help with your Catalyst or DBIx::Class project?
   Technical Directorhttp://www.shadowcat.co.uk/catalyst/
 Shadowcat Systems Ltd.  Want a managed development or deployment platform?
http://chainsawblues.vox.com/http://www.shadowcat.co.uk/servers/


Re: [OT] What's my name?

2008-10-08 Thread Matt S Trout
On Tue, Oct 07, 2008 at 05:27:37PM +0100, Nicholas Clark wrote:
> In this code:
> 
> *beer = *buffy = *pie = *kittens = sub {
> ...
> };
> 
> is there an easy way for the subroutine to know what name it was called as.
> If it makes it easier, the subroutine is actually going to be a method.

I'm not sure the information you want exists outside of the GV2RV op.

Figuring out which one of those you got called with is left as an exercise
to those with more crack handy.

-- 
  Matt S Trout   Need help with your Catalyst or DBIx::Class project?
   Technical Directorhttp://www.shadowcat.co.uk/catalyst/
 Shadowcat Systems Ltd.  Want a managed development or deployment platform?
http://chainsawblues.vox.com/http://www.shadowcat.co.uk/servers/


Re: Apple service providers

2008-10-08 Thread ben
On Tue, Oct 07, 2008 at 04:40:25PM +0100, Martin A. Brooks wrote:
>Simon Wilcox wrote:
>>Anyone have recommendations/horror stories to share ?
>
>As the person who handled all of Fotango's apple problems, we used 
>http://www.mrsystems.co.uk/ on the basis they were closest to the 
>office.  The service was, imo, appaling, but apparently that's par for 
>the course for AppleCare, where it's okay for you to be without your 
>computer for a couple of weeks.

Avoid MR like the plague.

My MBP had a dodgy RAM stick, which was trivial to diagnose with memtest.

MR listened attentively to my description of the issue, and took my MBP, 
promising to call me the following day. 4 days later, after a series of 
increasingly vague phonecalls, I came to collect my MBP, which they hadn't
so much as touched.

I went straight to the Apple Store, where I was given the usual flannel
about there not being any appointments for several days. I made a very
polite, slightly louder than usual talking scene about having paid for my
AppleCare, etc and was seen by a Genius immediately after delivering the
line: "So what you're saying is that such a high percentage of Apple hardware
is defective, that you're unable to keep enough technical staff on hand
to deal with the issues?"

The Genius found the dodgy RAM in about 5 minutes, and I was fixed and on
my way in another 10.

Ben


Re: Apple service providers

2008-10-08 Thread ben
On Tue, Oct 07, 2008 at 05:59:26PM +0100, David Cantrell wrote:
>On Tue, Oct 07, 2008 at 05:46:14PM +0100, Iain Barnett wrote:
>
>> http://www.ifixit.com/Guide/
>
>Anyone wanna DVI Powerbook?  The screen's on the fritz, probably just a
>loose connection, but I really can't be arsed going through the 40-odd
>steps just to get at the bits to look at them.
>
>The symptoms are that sometimes the display goes all wibbly.  Giving the
>case a sharp tap fixes it temporarily.
>
>Make me an offer off-list.

You're seriously expecting this to have some resale value?

Ben


Re: Perl's lack of 'in' keyword

2008-10-08 Thread Tom Hukins
On Tue, Oct 07, 2008 at 09:57:38PM +0100, Iain Barnett wrote:
> Ok, no problem. I read it that way because the default monger  
> response to any criticism of perl is the old Wimbledon chant, "No one  
> likes us but we don't care".

I think you mean Millwall, although Wimbledon 2.0 (MK Dons) have
adopted this chant probably because they're less popular than
Millwall.  To paraphrase John Lennon.  Badly.

Some people eat pie at football matches, so I declare this post
on-topic.

Tom