Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

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

by BrowserUk (Patriarch)
on Oct 01, 2013 at 19:39 UTC ( [id://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 (Saint) 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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1056529]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (3)
As of 2024-04-25 17:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found