Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: rough approximation to pattern matching using local

by LanX (Saint)
on Jan 25, 2015 at 20:47 UTC ( [id://1114468]=note: print w/replies, xml ) Need Help??


in reply to rough approximation to pattern matching using local

You should be clearer about the features you want to implement.

Sample code would be nice, a test suite even perfect.

It's not as straight forward as you might think, since Haskell is

  • statically typed,
  • has real function signatures
  • evaluates pattern matching at compile time.
So which features do you want to translate into Perl's world and how exactly?

Please be aware that because of Perl's dynamic nature you are free to write something like

sub multi { my ( $bob ) = @_; if ( $bob == 45 ) { print $bob; return; } elsif (...) { ... return; } else { ... return; } }

anything else is - at best - "only" syntactic sugar.

Cheers Rolf

PS: Je suis Charlie!

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (2)
As of 2024-04-19 20:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found