[prev in list] [next in list] [prev in thread] [next in thread] 

List:       ruby-talk
Subject:    Re: you can't get in trouble with your boss for picking C#
From:       "ToRA" <tristan.allwood () gmail ! com>
Date:       2005-09-18 10:16:41
Message-ID: 1127038380.728846.78270 () z14g2000cwz ! googlegroups ! com
[Download RAW message or body]

Hey again,

Further to that, I probably should explicitly point out that in Ruby
the type model is subtly different than most(?) of the rest of the
other languages being mentioned, since a valid type for something in
ruby is one that can  respond to the appropriate messages/method calls.
This is 'Duck' or structural typing, as opposed to the explicit type
tree that java et al have.

So really, you don't have operator overloading in the classical sense,
an operator is just a message the lhs can respond to when passed a rhs
argument.

Types then become sets of methods, and super/subclass relations become
sub/superset relations on those method sets.

Static type inference then becomes a hefty job of filling in those sets
and checking constraints, which if you google on it, will turn up has
already been done (to varying degrees) for javascript and python.

Tris.


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic