SDS <··········@cctrading.com> writes:
> Emacs Lisp has a convenient shortcut for
>
> (proclaim '(inline my-funct))
> (defun my-funct (foo)
> "Foo"
> (do-stuff))
>
> namely
>
> (defsubst my-funct (foo)
> "Foo"
> (do-stuff))
>
> Is it possible to write a CL macro defsubst that would expand to the
> above (provided that, first, I am not completely confused about the
> issue, and, second, that there is no more elegant way for that
> already)? I tried various combinations of `,@ that worked for other
> little tricks, but to no avail...
What have you tried? My guess is that the problem is that you want the
macro to expand to a sequence of two expressions, which is quite
impossible. But you could wrap them up in a progn, like in
(defmacro my-defsubst (name &rest stuff)
`(progn (proclaim '(inline ,name))
(defun ,name ,@stuff)))
If this is good style, I don't know. Good luck,
/Niels