From d4b680eb866297c08ce6d704ca2fd6b5d670010f Mon Sep 17 00:00:00 2001 From: Jakub Jankiewicz Date: Wed, 28 Feb 2024 16:13:15 +0100 Subject: [PATCH] add doc string for macroexpand and macroexpand-1 --- src/lips.js | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/lips.js b/src/lips.js index b5e89a684..c1c3b63cc 100644 --- a/src/lips.js +++ b/src/lips.js @@ -8384,8 +8384,19 @@ var global_env = new Environment({ The lambda macro creates a new anonymous function. If the first element of the body is a string and there is more elements the string is used as the documentation string, that can be read using (help fn).`), - 'macroexpand': new Macro('macroexpand', macro_expand()), - 'macroexpand-1': new Macro('macroexpand-1', macro_expand(true)), + // ------------------------------------------------------------------ + 'macroexpand': doc( + new Macro('macroexpand', macro_expand()), + `(macroexpand expr) + + Macro that expand all macros inside and return single expression as output.`), + // ------------------------------------------------------------------ + 'macroexpand-1': doc( + new Macro('macroexpand-1', macro_expand(true)), + `(macroexpand-1 expr) + + Macro similar to macroexpand but it expand macros only one level + and return single expression as output.`), // ------------------------------------------------------------------ 'define-macro': doc(new Macro(macro, function(macro, { use_dynamic, error }) { if (is_pair(macro.car) && macro.car.car instanceof LSymbol) {