Re: lambda - a shortcut for sub {...}

2007-10-13 Thread Fergal Daly
On 12/10/2007, Bill Ward [EMAIL PROTECTED] wrote:
 On 10/11/07, A. Pagaltzis [EMAIL PROTECTED] wrote:
  * Eric Wilhelm [EMAIL PROTECTED] [2007-10-11 01:05]:
 http://search.cpan.org/~ewilhelm/lambda-v0.0.1/lib/lambda.pm
 
  If I saw this in production code under my responsibility, I'd
  submit it to DailyWTF. However, I have nothing against its use
  in code I'll never see. Carry on.
 
  This opinion brought to you by Andy Lester's Perlbuzz rant.

 What worries me is someone's gonna submit an otherwise useful module
 to CPAN that uses this feature.

I doubt it. Anyone who can produce a genuinely useful module on CPAN
is unlikely to want add a dependency for the sake of a few keystrokes.
There are people who won't even use better testing modules because
it would add a dependency,

F


Re: lambda - a shortcut for sub {...}

2007-10-12 Thread Bill Ward
On 10/11/07, A. Pagaltzis [EMAIL PROTECTED] wrote:
 * Eric Wilhelm [EMAIL PROTECTED] [2007-10-11 01:05]:
http://search.cpan.org/~ewilhelm/lambda-v0.0.1/lib/lambda.pm

 If I saw this in production code under my responsibility, I'd
 submit it to DailyWTF. However, I have nothing against its use
 in code I'll never see. Carry on.

 This opinion brought to you by Andy Lester's Perlbuzz rant.

What worries me is someone's gonna submit an otherwise useful module
to CPAN that uses this feature.


Re: lambda - a shortcut for sub {...}

2007-10-12 Thread Johan Vromans
Bill Ward [EMAIL PROTECTED] writes:

 What worries me is someone's gonna submit an otherwise useful module
 to CPAN that uses this feature.

Unfortunately, that is inherent to the nature of CPAN. 

Personally, I have to reject many potential useful CPAN modules
because they use a plethora of other modules that most of the time are
not even related to the problem at hand.

For example: I need functionality A. CPAN module Foo implements A, but
also B. For B, it needs 891 other CPAN modules, with their
dependencies. In this case, I try to isolate the A functionality and
copy it to my own code.

An associated issue (that has been raised here before) is related to
modules that need a whole bunch of CPAN modules just for building and
testing.

As I said, that is inherent to the nature of CPAN. 

-- Johan


Re: lambda - a shortcut for sub {...}

2007-10-12 Thread Johan Vromans
Eric Wilhelm [EMAIL PROTECTED] writes:

 IMO, shortcuts for typing long things will lead us to Eclipse.

And precisely, what's wrong with that?

ducks

-- Johan


RE: lambda - a shortcut for sub {...}

2007-10-12 Thread Pearce, Martyn
Isn't that just a way of saying that we reach for the stars by standing
on the shoulders of giants? 

-Original Message-
From: Johan Vromans [mailto:[EMAIL PROTECTED] 
Sent: Friday, October 12, 2007 9:44 AM
To: module-authors@perl.org
Subject: Re: lambda - a shortcut for sub {...}

Bill Ward [EMAIL PROTECTED] writes:

 What worries me is someone's gonna submit an otherwise useful module
 to CPAN that uses this feature.

Unfortunately, that is inherent to the nature of CPAN. 

Personally, I have to reject many potential useful CPAN modules
because they use a plethora of other modules that most of the time are
not even related to the problem at hand.

For example: I need functionality A. CPAN module Foo implements A, but
also B. For B, it needs 891 other CPAN modules, with their
dependencies. In this case, I try to isolate the A functionality and
copy it to my own code.

An associated issue (that has been raised here before) is related to
modules that need a whole bunch of CPAN modules just for building and
testing.

As I said, that is inherent to the nature of CPAN. 

-- Johan



Re: lambda - a shortcut for sub {...}

2007-10-12 Thread Eric Wilhelm
# from Bill Ward
# on Friday 12 October 2007 01:23:

What worries me is someone's gonna submit an otherwise useful module
to CPAN that uses this feature.

What worries me is that anyone is worried about that.  Do you audit your 
dependencies to make sure that none of them says 'use utf8'?

--Eric
-- 
Introducing change is like pulling off a bandage: the pain is a memory
almost as soon as you feel it.
--Paul Graham
---
http://scratchcomputing.com
---


Re: lambda - a shortcut for sub {...}

2007-10-12 Thread David Landgren

Eric Wilhelm wrote:

The great thing about maintenance programmers is that they come from the 
future (the one where utf8 just works.)


Wow. Which parallel future do you come from ? :)



