chicken-users
[Top][All Lists]
Advanced

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

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




reply via email to

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