Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re^3: Ruby vs Perl vs LISP; the killer feature lacking in Ruby

by tobyink (Abbot)
on May 23, 2012 at 07:38 UTC ( #971970=note: print w/ replies, xml ) Need Help??


in reply to Re^2: Ruby vs Perl vs LISP; the killer feature lacking in Ruby
in thread Ruby vs Perl vs LISP; the killer feature lacking in Ruby

As well as Jenda's suggestion, it's also possible to declare a little wrapper like this:

sub also (&;@) { return @_; }

Enabling you to do this:

multifoo { $_ * 2 } also { foo($_) } @things;

This is what Moose does for its type constraints system, providing little wrappers like via, where and message so you can write code like:

subtype 'ModernDateTime' => as 'DateTime' => where { $_->year() >= 1980 } => message { 'The date is not modern enough' };
perl -E'sub Monkey::do{say$_,for@_,do{($monkey=[caller(0)]->[3])=~s{::}{ }and$monkey}}"Monkey say"->Monkey::do'


Comment on Re^3: Ruby vs Perl vs LISP; the killer feature lacking in Ruby
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://971970]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (5)
As of 2014-09-24 02:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (244 votes), past polls