mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-12 23:00:22 +02:00
new elisp special form `eval-when-compile'
* module/language/elisp/compile-tree-il.scm (compile-eval-when-compile): New function. * module/language/elisp/runtime/function-slot.scm: Update module definition.
This commit is contained in:
parent
a338fa3d87
commit
80687f2e4b
2 changed files with 6 additions and 0 deletions
|
@ -31,6 +31,7 @@
|
||||||
#:use-module (srfi srfi-26)
|
#:use-module (srfi srfi-26)
|
||||||
#:export (compile-tree-il
|
#:export (compile-tree-il
|
||||||
compile-progn
|
compile-progn
|
||||||
|
compile-eval-when-compile
|
||||||
compile-if
|
compile-if
|
||||||
compile-defconst
|
compile-defconst
|
||||||
compile-defvar
|
compile-defvar
|
||||||
|
@ -632,6 +633,9 @@
|
||||||
(defspecial progn (loc args)
|
(defspecial progn (loc args)
|
||||||
(make-sequence loc (map compile-expr args)))
|
(make-sequence loc (map compile-expr args)))
|
||||||
|
|
||||||
|
(defspecial eval-when-compile (loc args)
|
||||||
|
(make-const loc (compile `(progn ,@args) #:from 'elisp #:to 'value)))
|
||||||
|
|
||||||
(defspecial if (loc args)
|
(defspecial if (loc args)
|
||||||
(pmatch args
|
(pmatch args
|
||||||
((,cond ,then . ,else)
|
((,cond ,then . ,else)
|
||||||
|
|
|
@ -32,6 +32,7 @@
|
||||||
#:use-module ((language elisp compile-tree-il)
|
#:use-module ((language elisp compile-tree-il)
|
||||||
#:select
|
#:select
|
||||||
((compile-progn . progn)
|
((compile-progn . progn)
|
||||||
|
(compile-eval-when-compile . eval-when-compile)
|
||||||
(compile-if . if)
|
(compile-if . if)
|
||||||
(compile-defconst . defconst)
|
(compile-defconst . defconst)
|
||||||
(compile-defvar . defvar)
|
(compile-defvar . defvar)
|
||||||
|
@ -54,6 +55,7 @@
|
||||||
#:duplicates (last)
|
#:duplicates (last)
|
||||||
;; special operators
|
;; special operators
|
||||||
#:re-export (progn
|
#:re-export (progn
|
||||||
|
eval-when-compile
|
||||||
if
|
if
|
||||||
defconst
|
defconst
|
||||||
defvar
|
defvar
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue