"Mark J. Reed" <[EMAIL PROTECTED]> writes:

> On Sun, May 12, 2002 at 12:30:20AM +0200, Pixel wrote:
> > FYI Ruby has:
> > 
> > a.type <= b.type  or  a.type == b.type
> > 
> > [...]
>
> Well, it comes from set notation - and you used the prefixes 'sub' and
> 'super' exactly as they are used in sets. :) 
[...]
> Anyway, if you regard a class as the set of objects which can be
> treated as instances of that class, then use of a Rubylike notation
> (and the terms 'subclass' and 'superclass') follows logically.

i do understand this notation [*], but i don't know if it's
*readable*. many people prefer: a.isa(b.type)

by the way, this notation seems to come from smalltalk.

and <=> on incompatible types now return an exception in Ruby 1.7


[*] i'm trying to develop a programming language (merd) which is very
based on subtyping/supertying.

--
Pixel
http://merd.net
merd = Perl-Python-Ruby-alike expressivity
     + static type checks (a la Haskell)

Reply via email to