Open jackfirth opened 9 years ago
Is that equivalent to (map (lens-set lns tgt _) lst)
?
Yup, exactly. The implementation is very simple but I've found it surprisingly helpful.
I'm not sure how that relates to "fragment" though ... What came to my mind first, which is why I was confused a bit, was a function like this:
(define (lens-fragment-like-I-imagined lens . other-lenses)
(lens-thrush lens (apply lens-join/list other-lenses)))
Or something similar to that idea. Anyway, is fragment the best name?
Fragment was the first name I came up with while working in the middle of the night on a completely unrelated package, so it's very likely it's not a good name.
This is something I implemented in my
ease
package:Basically you can take a lens, a target, and a list of new views to "explode" the target into a list of possible targets, one for each view. This worked really nicely with easings, where given a start point and a stop point and a number of steps it was easy to generate the list of steps. So for instance, given a
player
struct with aposn
field, you could easily get a list of players moving along in the x direction: