On Mon, 29 Jul 2002, Dan Sugalski wrote: > If I thought anyone'd do control flow with it, I'd have a version of > the op for that, but I don't think we're going to see that, and perl > doesn't do it, so...
Okay, writing this email has convinced me that maybe we don't need these ops. If Perl's going to do things like this: $x = 1; $y = 2; $z = "grape"; if $z < $x < $y lt $z { print "strange, but true" } then it seems like they'll be used for control flow just like anything else. The alternative would be to do this with the Ix versions like so: cmpn I0, Px, Py unless I0, -1, l_false Or with the current set of ops, through temps like so: set N0, Px set N1, Py ge N0, N1, l_false Actually, since with this version we can keep the num/string temporaries around to reuse them in comparison chains and only do the conversion once, the other might not be so great -- strtod is painful. cmp{n,s} save us one instruction per compare (two for the branching versions), so they'd probably be a win on single comparisons, but they're not as useful as I naively thought. How useful do people think these are? /s