Re: generic ordinal-relevant operators

2006-11-17 Thread Larry Wall
On Fri, Nov 17, 2006 at 04:57:59PM +0100, TSa wrote: : But I don't understand exactly how the coercive semantics : of the numeric and string comparisons are achieved. I assume there : are protos defined with signature :(Any,Any) that coerce the args : to numeric or string and re-dispatch. Right? I

Re: generic ordinal-relevant operators

2006-11-17 Thread TSa
HaloO, Smylers wrote: TSa writes: ... one question remains that might actually make Duncan's proposal pointless. Didn't Larry actually accept Darren's proposal and add the C and C operators? He did. But I don't understand exactly how the coercive semantics of the numeric and string compar

Re: generic ordinal-relevant operators

2006-11-16 Thread Paul Seamons
> Yes. He also accepted the proposal to add min and max operators - > although I'm unsure why they weren't included as functions/methods > instead. It seems more natural to me to say 'max($a, $b, $c)' or > '($a, $b, $c).max' instead of '[max] $a, $b, $c' or '$a max $b max > $c'. Although it _doe

Re: generic ordinal-relevant operators

2006-11-16 Thread Jonathan Lang
Smylers wrote: Didn't Larry actually accept Darren's proposal and add the C and C operators? Yes. He also accepted the proposal to add min and max operators - although I'm unsure why they weren't included as functions/methods instead. It seems more natural to me to say 'max($a, $b, $c)' or '(

Re: generic ordinal-relevant operators

2006-11-16 Thread Smylers
TSa writes: > ... one question remains that might actually make Duncan's proposal > pointless. Didn't Larry actually accept Darren's proposal and add the C and C operators? > Are the comparison operators available for overloading just like any > other operator Yes. This feature is used often e

Re: generic ordinal-relevant operators

2006-11-16 Thread TSa
HaloO Larry, you wrote: You guys should read The Search for the Perfect Language, by Umberto Eco. It would disabuse you of the notion that perfect orthogonality is possible or even desirable. I'm sorry if my contributions to this thread are annoying. But one question remains that might actuall

Re: generic ordinal-relevant operators

2006-11-15 Thread Larry Wall
You guys should read The Search for the Perfect Language, by Umberto Eco. It would disabuse you of the notion that perfect orthogonality is possible or even desirable. Larry

Re: generic ordinal-relevant operators

2006-11-15 Thread TSa
HaloO, Jonathan Lang wrote: I agree that the distinctions between the five different equality tests (=:=, ===, eqv, ==, eq) are rather difficult to grasp (I'm still having trouble getting the difference between '===' and 'eqv', and would appreciate some help). So let's try to join our half kno

Re: generic ordinal-relevant operators

2006-11-14 Thread TSa
HaloO, Smylers wrote: BTW, could we define that the arithmetic shift ops do just that, whereas the string ones do logical shift? And in addition that for the bit inversion +^$a == -1 - $a holds? Note that -1 == +^0. Does that assume a two's complement system? Is that a safe assumption to mak

Re: generic ordinal-relevant operators

2006-11-13 Thread Jonathan Lang
Smylers wrote: Bzzzt, wrong language! But Perl isn't an orthogonal language, it's a "diagonal" language. http://www.oreilly.com/catalog/pperl2/excerpt/ch01.html In the section quoted, it was indicated that "orthogonal" and "diagonal" are being used to mean "minimalist" and "loaded with spec

Re: generic ordinal-relevant operators

2006-11-13 Thread Smylers
TSa writes: > Darren Duncan wrote: > > > For the record, my preference is to have the generics be the > > shortest, [==,!==,<=>,<,>,<=,>=], and use [+,~] prefixes for Num or > > Str casting versions. And lengthen the bit-shift operators to use > > thin-tailed arrowheads as you suggested. > > I l

Re: generic ordinal-relevant operators

2006-11-13 Thread TSa
HaloO, Darren Duncan wrote: For the record, my preference is to have the generics be the shortest, [==,!==,<=>,<,>,<=,>=], and use [+,~] prefixes for Num or Str casting versions. And lengthen the bit-shift operators to use thin-tailed arrowheads as you suggested. I like this proposal for its

Re: generic ordinal-relevant operators

2006-11-11 Thread Darren Duncan
At 10:30 PM -0800 11/11/06, Jonathan Lang wrote: Note that this is two competing suggestions: one where '==' means 'generic equivalence', '+==' means 'numeric equivalence', and '*==' means 'string equivalence'; and another where '*==' means 'generic equivalence', '==' means 'numeric equivalence',

Re: generic ordinal-relevant operators

2006-11-11 Thread Jonathan Lang
Darren Duncan wrote: Jonathan Lang wrote: >In terms of ordinal types, '>', '<', '>=', and '<=' would be the >"generic" ordinal comparators, and you'd do the same sort of implicit >or explicit type coercion that's done with '=='. Mind you, if you go >with the ('==', '+==', '~==') set of equivalen

Re: generic ordinal-relevant operators

2006-11-11 Thread Darren Duncan
At 5:24 PM -0800 11/11/06, Jonathan Lang wrote: Remind me again why it's a good idea to have distinct eqv, ==, and eq operators, and for == to represent the numeric equivalence test instead of an argument-based equivalence test? Personally, I'd rather replace ('eqv', '==', 'eq') with either ('==

Re: generic ordinal-relevant operators

2006-11-11 Thread Jonathan Lang
Darren Duncan wrote: Considering this context of comparison operators: Generic Num Str --- =:= # equality (container) !=:= # negated equality (container) === # equality (value, eternal semantics)

generic ordinal-relevant operators

2006-11-11 Thread Darren Duncan
# negated smart match It stands out that there seems to be no generic ordinal-relevant operators specifically for less-than, greater-than, etc, while there are such that cast their arguments as Num or Str. While one can still emulate such operators on generic types using cmp (whose exist