-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmisc.lisp
19 lines (16 loc) · 832 Bytes
/
misc.lisp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
(in-package :fwoar.lisputils)
(defmacro twice (&body body)
`(progn ,@body
,@body))
(defmacro define-cluser-entrypoint ((&rest args) &body body)
"Use the current package name to generate a <PACKAGE-NAME>.MAIN function in CL-USER.
This will not do anything if :FW.DEV is not in features as it's only intended as a shortcut"
`(progn ,@(when (featurep :fw.dev)
(let ((entrypoint-symbol (intern (format nil "~a.~a" (package-name *package*) '#:main)
:cl-user)))
`((defun ,entrypoint-symbol ,args
,@body)
(export ',entrypoint-symbol :cl-user))))
(defun ,(intern (symbol-name '#:main) *package*) ,args
,@body)
(export ',(intern (symbol-name '#:main) *package*) *package*)))