diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2023-03-21 21:48:05 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2023-03-21 21:48:05 -0700 |
commit | 1cdc46ddad07b2b9eadabad81a7321f6037452bf (patch) | |
tree | a6c8965d7cf5512bb7373003e7ae36a43b79e91a /eval.c | |
parent | b0996ee594a18976dae2ac3f0a6932ac50630992 (diff) | |
download | txr-1cdc46ddad07b2b9eadabad81a7321f6037452bf.tar.gz txr-1cdc46ddad07b2b9eadabad81a7321f6037452bf.tar.bz2 txr-1cdc46ddad07b2b9eadabad81a7321f6037452bf.zip |
New function: ignore, synonym of nilf.
This will be an official mechanism for indicating
deliberately unused variables.
* eval.c (eval_init): Register ignore intrinsic,
binding to the same function object as nilf.
* stdlib/compiler.tl (%const-foldable-funs%): Mention
ignore function, next to its nilf synonym.
* txr.1: Documented.
* stdlib/doc-syms.tl: Updated.
Diffstat (limited to 'eval.c')
-rw-r--r-- | eval.c | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -7160,7 +7160,12 @@ void eval_init(void) reg_fun(intern(lit("callf"), user_package), func_n1v(callf)); reg_fun(intern(lit("mapf"), user_package), func_n1v(mapf)); reg_fun(intern(lit("tf"), user_package), func_n0v(tf)); - reg_fun(intern(lit("nilf"), user_package), func_n0v(nilf)); + + { + val nilf_f = func_n0v(nilf); + reg_fun(intern(lit("nilf"), user_package), nilf_f); + reg_fun(intern(lit("ignore"), user_package), nilf_f); + } reg_fun(intern(lit("print"), user_package), func_n3o(print, 1)); reg_fun(intern(lit("pprint"), user_package), func_n2o(pprint, 1)); |