On Oct 9, 2:46 pm, Stuart Halloway <[EMAIL PROTECTED]> wrote:
> Sacha,
>
> You can to force evaluation of *indent* while preserving the lazyness
> of the code that uses *indent*:
>
> (with-indent
>    (print *indent*)
>    (let [ind *indent*]
>      (lazy-cons ind (cons ind nil))))
>
> If this idiom is useful often enough there could be a macro for it. Or
> maybe there already is. :-) Rich?
>

There isn't yet, but yes, these do come up:

rebinding a var with an expression that uses its current value
capturing the current value of a var

(rebinding [*foo* (some-expr-that-uses *foo*)]
 ...)

(capture-binding [*foo*]
  (use-of *foo* here is a snapshot))

Rich
--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to