Re: lambda - a shortcut for sub {...}

2007-10-12 Thread Andy Armstrong

On 12 Oct 2007, at 15:04, Andy Lester wrote:

What worries me is someone's gonna submit an otherwise useful module
to CPAN that uses this feature.


Oh no, THEN what?  What's the tragedy there?


You're just being meta-negative Andy :)

--
Andy Armstrong, Hexten





Re: lambda - a shortcut for sub {...}

2007-10-12 Thread Ken Williams


On Oct 12, 2007, at 3:44 AM, Johan Vromans wrote:


Personally, I have to reject many potential useful CPAN modules
because they use a plethora of other modules that most of the time are
not even related to the problem at hand.


I find that annoying too.  Usually I just bite the bullet and install  
ten zillion modules though.




For example: I need functionality A. CPAN module Foo implements A, but
also B. For B, it needs 891 other CPAN modules, with their
dependencies. In this case, I try to isolate the A functionality and
copy it to my own code.


Rather than doing that, it would be good to encourage Foo's author to  
split out A as a separate module.  If they're not interested, most  
licenses would permit you to do that yourself.




An associated issue (that has been raised here before) is related to
modules that need a whole bunch of CPAN modules just for building and
testing.


That's why we created the 'build_requires' dependency type, but  
certainly a lot of distributions don't use it yet.  And MakeMaker  
remains unaware of it.


 -Ken



Re: lambda - a shortcut for sub {...}

2007-10-11 Thread Ovid
--- Eric Wilhelm [EMAIL PROTECTED] wrote:

 
   http://search.cpan.org/~ewilhelm/lambda-v0.0.1/lib/lambda.pm

Combined with that vim shortcut, this is just too cool :)

I'd probably have put it in the Acme:: namespace, though.

Cheers,
Ovid

--
Buy the book  - http://www.oreilly.com/catalog/perlhks/
Perl and CGI  - http://users.easystreet.com/ovid/cgi_course/
Personal blog - http://publius-ovidius.livejournal.com/
Tech blog - http://use.perl.org/~Ovid/journal/


Re: lambda - a shortcut for sub {...}

2007-10-11 Thread Eric Wilhelm
# from Ovid
# on Thursday 11 October 2007 00:54:

I'd probably have put it in the Acme:: namespace, though.

Why?  AFAICT, the Acme stuff isn't typically intended for production 
use.

I plan to use it early and often.

--Eric
-- 
Because understanding simplicity is complicated.
--Eric Raymond
---
http://scratchcomputing.com
---


Re: lambda - a shortcut for sub {...}

2007-10-11 Thread Johan Vromans
Eric Wilhelm [EMAIL PROTECTED] writes:

Cute, but doesn't it break programs that already use non-ascii (e.g.,
Latin1)?

 How?

Because it's no different from the utf8 pragma:

  $ cat t.pl
  my $x = ë;
  $ perl -w t.pl
  $ perl -Mutf8 -w t.pl
  Malformed UTF-8 character (unexpected continuation byte 0x81, with no 
preceding start byte) ...
  Malformed UTF-8 character (1 byte, need 3, after start byte 0xeb) ...

(Note that the content of the string in t.pl is a single character
0xeb, which is Latin-1 for e-diaeresis.)

-- Johan


Re: lambda - a shortcut for sub {...}

2007-10-11 Thread Eric Wilhelm
# from Ovid
# on Thursday 11 October 2007 02:08:

but if it shows up in your CPAN modules, you
might get a few complaints since this sugar, 

