Skip to content

Instantly share code, notes, and snippets.

@lokedhs
Created May 28, 2018 04:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lokedhs/531ac436c509b345aeb60fd7ee96c4f1 to your computer and use it in GitHub Desktop.
Save lokedhs/531ac436c509b345aeb60fd7ee96c4f1 to your computer and use it in GitHub Desktop.
(defmacro defmfun (function &body rest &aux .n.)
(cond ((and (car rest) (symbolp (car rest)))
;;old maclisp narg syntax
(setq .n. (car rest))
(setf (car rest)
`(&rest narg-rest-argument &aux (, .n. (length narg-rest-argument))))))
`(progn
;; I (rtoy) think we can consider all defmfun's as translated functions.
(defprop ,function t translated)
(defun ,function . ,rest)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment