lens icon indicating copy to clipboard operation
lens copied to clipboard

Add option to hide accessors in struct/lens

Open jackfirth opened this issue 10 years ago • 0 comments

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

jackfirth avatar Dec 02 '15 22:12 jackfirth