
jjsimpso
2020-12-13 18:32:25
When defining a struct in a module, is there a convenient way to provide the struct’s accessor functions? It seems that I have to specify each field’s functions.

soegaard2
2020-12-13 18:33:04
This ought to work: (provide (struct-out name))

soegaard2
2020-12-13 18:33:12
where name is the name of the struct.

jjsimpso
2020-12-13 18:33:22
Thanks! struct-out is what I was missing>

soegaard2
2020-12-13 18:34:04
It provides both accessors, setters, predicate and information s.t. it can be used as a match pattern.

jjsimpso
2020-12-13 18:38:14
Thanks very much. I knew there had to be a simple way to do that. I see it now in the reference.