Charles Oliver-Nutter: "The dream, as I see it, would be to use a Ruby-like syntax to wire up any arbitrary types using what looks generally like idiomatic Ruby code. For example, our friend fib(). The same fib() method I showed before, executing against primitive integer values, could execute against boxed Integer objects or BigInteger objects just by specifying the right plugin. So if within the context of a file, I declare that "fixnum" types are to be represented as BigInteger objects, and math operations against them are to call appropriate methods on BigInteger, so be it...that's what comes out the other side."
Now this is interesting - an algorithm that can be generalised by using pluggable type resolution. It reminds me of something Alex Stepanov said in the "Money Oriented Programming" interview: "Every time I would look at an algorithm I would
try to find a structure on which it is defined. So what I wanted to do
was to describe algorithms generically." In that interview Stepanov defined generic programming as "finding the most abstract representations of efficient algorithms."
This type wiring does makes wonder (again) what would happen if Python had optional type declarations for function arguments. Aside from being able to look at a function and know what it accepts, it could give a type checker (and ultimately a JIT) a lot of information. Cobra allows you to say that an argument acts "as" a type. Scala makes you declare types in functions. It's an interesting tradeoff.