From 4e987026148fe65c323afbc93cd560c07bf06b3f Mon Sep 17 00:00:00 2001 From: Yale AI Dept Date: Wed, 14 Jul 1993 13:08:00 -0500 Subject: Import to github. --- cl-support/cl-support.lisp | 86 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 cl-support/cl-support.lisp (limited to 'cl-support/cl-support.lisp') diff --git a/cl-support/cl-support.lisp b/cl-support/cl-support.lisp new file mode 100644 index 0000000..4f82ce2 --- /dev/null +++ b/cl-support/cl-support.lisp @@ -0,0 +1,86 @@ +;;; cl-support.lisp -- compile-time support for building mumble +;;; +;;; author : Sandra Loosemore +;;; date : 10 Oct 1991 +;;; +;;; This file must be loaded before compiling the cl-definitions file. +;;; However, it is not needed when loading the compiled file. + +(in-package "MUMBLE-IMPLEMENTATION") + + +;;; Use this macro for defining an exported mumble function. + +(defmacro define-mumble-function (name &rest stuff) + `(progn + (eval-when (eval compile load) (export (list ',name) "MUMBLE")) + (defun ,name ,@stuff))) + + +;;; This is similar, but also does some stuff to try to inline the +;;; function definition. + +(defmacro define-mumble-function-inline (name &rest stuff) + `(progn + (eval-when (eval compile load) (export (list ',name) "MUMBLE")) +#+lcl + (lcl:defsubst ,name ,@stuff) +#-lcl + (progn + (proclaim '(inline ,name)) + (defun ,name ,@stuff)) + ',name)) + + +;;; Use this macro for defining an exported mumble macro. + +(defmacro define-mumble-macro (name &rest stuff) + `(progn + (eval-when (eval compile load) (export (list ',name) "MUMBLE")) + (defmacro ,name ,@stuff))) + + +;;; Use this macro for importing a random symbol into the MUMBLE +;;; package. This is useful for things that can share directly with +;;; built-in Common Lisp definitions. + +(defmacro define-mumble-import (name) + `(progn + (eval-when (eval compile load) (import (list ',name) "MUMBLE")) + (eval-when (eval compile load) (export (list ',name) "MUMBLE")) + ',name)) + + +;;; Use this macro for defining a function in the MUMBLE package that +;;; is a synonym for some Common Lisp function. Try to do some stuff +;;; to make the function compile inline. + +(defmacro define-mumble-synonym (name cl-name) + `(progn + (eval-when (eval compile load) (export (list ',name) "MUMBLE")) + (setf (symbol-function ',name) (symbol-function ',cl-name)) +#+lcl + (lcl:def-compiler-macro ,name (&rest args) + (cons ',cl-name args)) + ',name)) + + + +;;; Use this macro to define a type synonym. + +(defmacro define-mumble-type (name &rest stuff) + `(progn + (eval-when (eval compile load) (export (list ',name) "MUMBLE")) + (deftype ,name ,@stuff))) + + +;;; This macro is used to signal a compile-time error in situations +;;; where an implementation-specific definition is missing. + +(defmacro missing-mumble-definition (name) + (error "No definition has been provided for ~s." name)) + + + + + -- cgit v1.2.3