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

Re: perl6 custom operator problem

by NetWallah (Canon)
on Mar 28, 2017 at 23:54 UTC ( [id://1186292]=note: print w/replies, xml ) Need Help??


in reply to perl6 custom operator problem

This could help you improve "MetricPrefix":
my %to_num = map { $_[0]=> 10**$_[1] }, (qw|pico nano micro milli centi hecto kilo mega giga tera| Z (-12, {$_+3}... -3,-2,2,3,{$_+3}... 12)) ;
Uses "Lazy lists" and the Zip (Z) operator.

I'm still learning p6, and I agree - there HAS to be a better way to avoid all that boilerplate code, so I'll keep a watch for responses.

        ...it is unhealthy to remain near things that are in the process of blowing up.     man page for WARP, by Larry Wall

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (4)
As of 2024-04-26 08:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found