Idiomatic scheme and generic programming, why only on numbers ?

Posted by Skeptic on Stack Overflow See other posts from Stack Overflow or by Skeptic
Published on 2010-04-22T14:32:05Z Indexed on 2010/04/22 14:33 UTC
Read the original article Hit count: 217

Filed under:
|

Hi,

In Scheme, procedures like +, -, *, / works on different types of numbers, but we don't much see any other generic procedures.

For example, length works only on list so that vector-length and string-length are needed.

I guess it comes from the fact that the language doesn't really offer any mechanism for defining generic procedure (except cond of course) like "type classes" in Haskell or a standardized object system.

Is there an idiomatic scheme way to handle generic procedures that I'm not aware of ?

© Stack Overflow or respective owner

Related posts about Scheme

Related posts about generic-programming