[racket] Type-class-like idiom in Racket?

From: Jens Axel Søgaard (jensaxel at soegaard.net)
Date: Mon Mar 5 08:01:03 EST 2012

2012/3/5 Helmut Rohrbacher <helmut.rohrbacher at gmail.com>

> Danny & Matthias,
>
> I hadn't known about structure properties. I think lumping enough
> syntactic sugar onto your syntax definitions, Matthais, might make it
> feasible to reproduce something to provide the functionality I'm looking
> for.
>
> The only thing is, how do you extend these properties to built-in types
> like LIST and VECTOR? I'm guessing that you'd need to wrap them in a
> user-defined type...
>

Or use structure properties to turn them into sequences (and then use for
and friends).

http://docs.racket-lang.org/reference/sequences.html?q=sequence%20property#(def._((lib._racket/private/base..rkt)._prop~3asequence))


-- 
Jens Axel Søgaard
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20120305/193d9171/attachment.html>

Posted on the users mailing list.