chicken-users
[Top][All Lists]
Advanced

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

[Chicken-users] On parameterize and fluid-let


From: Tobia Conforto
Subject: [Chicken-users] On parameterize and fluid-let
Date: Sun, 14 Oct 2007 14:39:55 +0200
User-agent: Mutt/1.5.11+cvs20060126

Hi all,

I'm new to Scheme and to Chicken, and I like what I see so far!

Question: does (parameterize) have any hidden or special meaning that's
not obvious?  Are these two forms equivalent, except maybe for the
introduction of a few symbols?

(parameterize ((param1 value1) ...)
  body ...)

(let ((old-value1 (param1)) ...)  ;save parameters
  (param1 value1) ...             ;change parameters
  (let ((ret (begin body ...)))   ;execute body and save return value
    (param1 old-value1) ...       ;restore parameters
    ret))                         ;return value

Is (parameterize) just a handy macro for the latter form?

As far as I can see, the only difference could arise in multi-threading
(which I haven't studied yet, in Chicken) but parameters are already
supposed to be thread-local, so I'd wager they really are the same.

(fluid-let), on the other hand, operates on non-thread-local variables,
so its effect is very different from these two forms.  Is this correct?


Tobia




reply via email to

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