From: Greg McIntyre Date: 2003-11-22T08:37:14+09:00 Subject: Re: Partial Euphoric Type Checking (Super Duck!?) Austin Ziegler wrote: > Why not consider doing interfaces in Ruby as bundles of DbC > "contracts"[1]? That way, you get *dynamic* interfaces that aren't > necessarily simplistic name-checks, which is what I'm opposed to. I thought of that earlier when I read Sean's proposal however I dismissed it initially because I thought it would be too much effort. However I think it's a distinct possibility! The "Partial Euphoric" type system T. Onoma has put forward seems to be a little like sets of preconditions tagged with identifiers and later applied to method paramters. I see it as a gradient... if you put in no effort, you can have little typechecking, if you put in a little effort, you can have a bit more, etc. DbC is way up the deep end of the scale where you put in substantial effort and receive substantial returns. What's more, I think it should be up to the Ruby developer how much checking is desired. On the effort scale, IMO: No checking << Duck typing == Interface checking based upon method name + arity ("organised duck typing"?) << Interface checking based upon method signature == Type checking in static languages << Interface checking based upon DbC contracts (<< means "much more than") That's just my view of the world, maybe DbC isn't that much effort. It certainly can give wonderful rewards: very powerful and descriptive interfaces. Here's a wild suggestions. What if all these levels could be incorporated in Ruby as separate, optional, non-conflicting libraries? Okay, maybe I should go lie down now. ;) -- Greg McIntyre ======[ greg@puyo.cjb.net ]===[ http://puyo.cjb.net ]===