1 |
|
(define-module (lang elisp primitives fns) |
2 |
|
#:use-module (lang elisp internals fset)) |
3 |
|
|
4 |
|
(fset 'fset fset) |
5 |
|
(fset 'defalias fset) |
6 |
|
|
7 |
|
(fset 'apply elisp-apply) |
8 |
|
|
9 |
|
(fset 'funcall |
10 |
|
(lambda (function . args) |
11 |
|
(elisp-apply function args))) |
12 |
|
|
13 |
|
(fset 'interactive-p |
14 |
|
(lambda () |
15 |
|
#f)) |
16 |
|
|
17 |
|
(fset 'commandp |
18 |
|
(lambda (sym) |
19 |
|
(if (interactive-spec (fref sym)) #t #f))) |
20 |
|
|
21 |
|
(fset 'fboundp |
22 |
|
(lambda (sym) |
23 |
|
(variable? (symbol-fref sym)))) |
24 |
|
|
25 |
|
(fset 'symbol-function fref/error-if-void) |
26 |
|
|
27 |
|
(fset 'macroexpand macroexpand) |
28 |
|
|
29 |
|
(fset 'subrp |
30 |
|
(lambda (obj) |
31 |
|
(not (not-subr? obj)))) |
32 |
|
|
33 |
|
(fset 'byte-code-function-p |
34 |
|
(lambda (object) |
35 |
|
#f)) |
36 |
|
|
37 |
|
(fset 'run-hooks |
38 |
|
(lambda (hooks) |
39 |
|
(cond ((null hooks)) |
40 |
|
((list? hooks) |
41 |
|
(for-each (lambda (hook) |
42 |
|
(elisp-apply hook '())) |
43 |
|
hooks)) |
44 |
|
(else |
45 |
|
(elisp-apply hooks '()))))) |