[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Chicken-users] possible lazy-let macro?

From: Daishi Kato
Subject: [Chicken-users] possible lazy-let macro?
Date: Wed, 16 Nov 2005 18:18:00 +0900
User-agent: Wanderlust/2.15.1 (Almost Unreal) Emacs/21.4 Mule/5.0 (SAKAKI)


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))


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

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


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


(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.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]