File tree Expand file tree Collapse file tree 1 file changed +18
-5
lines changed Expand file tree Collapse file tree 1 file changed +18
-5
lines changed Original file line number Diff line number Diff line change 1973
1973
(defmacro load-file* [f]
1974
1974
`(. js/goog (~'nodeGlobalRequire ~f)))
1975
1975
1976
- (defmacro macroexpand-1 [[quote form]]
1977
- `(quote ~(ana/macroexpand-1 &env form)))
1978
-
1979
- (defmacro macroexpand [[quote form]]
1980
- (core/let [env &env]
1976
+ (defmacro macroexpand-1
1977
+ " If form represents a macro form, returns its expansion,
1978
+ else returns form."
1979
+ [quoted]
1980
+ (core/assert (core/= (core/first quoted) 'quote)
1981
+ " Argument to macroexpand-1 must be quoted" )
1982
+ (core/let [form (second quoted)]
1983
+ `(quote ~(ana/macroexpand-1 &env form))))
1984
+
1985
+ (defmacro macroexpand
1986
+ " Repeatedly calls macroexpand-1 on form until it no longer
1987
+ represents a macro form, then returns it. Note neither
1988
+ macroexpand-1 nor macroexpand expand macros in subforms."
1989
+ [quoted]
1990
+ (core/assert (core/= (core/first quoted) 'quote)
1991
+ " Argument to macroexpand must be quoted" )
1992
+ (core/let [form (second quoted)
1993
+ env &env]
1981
1994
(core/loop [form' (ana/macroexpand-1 env form)]
1982
1995
(core/if-not (core/identical? form form')
1983
1996
(recur (ana/macroexpand-1 env form))
You can’t perform that action at this time.
0 commit comments