From 4695a2813ed9f49d80e3725824218fb216c0db27 Mon Sep 17 00:00:00 2001 From: morioka Date: Fri, 13 Nov 1998 12:43:20 +0000 Subject: [PATCH] (defsubst): Moved from poe-18.el. --- poe.el | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) 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) )) ))) -- 1.7.10.4