You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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!
The text was updated successfully, but these errors were encountered:
alhassy
changed the title
Support for cl-defun -- A Workaround
No Support for cl-defun :'(
Oct 31, 2019
alhassy
changed the title
No Support for cl-defun :'(
Support for cl-defun -- A Workaround
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:Temporarily rebinding
cl-defun
todefun
may make things work ... so far, I have been unable to getmacrolet
or anything else to make this work; the reason may be that I'm macrolettingdefun
to rewrite intocl-defun
, which usesdefun
in its definition?What I've been able to do thus far is to locally treat
defun
as producing symbolic lists that begin withcl-defun
, butdefine-namespaces
only sees thedefun
and so rewrites them beforehand and the resulting fragements are theneval
-uated.Any alternative approach would be appreciated!
The text was updated successfully, but these errors were encountered: