8000 Support for `cl-defun` -- A Workaround · Issue #32 · Malabarba/names · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Support for cl-defun -- A Workaround #32

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
alhassy opened this issue Oct 31, 2019 · 0 comments
Open

Support for cl-defun -- A Workaround #32

alhassy opened this issue Oct 31, 2019 · 0 comments

Comments

@alhassy
Copy link
alhassy commented Oct 31, 2019

There seems to be no support for cl-defun; which is unfortunate.


The expected approach does not namespace a cl-defun-ed function:

(define-namespace woah-
(cl-defun here ())
)
;; ⇒ here

Temporarily rebinding cl-defun to defun may make things work ... so far, I have been unable to get macrolet or anything else to make this work; the reason may be that I'm macroletting defun to rewrite into cl-defun, which uses defun in its definition?

What I've been able to do thus far is to locally treat defun as producing symbolic lists that begin with cl-defun, but define-namespaces only sees the defun and so rewrites them beforehand and the resulting fragements are then eval-uated.

 (eval (cl-macrolet ((defun (&rest more) `(cons 'cl-defun (quote ,more))))
 
   (define-namespace woah-
   (list 'progn
       
   (defun first  (x &key (y 3)) (+ x y))
   (defun second (x &key (y 3)) (+ x y))
 
   )))) ;; ⇒ woah-first and woah-second are defined

Any alternative approach would be appreciated!

@alhassy alhassy changed the title Support for cl-defun -- A Workaround No Support for cl-defun :'( Oct 31, 2019
@alhassy alhassy changed the title No Support for cl-defun :'( Support for cl-defun -- A Workaround Oct 31, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant
0