Commits

Robert Smith committed 7900de5

Add DEFUNCTION

  • Participants
  • Parent commits d7c2836

Comments (0)

Files changed (2)

File language.lisp

   "Call (SETF PLACE VALUE) only if PLACE evaluates to NIL."
   `(unless ,place
      (setf ,place ,value)))
+
+(defmacro defunction (symbol function)
+  "Define a function (bound to SYMBOL) based off of a function value
+FUNCTION."
+  (assert (symbolp symbol)
+          (symbol)
+          "SYMBOL must be a symbol, given ~S."
+          symbol)
+  `(progn
+     (setf (symbol-function ',symbol) ,function)
+     ',symbol))

File qtility-package.lisp

    #:while
    #:nothing
    #:setf-unless
+   #:defunction
 
    ;; array.lisp
    #:copy-array