[#83328] tcltklib and not init'ing tk — aakhter@... (Aamer Akhter)

Hello,

13 messages 2003/10/01

[#83391] mixing in class methods — "Mark J. Reed" <markjreed@...>

Okay, probably a dumb question, but: is there any way to define

22 messages 2003/10/01
[#83392] Re: mixing in class methods — Ryan Pavlik <rpav@...> 2003/10/01

On Thu, 2 Oct 2003 06:02:32 +0900

[#83397] Re: mixing in class methods — Gavin Sinclair <gsinclair@...> 2003/10/01

On Thursday, October 2, 2003, 7:08:00 AM, Ryan wrote:

[#83399] Re: mixing in class methods — "Mark J. Reed" <markjreed@...> 2003/10/02

On Thu, Oct 02, 2003 at 07:37:25AM +0900, Gavin Sinclair wrote:

[#83404] Re: mixing in class methods — "Gavin Sinclair" <gsinclair@...> 2003/10/02

> On Thu, Oct 02, 2003 at 07:37:25AM +0900, Gavin Sinclair wrote:

[#83416] C or C++? — "Joe Cheng" <code@...>

I'd like to start writing Ruby extensions. Does it make a difference

32 messages 2003/10/02
[#83435] Re: C or C++? — "Aleksei Guzev" <aleksei.guzev@...> 2003/10/02

[#83448] xml in Ruby — paul vudmaska <paul_vudmaska@...> 2003/10/02

The biggest problem i have with Ruby is the sleepness

[#83455] Re: xml in Ruby — Chad Fowler <chad@...> 2003/10/02

On Thu, 2 Oct 2003, paul vudmaska wrote:

[#83464] Re: xml in Ruby or no xml it's just a question — paul vudmaska <paul_vudmaska@...> 2003/10/02

>>--------

[#83470] Re: xml in Ruby — paul vudmaska <paul_vudmaska@...>

>>>

15 messages 2003/10/02

[#83551] xml + ruby — paul vudmaska <paul_vudmaska@...>

>>---------

20 messages 2003/10/03
[#83562] Re: xml + ruby — Austin Ziegler <austin@...> 2003/10/03

On Fri, 3 Oct 2003 16:11:46 +0900, paul vudmaska wrote:

[#83554] hash of hashes — Paul Argentoff <argentoff@...>

Hi all.

18 messages 2003/10/03

[#83675] fox-tool - interactive gui builder for fxruby — henon <user@...>

hi fellows,

15 messages 2003/10/05

[#83730] Re: Enumerable#inject is surprising me... — "Weirich, James" <James.Weirich@...>

> Does it surprise you?

17 messages 2003/10/06
[#83732] Re: Enumerable#inject is surprising me... — nobu.nokada@... 2003/10/07

Hi,

[#83801] Extension Language for a Text Editor — Nikolai Weibull <ruby-talk@...>

OK. So I'm going to write a text editor for my masters' thesis. The

35 messages 2003/10/08
[#83803] Re: Extension Language for a Text Editor — Ryan Pavlik <rpav@...> 2003/10/08

On Thu, 9 Oct 2003 05:06:32 +0900

[#83806] Re: Extension Language for a Text Editor — Nikolai Weibull <ruby-talk@...> 2003/10/08

* Ryan Pavlik <rpav@mephle.com> [Oct, 08 2003 22:30]:

[#83812] Re: Extension Language for a Text Editor — Ryan Pavlik <rpav@...> 2003/10/08

On Thu, 9 Oct 2003 06:09:29 +0900

[#83955] Re: Extension Language for a Text Editor — Nikolai Weibull <ruby-talk@...> 2003/10/09

* Ryan Pavlik <rpav@mephle.com> [Oct, 09 2003 09:10]:

[#84169] General Ruby Programming questions — Simon Kitching <simon@...>

21 messages 2003/10/15
[#84170] Re: General Ruby Programming questions — Florian Gross <flgr@...> 2003/10/15

Simon Kitching wrote:

[#84172] Re: General Ruby Programming questions — Simon Kitching <simon@...> 2003/10/15

Hi Florian..

[#84331] Re: Email Harvesting — Greg Vaughn <gvaughn@...>

Ryan Dlugosz said:

17 messages 2003/10/21
[#84335] Re: Email Harvesting — Hugh Sasse Staff Elec Eng <hgs@...> 2003/10/21

On Wed, 22 Oct 2003, Greg Vaughn wrote:

[#84343] Re: Email Harvesting — Ruben Vandeginste <Ruben.Vandeginste@...> 2003/10/22

On Wed, 22 Oct 2003 08:35:32 +0900, Hugh Sasse Staff Elec Eng

[#84341] Ruby-oriented Linux distro? — Hal Fulton <hal9000@...>

There's been some talk of something like this in the past.

15 messages 2003/10/22
[#84348] Re: Ruby-oriented Linux distro? — Gavin Sinclair <gsinclair@...> 2003/10/22

On Wednesday, October 22, 2003, 6:01:16 PM, Hal wrote:

[#84351] Re: Ruby-oriented Linux distro? — Andrew Walrond <andrew@...> 2003/10/22

On Wednesday 22 Oct 2003 11:02 am, Gavin Sinclair wrote:

[#84420] Struggling with variable arguments to block — "Gavin Sinclair" <gsinclair@...>

Hi -talk,

18 messages 2003/10/24
[#84428] Re: Struggling with variable arguments to block — matz@... (Yukihiro Matsumoto) 2003/10/24

Hi,

[#84604] ruby-dev summary 21637-21729 — Takaaki Tateishi <ttate@...>

Hello,

21 messages 2003/10/30
[#84787] Re: ruby-dev summary 21637-21729 — Paul Brannan <pbrannan@...> 2003/11/06

On Fri, Oct 31, 2003 at 07:01:28AM +0900, Takaaki Tateishi wrote:

[#84789] Re: ruby-dev summary 21637-21729 — matz@... (Yukihiro Matsumoto) 2003/11/06

Hi,

[#84792] Re: ruby-dev summary 21637-21729 — Paul Brannan <pbrannan@...> 2003/11/06

On Thu, Nov 06, 2003 at 11:17:59PM +0900, Yukihiro Matsumoto wrote:

[#84794] Re: ruby-dev summary 21637-21729 — matz@... (Yukihiro Matsumoto) 2003/11/06

Hi,

Re: Making == symmetric?

From: elbows@... (Nathan Weston)
Date: 2003-10-01 16:21:31 UTC
List: ruby-talk #83353
Mark Wilson <mwilson13@cox.net> wrote in message news:<3AA52722-F3B5-11D7-951C-000393876156@cox.net>...
> Those more knowledgeable than me should correct what I've written below 
> if it's wrong.
> 
> On Tuesday, September 30, 2003, at 07:19 PM, Nathan Weston wrote:
> 
> > It has always bothered me that == is not symmetric in ruby:
> > a == b is shorthand for a.==(b), while b == a is shorthand for
> > b.==(a), and a and b might not agree on whether they are equal.
> 
> I think it is symmetric so long as you bear in mind that the method 
> belongs to the object and not to the variable that refers to the 
> object. See below.

If == is symmetric, then (a == b) if and only if (b == a). In ruby,
this is not always the case, which can be very confusing.
I'm not sure what this has to do with the method belonging to the
object rather than the variable.

> 
> > [snip]
>  

[snip]

> 
> I think you're mixing up variables and values. d refers to a D object 
> instantiated with a Foo object. f refers to the Foo object used to 
> instantiate the D object. The D object has an == method that checks its 
> value and compares it to the given value. When invoked by d==f, the D 
> object sees that its value is the Foo object and sees that f refers to 
> the Foo object and determines that they are the same object. In other 
> words the D object is the functional equivalent of an assignment to a 
> primitive variable.

[snip]

I understand how and why things work the way they do in ruby -- I just
happen to think that way is wrong.

The issue in the above example is not whether f and d are equal (in
the code I am working on now, it would be convenient if they were, but
that's beside the point). The issue is that f and d (or rather, the
objects they refer to), don't agree on whether they are equal. I think
that is a bad thing.

Essentially what I am looking for is a way for an object, when asked
if it is equal to some other object, to answer "I don't know".

> 
> 
> > I ran into a similar problem trying to implement perl6-style
> > junctions: you end up with any(1,2,3) == 1 being true, but 1 ==
> > any(1,2,3) being false.
> 
> I didn't follow the above point. There was an earlier discussion on the 
> list about perl6-style junctions that might be helpful.
> 

Admittedly I didn't elaborate on that point too much. I went back and
read the earlier discussion (which I actually started), and here is
the exact problem:

Suppose we have a method any(*args), which creates a junction object
of its arguments.

Then any("1", "2", "3") == "1"  evaluates to true (which is correct).
However, "1" == any("1", "2", "3") evaluates to false (which is not
correct).

The problem is that String doesn't know about the Junction class, and
therefore assumes it is not equal to any instances of it. (Maybe it
looks for a to_str method first, or somesuch -- I don't know the
implementation details exactly). There is no way around this, no
matter how you implement Junction, because in the second case the
comparison is don exclusively by String -- none of Junction's methods
are ever called.

Under my solution, a comparison between a "1" and any("1", "2", "3"),
would first ask "1" if it knows how to compare itself to the junction.
The answer would be "no", since the string class doesn't know anything
about junctions. However, the junction does know how to compare itself
to a string, so the junction's comparison method would be called
(regardless of which side of the == the junction is on).

Nathan

In This Thread