Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: Simulating Perl6 Meta/Hyper operators mit pure Functional Programming

by BrowserUk (Pope)
on Oct 01, 2013 at 19:39 UTC ( #1056529=note: print w/ replies, xml ) Need Help??


in reply to Simulating Perl6 Meta/Hyper operators with pure Functional Programming

Seems like a complicated way of doing something very simple:

#! perl -slw use strict; sub X { return map[ $_ ], @{ $_[0] } unless @_ > 1; map { my $item = $_; map { unshift @$_, $item; $_; } X( @_ ); } @{ shift() } } print @$_ for X [ 'a','b' ], [ 1,2 ], ['x','y' ]; __END__ C:\test>FP-X a1x a1y a2x a2y b1x b1y b2x b2y

With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.


Comment on Re: Simulating Perl6 Meta/Hyper operators mit pure Functional Programming
Download Code
Re^2: Simulating Perl6 Meta/Hyper operators with pure Functional Programming
by LanX (Canon) on Oct 01, 2013 at 22:00 UTC
    > Seems like a complicated way of doing ...

    ... lazy iterators! :)

    Cheers Rolf

    ( addicted to the Perl Programming Language)

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (9)
As of 2014-09-23 10:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

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











    Results (217 votes), past polls