rename applicable lens parameter
fixes https://github.com/jackfirth/lens/issues/54
This commit is contained in:
parent
a9b398a55c
commit
5b43546f97
|
@ -12,15 +12,15 @@
|
||||||
(rename-out [lens-struct? lens?]))
|
(rename-out [lens-struct? lens?]))
|
||||||
|
|
||||||
|
|
||||||
(define lens-app-context? (make-parameter #f))
|
(define lenses-applicable? (make-parameter #f))
|
||||||
|
|
||||||
(define (use-applicable-lenses!)
|
(define (use-applicable-lenses!)
|
||||||
(lens-app-context? #t))
|
(lenses-applicable? #t))
|
||||||
|
|
||||||
(struct lens-struct (get set)
|
(struct lens-struct (get set)
|
||||||
#:property prop:procedure
|
#:property prop:procedure
|
||||||
(lambda (this target)
|
(lambda (this target)
|
||||||
(if (lens-app-context?)
|
(if (lenses-applicable?)
|
||||||
((lens-struct-get this) target)
|
((lens-struct-get this) target)
|
||||||
(error "cannot apply a non-applicable lens as a function"))))
|
(error "cannot apply a non-applicable lens as a function"))))
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user