Closed skx closed 1 year ago
Hacker news had a link to Zuo recently:
That has support for "struct", which seems to do a bunch of things. Given the following code:
(struct person name age)
Generates a bunch of things:
(set! person (fn* (name age))
(set! person-name (fn* (strct) (return strct.name)
(set! person-age (fn* (strct) (return strct.age)
More stuff wasn't immediately obvious, but I guess there are setters to match the getters. I guess the complication for implementation would be the creation of the methods, dynamically.
Hacker news had a link to Zuo recently:
That has support for "struct", which seems to do a bunch of things. Given the following code:
Generates a bunch of things:
(set! person (fn* (name age))
(set! person-name (fn* (strct) (return strct.name)
(set! person-age (fn* (strct) (return strct.age)
More stuff wasn't immediately obvious, but I guess there are setters to match the getters. I guess the complication for implementation would be the creation of the methods, dynamically.