lens
lens copied to clipboard
Add option to hide accessors in struct/lens
The lenses are all that's needed to actually use the struct. If a user was making a bidirectional programming language (like Boomerang), they'd want to only use the lenses. This could be achieved with keywords for hiding individual field accessors and all accessors:
(struct/lens foo ([x #:hide-accessor] y))
;; foo-x isn't bound, but foo-x-lens, foo-y-lens, and foo-y are
(struct/lens foo (x y) #:hide-all-accessors)
;; neither foo-x nor foo-y are bound