doc: document ext:with-backend

There's no perfect place to put this, I think it belongs next to
the documentation for the closely related ffi:defla.
This commit is contained in:
Marius Gerbershagen 2020-01-27 21:18:08 +01:00
parent 10c4f6e6d6
commit 56a75fec47
2 changed files with 26 additions and 5 deletions

View file

@ -290,6 +290,31 @@ The interpreter ignores this form.
@c determine that the actual arguments are of the specified type.
@c <XXX
@lspindex ext:with-backend
@defspec ext:with-backend &key bytecodes c/c++
Use different code depending on the backend.
@subsubheading Description
Depending on whether the bytecodes or C compiler is used, this form will
emit the code given in the corresponding keyword argument.
@subsubheading Examples
@exindex @code{ext:with-backend} use different code for c and bytecodes compiler
@verbatim
CL-USER> (defmacro test ()
'(ext:with-backend :c/c++ "c/c++" :bytecodes "bytecodes"))
TEST
CL-USER> (test)
"bytecodes"
CL-USER> (funcall (compile nil (lambda () (test))))
;;; OPTIMIZE levels: Safety=2, Space=0, Speed=3, Debug=3
"c/c++"
@end verbatim
@end defspec
@lspindex ffi:defla
@defmac ffi:defla name args &body body

View file

@ -59,7 +59,7 @@ Many nodes, moderate amount of content (deviations from the standard)
- [ ] Series
- [ ] Tree walker
- [X] Local package nicknames
- [ ] CDR Extensions
- [X] CDR Extensions
* Not documented yet
#+BEGIN_SRC lisp
@ -67,10 +67,6 @@ Many nodes, moderate amount of content (deviations from the standard)
foo
bar)
(ext:with-backend
:bytecodes fib
:c/c++ fact)
(ffi:definline …)
#+END_SRC