On Fri, Sep 27, 2002 at 11:22:30PM +0900, William Djaja Tjokroaminata wrote:
> Hi,
> 
> I tend to agree with Bulat.  If people think it isn't Ruby anymore, that's
> why we will call it "R".  Because we have enjoyed Ruby very much, R is
> designed more like a "superset" of Ruby, the addition being some hints on
> type checking.  How strong the type checking is can be controlled by a
> parameter, in which case type_check_level == 0 reduces "R" to Ruby.  Sure,
> it will not be as fast and efficient as Ruby, but for experimentation I
> think it is worth it.
> 
[deleted]
> (Sigh), if only I understand lexing and parsing and have more time, I
> probably would have started experimenting with "R".  At least I will have
> this to start
> 
>     def (Numeric a)
>     end
> 
> which is in Ruby equivalent to
> 
>     def (a)
>         raise "type error" unless a.kind_of? Numeric
>     end
>

You have gained no type-safety whatsoever.
This isn't static typing but a better way to see if your code is doing
what you think, as the test is not performed at compile-time.

> Well, Ruby already have concepts of "shortcuts" such as attr_reader and
> attr_accessor.  So at least initially "static type" can simply be
> interpreted as a shortcut as in the above code.

I believe this shortcut can easily be implemented in Ruby as it is right
now... your notation is just more syntactic sugar, IMHO. But then again,
maybe I'm seeing sugar everywhere :-)

-- 
 _           _                             
| |__   __ _| |_ ___ _ __ ___   __ _ _ __  
| '_ \ / _` | __/ __| '_ ` _ \ / _` | '_ \ 
| |_) | (_| | |_\__ \ | | | | | (_| | | | |
|_.__/ \__,_|\__|___/_| |_| |_|\__,_|_| |_|
	Running Debian GNU/Linux Sid (unstable)
batsman dot geo at yahoo dot com
  
Sex dumps core
(Sex is a Simple editor for X11)
	-- Seen on debian bugtracking