Anticipated changes of parameters
Shiro Kawai <[email protected]> Sat, 22 Oct 2022 09:55:54 -1000
| Newsgroups | gmane.lisp.scheme.gauche |
|---|---|
| Message-ID | <CALN0JNH1CNfP7DLgv9ch+efMvhFrGSL02tADZPpdFsLL8POE3g@mail.gmail.com> |
Parameters are Scheme's way to realize dynamic bindings, and have standardized in RnRS. However, RnRS doesn't specify interactions between parameters and threads. Implementations, including Gauche, have extended semantics of parameters in their own way. SRFI-226, currently in draft, attempts to define interactions of parameters, continuations and threads. It defines a clean model and we plan to adopt it. However, there are some incompatibilities between current Gauche's parameters and the srfi's. This mail explains the planned changes, and also solicits user's opinion about the matter---if the change will break your code seriously, we want to find a better way to make transition smooth. We'll have some transition period so that the current code will work for some time. 1. Parameters and thread local storages will be splitted. Srfi-226 parameters are not thread-specific. This is an inevitable consequence: Dynamic environment is captured in a continuation. A continuation can be invoked with a thread different from the one that captured it. If parameters are thread-specific, the continuation won't see the same environment as when it is invoked in the same thread. From the next release, we provide thread locals, an object that realizes thread-specific storage. The interface follows srfi-226. If you're using parameters for thread-specific storage, please consider moving to thread locals. 2. Parameter-like objects won't be supported. Currently, you can use something "that works like a parameter bot not a <parameter>" in the parameterize form. This "something" is a procedure which returns the current value when called without an argument, and update its value when called with one argument (and returns the previous value). This is Gauche's extension. This is a byproduct of the specifc way we implement 'parametize'. Once we move to the srfi-226 model, however, the way the dynamic binding is represented will be changed and it will no longer be the case. If your code uses this kind of "non-parameter parameters", it needs to be changed to use a proper parameters. 3. Hooks will be dropped. Gauche's parameter can have hooks that are called whenever parameter values are changed. I added this feature just because "I could". Personally I never used this feature. Does anybody use this feature and need to be supported in future? _______________________________________________ Gauche-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/gauche-devel