Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

CL is cryptic

Name: Anonymous 2011-08-03 5:11

I'm trying to define export-defun macro, that would automatically export defined function, but produces error "These symbols are not accessible in the XYZ package" with ASDF. How would you fix it?


(defmacro export-defun (pkg name args &body body)
  (unless (find-package pkg)
    (make-package pkg))
  (let ((sym (intern (symbol-name name) pkg)))
    `(progn (defun ,sym ,args ,@body)
            (export ',sym))))

Name: Anonymous 2011-08-03 13:53

What >>4 said, but
Why do you need to do this? You can just export the symbol in the package definition form, and if you want to write your code from another package, you can always:

(defun your-package:your-function (...) ...)

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List