[gambit-list] Parameter objects performance Q

John Cowan cowan at ccil.org
Sun Mar 8 12:39:37 EDT 2020


On Sun, Mar 8, 2020 at 11:17 AM Adam <adam.mlmb at gmail.com> wrote:

For completeness can you please provide some reference URL to the latter
> two or/and describe very briefly?
>

For fluid variables, see the withdrawn SRFI 15, <
https://srfi.schemers.org/srfi-15/srfi-15.html>.  Dynamic variables are an
equivalent Common Lisp concept.  Fluid and dynamic variables behave like
global variables that have been bound permanently to a parameter, so they
are accessible from everywhere and can be parameterized anywhere.  In
Common Lisp, all top-level variables (but not constants or functions) are
dynamic, and conventionally are written with an asterisk as a prefix and
suffix.  In addition, when a variable in a Common LIsp lambda-list (or
equivalent) is dynamic, it will be parameterized rather than lexically
bound when the procedure is called.

All the examples I have found (except Marc's, thank you Marc) involve using
parameters in exactly this way, which I why I am especially interested in
other use cases.

There is a problem with parameters: if a procedure implicitly depends on a
parameter, and you want to use the procedure in a "localized" way, then
binding the parameter around the whole or a substantial part of a program
is convenient.  But to use such a procedure in a "universal" way
independent of its context, it is necessary to wrap *every* call in a
parameterize expression.



John Cowan          http://vrici.lojban.org/~cowan        cowan at ccil.org
Objective consideration of contemporary phenomena compel the conclusion
that optimum or inadequate performance in the trend of competitive
activities exhibits no tendency to be commensurate with innate capacity,
but that a considerable element of the unpredictable must invariably be
taken into account. --Ecclesiastes 9:11, Orwell/Brown version
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.iro.umontreal.ca/pipermail/gambit-list/attachments/20200308/4ab268da/attachment.htm>


More information about the Gambit-list mailing list