throw_again99·10 anni fa·discussThis is rather nice. You get a lot of convenience for that one type annotation!
throw_again99·10 anni fa·discussHi, thanks. Primarily I wondered about actual mixing of ADTs and objects, which is limited even in OCaml, see e.g.:http://caml.inria.fr/pub/ml-archives/caml-list/2003/06/bed28...But does Pyret always translate an ADT to a class hierarchy behind the scenes? This example sure looks like it does: data Animal: | elephant(name, weight) | tiger(name, stripes) | horse(name, races-won) ... end fun animal-name(a :: Animal): a.name end