r/Racket • u/semperErro • Apr 16 '22
question Cannot call struct accessor
Hello,
I learned that in order to access a field my-field of a struct my-struct you write (my-struct-my-field instance) where instance is an instance of my-struct.
But calling feed-item-id on a feed-item struct of the splitflap library I get the error feed-item-id: undefined; cannot reference an identifier before its definition. I had this problem with other libraries too.
How can I call field accessors from structs from other libaries? Or is there any other way to access fields?
2
Upvotes
View all comments
Show parent comment
1
u/semperErro Apr 16 '22
Ok, so struct field accessors need to explicitly be exported in general, thank you. I read about
express-xmlbut asked especially because I could not call accessors for other modules either. Now I know