The typical use case for classes in Racket is writing GUIs, and that's 
mostly because the GUI framework is class based.

For most other use cases, generics are a better choice than classes. 
They're simpler and have a less intrusive effect on your API surface. If 
you don't need to support arbitrary user implementations, you can avoid 
generics and classes altogether and use structs whose fields contain 
functions.

On Sunday, November 8, 2020 at 6:12:37 AM UTC-8 unlimitedscolobb wrote:

> Hi,
>
> A general knowledge question: what would be the typical use cases of 
> Racket generics vs. the typical use cases of Racket classes?
>
> Am I correct in assuming that I can do everything with classes what I 
> could do with generics, and that generics have made their way into the 
> language before the classes?
>
> -
> Sergiu
>
> P.S. I'm reading the section on classes in the updated Typed Racket 
> reference, and I'm very happy to see this new functionality!  Very good job 
> the Typed Racket Team!
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/dc76fceb-9829-4356-a2fe-0d340fef9c43n%40googlegroups.com.

Reply via email to