Hi,

this is not a chicken-specific question.

Does anyone know of any existence of a lazy-let macro,
which does the following?

<convert from>

(lazy-let ([a (get-a)][b (get-b)])
  (if (condition) a b))

<into>

(if (condition) (get-a) (get-b))

the above example is fairly easy, but how about this;

<from>

(lazy-let ([a (get-a)][b (get-b)])
  (if (condition)
      (begin (display a) a)
      (begin (display b) b)))

<into>

(if (condition)
    (let ([a (get-a)]) (begin (display a) a))
    (let ([b (get-b)]) (begin (display b) b)))

My question is whether this is a known situation and there exists
a macro for it, if no, is it feasible, or could this be
written in a macro in general way?

I hope my explanation does make sense.
Daishi


_______________________________________________
Chicken-users mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/chicken-users

Reply via email to