Merge pull request #70 from AlexKnauth/parameter
rename applicable lens parameter
This commit is contained in:
commit
5b2fe73821
|
@ -12,15 +12,15 @@
|
|||
(rename-out [lens-struct? lens?]))
|
||||
|
||||
|
||||
(define lens-app-context? (make-parameter #f))
|
||||
(define lenses-applicable? (make-parameter #f))
|
||||
|
||||
(define (use-applicable-lenses!)
|
||||
(lens-app-context? #t))
|
||||
(lenses-applicable? #t))
|
||||
|
||||
(struct lens-struct (get set)
|
||||
#:property prop:procedure
|
||||
(lambda (this target)
|
||||
(if (lens-app-context?)
|
||||
(if (lenses-applicable?)
|
||||
((lens-struct-get this) target)
|
||||
(error "cannot apply a non-applicable lens as a function"))))
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user