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

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

by tobyink (Canon)
on Oct 01, 2013 at 18:58 UTC ( [id://1056521]=note: print w/replies, xml ) Need Help??


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

Nice. Re the syntax, you might be interested in Sub::Infix - it would enable syntax along the lines of:

my $iter = [@list1] |X| [@list2];
use Moops; class Cow :rw { has name => (default => 'Ermintrude') }; say Cow->new->name
  • 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:41 UTC
    Sub::Infix is indeed nice, really clever idea ... thanks! :)

    My problem with overloading so far was that I couldn't use wantarray, i.e. an overloaded '+' always has to return a scalar.

    But you don't have this problem, right?

    Anyway ATM I try to find solutions which work w/o overloading to avoid potential side effects.

    List::Gen for instance globally overloads the typeglob operator... 8-|

    > my $iter = [@list1] |X| [@list2];

    yep but the problem here is that the array are evaluated (i.e. listified) before being passed to the operator.

    I'd like to be able to inspect the code block before evaluating it.

    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://1056521]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (3)
As of 2024-04-25 05:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found