Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re^6: Replaying Santa Claus Golf Apocalypse with Pugs/Perl6

by nothingmuch (Priest)
on Mar 30, 2005 at 16:00 UTC ( #443530=note: print w/ replies, xml ) Need Help??


in reply to Re^5: Replaying Santa Claus Golf Apocalypse with Pugs/Perl6
in thread Replaying Santa Claus Golf Apocalypse with Pugs/Perl6

Shouldn't that be like this?

(=<>)[0..9]».print

-nuffin
zz zZ Z Z #!perl


Comment on Re^6: Replaying Santa Claus Golf Apocalypse with Pugs/Perl6
Download Code
Re^7: Replaying Santa Claus Golf Apocalypse with Pugs/Perl6
by TimToady (Parson) on Mar 30, 2005 at 16:50 UTC
    It might be clearer to write it that way, and it emphasizes that you're printing each element individually, but the other probably works as well, if we assume that most of the builtin types including the aggregate types respond to .print.
Re^7: Replaying Santa Claus Golf Apocalypse with Pugs/Perl6
by rg0now (Chaplain) on Mar 31, 2005 at 22:18 UTC
    I have just found the description of the construct you refer to in S12, and I like it pretty much. For those monks, who, just like me, quickly get tired of the overdose of Perl 6 that comes with a Synopsis, I copy the relevant part here verbatim:

    Parallel dispatch

    Any of the method call forms may be turned into a hyperoperator by treating the method call as a postfix:

    @object».meth(@args) # calls one method on each @object».?meth(@args) # calls method if there is one on each @object».*meth(@args) # calls all methods (0 or more) on each @object».+meth(@args) # calls all methods (1 or more) on each @object».=meth(@args) # calls mutator method on each @object».:meth(@args) # calls private method on each

    Pretty nice, I think. Is there any other programming language that allows anything similar to Perl 6 parallel dispatch?

    rg0now

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (6)
As of 2014-07-31 07:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (245 votes), past polls