Hi,
Suppose I have a bundle of practically identical definitions:
(ff:def-foreign-call isalnum ((ch :char)) :returning :int)
(ff:def-foreign-call isalpha ((ch :char)) :returning :int)
....
and so forth for all functions enumerated in ctype.h.
Is it possible to automate this process ? To write something like
(dolist (f '(isalnum isalpha #|more symbols here...|#))
;; something...
)
[Sure enough, I am not going to use this is* stuff with CL
characters.]
Thanks in advance
--
Vladimir Zolotykh
On Wed, 06 Aug 2003 14:07:26 +0300, Vladimir Zolotykh <······@eurocom.od.ua> wrote:
> Suppose I have a bundle of practically identical definitions:
>
> (ff:def-foreign-call isalnum ((ch :char)) :returning :int)
> (ff:def-foreign-call isalpha ((ch :char)) :returning :int)
> ....
>
> and so forth for all functions enumerated in ctype.h.
>
> Is it possible to automate this process ? To write something like
>
> (dolist (f '(isalnum isalpha #|more symbols here...|#))
> ;; something...
> )
(defmacro foo (&rest names)
`(progn
,@(loop for name in names
collect `(ff:def-foreign-call ,name
((ch :char))
:returning :int))))
(foo isalnum isalpha)
Edi.
Vladimir Zolotykh <······@eurocom.od.ua> writes:
> Suppose I have a bundle of practically identical definitions: [...]
> and so forth for all functions enumerated in ctype.h.
>
> Is it possible to automate this process ?
I had looked into using something called cparse
<http://www.cliki.net/cparse> a while back but had a few problems with
it. However, it might be worth a look for inspiration, etc.