From: morioka Date: Fri, 13 Nov 1998 12:43:20 +0000 (+0000) Subject: (defsubst): Moved from poe-18.el. X-Git-Tag: apel-9_11~9 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=4695a2813ed9f49d80e3725824218fb216c0db27;p=elisp%2Fapel.git (defsubst): Moved from poe-18.el. --- diff --git a/poe.el b/poe.el index f31388d..4bf25de 100644 --- a/poe.el +++ b/poe.el @@ -39,23 +39,28 @@ )) ))) -(defmacro defsubst-maybe (name &rest everything-else) +(defmacro defmacro-maybe (name &rest everything-else) (or (and (fboundp name) - (not (get name 'defsubst-maybe))) + (not (get name 'defmacro-maybe))) (` (or (fboundp (quote (, name))) (progn - (defsubst (, name) (,@ everything-else)) - (put (quote (, name)) 'defsubst-maybe t) + (defmacro (, name) (,@ everything-else)) + (put (quote (, name)) 'defmacro-maybe t) )) ))) -(defmacro defmacro-maybe (name &rest everything-else) +(defmacro-maybe defsubst (name arglist &rest body) + "Define an inline function. The syntax is just like that of `defun'." + (cons 'defun (cons name (cons arglist body))) + ) + +(defmacro defsubst-maybe (name &rest everything-else) (or (and (fboundp name) - (not (get name 'defmacro-maybe))) + (not (get name 'defsubst-maybe))) (` (or (fboundp (quote (, name))) (progn - (defmacro (, name) (,@ everything-else)) - (put (quote (, name)) 'defmacro-maybe t) + (defsubst (, name) (,@ everything-else)) + (put (quote (, name)) 'defsubst-maybe t) )) )))