[plt-scheme] generic programming in plt scheme
For the in-builtin data-types you'd have to define the function in the
usual way:
(define (foo x)
[(vector? x) ...]
[(pair? v) ...]
...)
You get extensibility by using structure properties.
In very recent builds I believe Jay McCarthy has implemented a library
to make this easier. It should be in the unstable collection.
N.
On Sun, Apr 25, 2010 at 7:05 AM, Skeptic . <skeptic2000 at hotmail.com> wrote:
>
> Hi,
> What would be the idiomatic way of defining a generic length procedure over,
> let's say lists, vectors, strings and user-defined streams, in PLT Scheme ?
> Thanks.