3 ms·
I like pyret's dot notation for accessing data associated with variants. from their docs 8<------------ data Animal: | elephant(name, weight)
by zem 4y ago
I like pyret's dot notation for accessing data associated with variants. from their docs
8<------------
data Animal:
| elephant(name, weight)
| tiger(name, stripes)
| horse(name, races-won)
...
end
fun animal-name(a :: Animal):
a.name
end