At 7:25 PM +0300 7/12/06, Yuval Kogman wrote:
Over at #perl6 we had a short discussion on =:=, ===, and ~~, mostly raised by
ajs's discussion on Str items and ===.
snip
Coincidentally, I raised almost the same questions there a week
earlier, and had a brief discussion with audreyt about it,
On Wed, 2006-07-12 at 17:52 -0700, Larry Wall wrote:
On Wed, Jul 12, 2006 at 12:51:57PM -0400, Aaron Sherman wrote:
: I would assume that all classes automatically define:
:
: multi submethod *infix:as ($self: $?CLASS) { $self }
Hmm, as is really only intended for explicit type mutation
On Thu, Jul 13, 2006 at 00:55:30 -0700, Darren Duncan wrote:
So, in the general case, it would seem best if the binary operator === was
just an ordinary method that each class provides, rather than requiring
classes to defined a .id. Or
in addition to this to help with performance, a .id
Audrey has asked me to split S29 AKA Perl6/Spec/Functions.pod up due to
its rapidly expanding size. The strategy that she suggested is basically
what I'm leaning toward, but I wanted to get feedback (esp. from Larry
and other Synopsians).
I want to be clear, I'm not asking for help coming up with
So, Larry assisted by Audrey explained the purpose of === vs eqv vs
=:=.
It makes sense now, but I still feel that as far as ergonomics go
this is not perfect. Then again, I trust that Larry's opinion is
probably better and at the very least more likely to be accepted
than mine ;-) [1]
So, this
I'm told that I did a terrible job of making my point in the === thread,
and nothingmuch asked me on IRC to re-state my concerns. I'll do so
briefly, and then give examples. Please do have a look at the examples,
just in case I'm not clear.
Overview:
~~ is great. It matches on all kinds of
On Thu, Jul 13, 2006 at 09:32:08PM +0300, Yuval Kogman wrote:
: [1] My preferred ergonomics:
:
: 1. eqv goes away
: 2. what was eqv is renamed to ===
: 3. === becomes =:=, which has a constant feel to it
: 4. =:= is rarely useful IMHO, so you can just type
:
On Thu, Jul 13, 2006 at 12:50:19PM -0700, Larry Wall wrote:
: Then $a eqv $b and $a leg $b both just default to a signature that selects
: everything.
Though arguably P5's string-forcing semantics should be Cleg and the
polymorphic semantics should probably be Ccmp.
Larry
On Thu, Jul 13, 2006 at 15:44:33 -0400, Aaron Sherman wrote:
Now, let's look at some of the good that ~~ does for us:
$a ~~ Some string # sameness
$a ~~ 5 # sameness
$a ~~ -{...} # test
$a ~~ /.../ # regex matching
That's great, and
At 5:36 PM +0300 7/13/06, Yuval Kogman wrote:
User defined types can choose on their own whether to override
=== and/or .id or not, and they would use their own knowledge of
their internal structures to do an appropriate
deep comparison. There is no need to try to generate some kind of
On 7/13/06, Yuval Kogman wrote:
So, Larry assisted by Audrey explained the purpose of === vs eqv vs =:=.
It makes sense now, but I still feel that as far as ergonomics go
this is not perfect.
I think I understand it... (my only quibble with the syntax is that
=== and eqv look like spin-offs
David Green wrote:
I think I understand it... (my only quibble with the syntax is that
=== and eqv look like spin-offs of == and eq, but I don't know what
to suggest instead (we're running short of combinations of = and : !))
Agreed.
So there are three basic kinds of comparison: whether the
On Thu, Jul 13, 2006 at 12:50:19 -0700, Larry Wall wrote:
On Thu, Jul 13, 2006 at 09:32:08PM +0300, Yuval Kogman wrote:
: [1] My preferred ergonomics:
:
: 1. eqv goes away
: 2. what was eqv is renamed to ===
: 3. === becomes =:=, which has a constant feel to it
: 4. =:= is
On Thu, Jul 13, 2006 at 21:55:15 -0700, Jonathan Lang wrote:
Apparently, there are _four_ basic kinds of comparison: the ones
mentioned above, and == (I believe that eq works enough like == that
whatever can be said about one in relation to ===, =:=, or eqv can be
said about the other). I'd
Yuval Kogman wrote:
Jonathan Lang wrote:
Apparently, there are _four_ basic kinds of comparison: the ones
mentioned above, and == (I believe that eq works enough like == that
whatever can be said about one in relation to ===, =:=, or eqv can be
said about the other). I'd be quite interested
At 10:36 PM -0700 7/13/06, Jonathan Lang wrote:
So the purpose of === is to provide a means of comparison that doesn't
implicitly coerce its arguments to a particular type?
Yes, absolutely. The === takes 2 arguments exactly as they are,
without changing anything, and says if they are two
16 matches
Mail list logo