In this case, Alexis designed data/collection to work well with some of the
pre-existing Racket generic interfaces.

For example, since ddicts implement the gen:dict interface, you can use
them with data/collection already:

```
#lang racket

(require data/collection
         data/ddict)

(define dd (ddict 1 2 3 4 5 6))


(extend dd '((7 . 8) (9 . 10)))

#|
produces:
#<ddict: '((9 . 10)
           (7 . 8)
           (5 . 6)
           (3 . 4)
           (1 . 2))>
|#
```


On Tue, Jan 31, 2017 at 4:49 PM, Ronie Uliana <ronie.uli...@gmail.com>
wrote:

> Let's assume I have a struct that is not mine (like ddict [
> https://pkgn.racket-lang.org/package/ddict], or some of pfds [
> https://pkgn.racket-lang.org/package/pfds]). I'd like to implement
> generics for them that also are not mine :p (like data/collection from
> Alexis King).
>
> 1 - Is it possible?
> 2 - How do I do that?
>
> I searched through generics documentation, but I think I completely missed
> that part =/
>
> []s an thx!
> Ronie
>
> --
> You received this message because you are subscribed to the Google Groups
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to racket-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to