Oh well ;-)  It's not an API element, just an internal dependency.  It 
works with perl 5.6.2 and 5.8.8.  Would anyone even notice?

If you're editing the file that uses it, you'll need a utf8-aware 
editor.

while a really nifty 
 hack, adds nothing complex but does screw up older editors and will
 confuse the heck out of a lot of maintenance programmers.

The great thing about maintenance programmers is that they come from the 
future (the one where utf8 just works.)

--Eric
-- 
To a database person, every nail looks like a thumb.
--Jamie Zawinski
---
http://scratchcomputing.com
---


Re: lambda - a shortcut for sub {...}

2007-10-11 Thread Eric Wilhelm
# from Johan Vromans
# on Thursday 11 October 2007 09:41:

 doesn't it break programs that already use non-ascii (e.g.,Latin1)?

 How?

Because it's no different from the utf8 pragma:

  $ cat t.pl
  my $x = ë;
  $ perl -w t.pl
  $ perl -Mutf8 -w t.pl
  Malformed UTF-8 character (unexpected continuation byte 0x81, with
 no preceding start byte) ...

OK,  Then it breaks them.  How would it not?  There's always 'no'.

--Eric
-- 
It is a mistake to allow any mechanical object to realize that you are 
in a hurry.
--Ralph's Observation
---
http://scratchcomputing.com
---


Re: lambda - a shortcut for sub {...}

2007-10-11 Thread Eric Wilhelm
# from David Golden
# on Thursday 11 October 2007 11:25:

Uh, what about a vim shortcut that just does sub {.  E.g.:

And why do we have an 'eq' operator instead of 'equals' ?

IMO, shortcuts for typing long things will lead us to Eclipse.

--Eric
-- 
...our schools have been scientifically designed to
prevent overeducation from happening.
--William Troy Harris
---
http://scratchcomputing.com
---


Re: lambda - a shortcut for sub {...}

2007-10-11 Thread David Golden
On 10/11/07, Ovid [EMAIL PROTECTED] wrote:
 Combined with that vim shortcut, this is just too cool :)

Uh, what about a vim shortcut that just does sub {.  E.g.:

imap ,{ sub {Space

Or even:

imap ,{ sub {SpaceSpace}LeftLeft

-- David


Re: lambda - a shortcut for sub {...}

2007-10-11 Thread Ovid
--- Eric Wilhelm [EMAIL PROTECTED] wrote:

 And why do we have an 'eq' operator instead of 'equals' ?
 
 IMO, shortcuts for typing long things will lead us to Eclipse.

  lambda - a shortcut for sub {...}  

  my $code = #955; {...}; # instead of sub {...}

;)

Cheers,
Ovid

--
Buy the book  - http://www.oreilly.com/catalog/perlhks/
Perl and CGI  - http://users.easystreet.com/ovid/cgi_course/
Personal blog - http://publius-ovidius.livejournal.com/
Tech blog - http://use.perl.org/~Ovid/journal/


Re: lambda - a shortcut for sub {...}

2007-10-11 Thread A. Pagaltzis
* Eric Wilhelm [EMAIL PROTECTED] [2007-10-11 01:05]:
   http://search.cpan.org/~ewilhelm/lambda-v0.0.1/lib/lambda.pm

If I saw this in production code under my responsibility, I’d
submit it to DailyWTF. However, I have nothing against its use
in code I’ll never see. Carry on.

This opinion brought to you by Andy Lester’s Perlbuzz rant.

Regards,
-- 
Aristotle Pagaltzis // http://plasmasturm.org/


lambda - a shortcut for sub {...}

2007-10-10 Thread Eric Wilhelm

  http://search.cpan.org/~ewilhelm/lambda-v0.0.1/lib/lambda.pm

-- 
Insert random misquote here
---
http://scratchcomputing.com
---


Re: lambda - a shortcut for sub {...}

2007-10-10 Thread David Golden
On 10/10/07, Eric Wilhelm [EMAIL PROTECTED] wrote:

   http://search.cpan.org/~ewilhelm/lambda-v0.0.1/lib/lambda.pm

For golfing with closures?

David