Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
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
Replies are listed 'Best First'.
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 perusing the Monastery: (11)
As of 2015-07-29 08:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (262 votes), past polls