diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2021-10-22 22:30:43 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2021-10-22 22:30:43 -0700 |
commit | 72a6aaf189b6390bc2bce661155239373f6b906d (patch) | |
tree | 5b0cf2dbf67baea53e8d3b9929d30c52d8a5de28 /stream.c | |
parent | 4fa6abb8e755c73fb4606146b7a14ba693398849 (diff) | |
download | txr-72a6aaf189b6390bc2bce661155239373f6b906d.tar.gz txr-72a6aaf189b6390bc2bce661155239373f6b906d.tar.bz2 txr-72a6aaf189b6390bc2bce661155239373f6b906d.zip |
ffi: deffi, deffi-cb: eliminate generated globals.
The immediate problem is that with-dyn-lib creates a defvarl,
but deffi uses load-time forms to refer to that. In compiled
code, these load-time evaluations will occur before the
defvarl exists. The conceptual problem is that with-dyn-lib
might not be a top-level form. It can be conditionally
executed, as it happens in stdlib/doc-syms.tl, which is now
broken. Let's not use load-time, but straight lexical
environments.
* stdlib/ffi.tl (with-dyn-lib): Translate to a simple let
which binds sys:ffi-lib as a lexical variable.
(sys:with-dyn-lib-check): Use lexical-var-p to test what
sys:ffi-lib is lexically bound as a variable.
(deffi, sys:deffi-cb-expander): Instead of gloval defvarl
variables, bind the needed pieces to lexical variables,
placing the generated defun into that scope.
Diffstat (limited to 'stream.c')
0 files changed, 0 insertions, 0 deletions