Abdulaziz Ghuloum scripsit:
> Swapping is needed, rather than restoring the old value, so that when
> you get out of the dynamic context, and then back in, the value of the
> parameter is restored to what it was when you got out, not to what it
> was when you first got in. Maybe a simple example is a better
> explanation.
Thanks, that was very helpful.
(Chicken's built-in "parameterize" behaves identically to your definition,
except that it doesn't like escape procedures called without an argument.
Changing (out-k) to (out-k 0) makes all well.)
BTW, the point of posting the Chicken source was not to show how Chicken
does it, particularly, but rather to show that most of the code is
specific to thread support.
This is in the end the main reason to standardize parameters: so that
implementers who provide threads (almost everybody) can make parameters
and threads interoperate (whether by cloning or by refreshing).
A portable implementation of parameters will inevitably be thread-blind.
--
John Cowan cowan_at_ccil.org http://ccil.org/~cowan
If a traveler were informed that such a man [as Lord John Russell] was
leader of the House of Commons, he may well begin to comprehend how the
Egyptians worshiped an insect. --Benjamin Disraeli
Received on Wed Feb 21 2007 - 09:37:37 UTC