Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?

Re^3: Thoughts on some new operators for perl (6 or 7)

by TimToady (Parson)
on Mar 22, 2008 at 23:20 UTC ( #675694=note: print w/replies, xml ) Need Help??

in reply to Re^2: Thoughts on some new operators for perl (6 or 7)
in thread Thoughts on some new operators for perl (6 or 7)

Yes, though we didn't have reduce operators back then, nor did we have infix min and max that would allow you to say
for @list { $min min= $_; $max max= $_; }
But [minmax] @list might be what the OP really wants.

And to answer tye's question, min and max are multiply dispatched, so it depends on the types of each pair of arguments. Non-comparable values probably produce an error, but any ordered type will work if used consistently.

(And my grandparent response was probably bogus, since junctions are really only for doing boolean logic, not pulling out actual values. But given that I was very sick four years ago, I'm not surprised...)

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://675694]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (3)
As of 2018-02-23 01:23 GMT
Find Nodes?
    Voting Booth?
    When it is dark outside I am happiest to see ...

    Results (300 votes). Check out past polls.