That's very neat Perry! user=> (let-> [? 5] inc) 6 user=> (let-> [? 5] inc (+ 2 ?)) 8 user=> (let-> [? 5] inc (+ 2 ?) (+ ? 3)) 11 user=> (let-> [? 5] inc (+ 2 ?) (+ ? 3) (+ 4)) 4
What should happen when/if the seq arg doesn't contain the symbol? I believe how you currently handle it is correct and in the spirit of let-> (alternatively it could be reported as an error) however it may raise yet another possibility for pipe: (pipe 5 inc (+ 2) (+ ? 3) (+ 4 ? 2)) ie: if the argument is a seq and doesn't contain ? then it is assumed to be a post argument, but if it does contain ? then can be explicitly a pre or mid argument. This is however subject to the previously discussed issues of nesting and rebinding (are they realistic?) having a mandatory binding for pipe would be a burden so better to forget about it. Certainly pipe and let-> as proposed allow for all cases very nicely. Is it worth considering how (doto) fits into the picture? My initial observation is that (doto) is orthogonal in the sense that its primary use is for java object manipulation, and there is never a use case to have arguments in different places for that. So I suspect doto is irrelevant. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~----------~----~----~----~------~----~------~--~---