[#4766] Wiki — "Glen Stampoultzis" <trinexus@...>

21 messages 2000/09/04
[#4768] RE: Wiki — "NAKAMURA, Hiroshi" <nahi@...> 2000/09/04

Hi, Glen,

[#4783] Re: Wiki — Masatoshi SEKI <m_seki@...> 2000/09/04

[#4785] Re: Wiki — "NAKAMURA, Hiroshi" <nakahiro@...> 2000/09/05

Howdy,

[#4883] Re-binding a block — Dave Thomas <Dave@...>

16 messages 2000/09/12

[#4930] Perl 6 rumblings -- RFC 225 (v1) Data: Superpositions — Conrad Schneiker <schneik@...>

Hi,

11 messages 2000/09/15

[#4936] Ruby Book Eng. translation editor's questions — Jon Babcock <jon@...>

20 messages 2000/09/16

[#5045] Proposal: Add constants to Math — Robert Feldt <feldt@...>

15 messages 2000/09/21

[#5077] Crazy idea? infix method calls — hal9000@...

This is a generalization of the "in" operator idea which I

17 messages 2000/09/22

[#5157] Compile Problem with 1.6.1 — Scott Billings <aerogems@...>

When I try to compile Ruby 1.6.1, I get the following error:

15 messages 2000/09/27

[ruby-talk:5163] Re: Types and ===

From: "Hal E. Fulton" <hal9000@...>
Date: 2000-09-27 23:52:36 UTC
List: ruby-talk #5163
----- Original Message ----- 
From: <schneik@us.ibm.com>
To: ruby-talk ML <ruby-talk@netlab.co.jp>
Sent: Wednesday, September 27, 2000 2:25 PM
Subject: [ruby-talk:5161] Re: Types and ===


> | Because many of the world's common prepositional and similarity
> | relations (if you are going to include them in the "===" realm) just
> | don't work that way in general (special cases notwithstanding); hence
> | my original question
> ...
> | But here is a still more general question: why would you want to
> | preclude "===" from potentially being *any* suitable 2-place predicate
> | method whatsoever?
> 

OK, I see what you are saying...

> In other words....
> 
> AFAIK, the principal use/purpose of "===" is "case equality" for case
> statements. (IMHO this is an unfortunately somewhat over-specialized name
> for a more general concept--I would have preferred something more generic
> or more generalized such as "case matching".) Since there are so many
> sorts of relations that are not symmetric with respect to swapping their
> arguments that people might quite reasonably want to use in case
> statements, then unless I am missing something else here, I don't see how
> precluding the usage of such methods wouldn't eventually become a very
> onerous restriction.
> 

OK... I think I understand that.

However, I'm still puzzled by two things:
1. Why do we say "case other; when receiver" and not
"case receiver; when other"?
2. Why is the argument order for pattern === string opposite
from the order for string =~ pattern?

It almost (I'm not serious here, not entirely) makes me want to propose
two more operators ==> and <== which point to the receiver... then
the === could be used for symmetrical cases.

Hal





In This Thread