From: dblack@... Date: 2005-12-11T02:04:02+09:00 Subject: Re: lib for optional static typing Hi -- On Sun, 11 Dec 2005, Daniel Berger wrote: > Evan Webb mentioned that it would be possible to add a pseudo type > system via Behaviors. He may even have a working implementation for > Sydney, but I'll have to double check. It would look something like > this: > > # pseudocode > require "behavior/strongtyping" > > def foo(String x, y) > end > > In this example, x must be a String, while y can be anything. In > effect, optional typing. s/typing/ancestry-checking/ > I'm actually not sure if I want this, though. I know I've supported it > in the past, but I worry that Java/C/C++ programmers coming to Ruby, > fearing the removal of the static typing training wheels, might adhere > to this style too readily when it should only be used sparingly. I think there are two main problems with this kind of thing: first, that it could short-circuit people learning about how type actually works in Ruby; and second, that it might discourage more Ruby-esque program design. It looks like it adds something to Ruby, but it doesn't (since is_a? is already available), and in practice perhaps subtracts something. David -- David A. Black dblack@wobblini.net "Ruby for Rails", forthcoming from Manning Publications, April 2006!