Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (defn with-propagation0
- [sign opts field includer]
- (if-let [outer (sign opts)]
- (if-let [inner (outer (keyword field))]
- (let [down (assoc opts sign inner)]
- (includer down)))))
- (defn with-propagation1
- "if (-> nest0 selector-1 (keyword selector-2)),
- calls action on nest0 with the key selector1 bound to the binding of selector2
- within the previous value of selector1"
- [selector-1 nest-0 selector-2 action]
- (when-let [nest-1 (selector-1 nest-0)]
- (when-let [nest-2 (nest-1 (keyword selector-2))]
- (let [down (assoc nest-0 selector-1 nest-2)]
- (action down)))))
- (defn with-propagation2
- [selector-1 nest selector-2 action]
- (when-let [nest-1 (-> nest selector-1 ((keyword selector-2)))]
- (let [nest (assoc nest selector-1 nest-1)]
- (action nest))))
Add Comment
Please, Sign In to add comment