summaryrefslogtreecommitdiffstats
path: root/stdlib
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2021-09-06 17:25:26 -0700
committerKaz Kylheku <kaz@kylheku.com>2021-09-06 17:25:26 -0700
commit3ce8ddfae8335ec2e730b1a184d4aad29038e15d (patch)
treed452773a8ed1709144818703d7ecb5279d31a46e /stdlib
parent3d5d525eb525cfad8f643917c31e3d9fedce2874 (diff)
downloadtxr-3ce8ddfae8335ec2e730b1a184d4aad29038e15d.tar.gz
txr-3ce8ddfae8335ec2e730b1a184d4aad29038e15d.tar.bz2
txr-3ce8ddfae8335ec2e730b1a184d4aad29038e15d.zip
ffi: ffi macro uses load-time.
A number of functions take an argument which is a ffi type. Typically, this argument is produced using by a ffi-type-compile call which is produced by the ffi macro. But this ffi-type-compile call is invoked at run time, each time such a function is called. A solution for this is to have the ffi macro hoist the compilation to load time. * stdlib/ffi.tl (ffi): Add load-time wrapping to generated expression. * txr.1: Updated correspondence between (ffi ...) form and equivalent (ffi-type-compile form).
Diffstat (limited to 'stdlib')
-rw-r--r--stdlib/ffi.tl2
1 files changed, 1 insertions, 1 deletions
diff --git a/stdlib/ffi.tl b/stdlib/ffi.tl
index b9a86b7b..7ca45bf1 100644
--- a/stdlib/ffi.tl
+++ b/stdlib/ffi.tl
@@ -160,7 +160,7 @@
(ffi-elemsize (ffi-type-compile type)))
(defmacro ffi (type)
- ^(ffi-type-compile ',type))
+ ^(load-time (ffi-type-compile ',type)))
(define-accessor carray-ref carray-refset)