chicken-users
[Top][All Lists]
Advanced

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

Re: [Chicken-users] On parameterize and fluid-let


From: Kon Lovett
Subject: Re: [Chicken-users] On parameterize and fluid-let
Date: Sun, 14 Oct 2007 07:26:45 -0700


On Oct 14, 2007, at 5:39 AM, Tobia Conforto wrote:

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?

Yes.


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.

Yes.


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



Yes.

Tobia


_______________________________________________
Chicken-users mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/chicken-users

Best Wishes,
Kon






reply via email to

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