Joerg Hoehle <firstname.lastname@example.org.UCE.spam.no.com> wrote:
| Now, there's a repeating backquote pattern which goes like this:
| (defun foo (seq)
| (with-foreign-object (buf `(c-array uint8 ,(length seq)) seq)
| I wish to optimize this case as well. This (c-array X ,Y) pattern is
| supposed to occur often in FFI interaction. I don't want to take
| advantage of the fact that it's CLISP's FFI and write unportable code
| for CLISP's backquote mechanism only.
That one looks simple. The 2nd arg of the macro is evaluated, right?
[Otherwise backquote wouldn't work in the first place.] So just
(defun foo (seq)
(with-foreign-object (buf (list 'c-array 'uint8 (length seq)) seq)
Now it's portable.
Rob Warnock, PP-ASEL-IA <email@example.com>
627 26th Avenue <URL:http://rpw3.org/>
San Mateo, CA 94403 (650)572-2607