diff options
-rw-r--r-- | eval.c | 7 | ||||
-rw-r--r-- | stdlib/constfun.tl | 2 | ||||
-rw-r--r-- | stdlib/doc-syms.tl | 5 | ||||
-rw-r--r-- | txr.1 | 23 |
4 files changed, 32 insertions, 5 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)); diff --git a/stdlib/constfun.tl b/stdlib/constfun.tl index bef32cc5..0f66ac41 100644 --- a/stdlib/constfun.tl +++ b/stdlib/constfun.tl @@ -47,7 +47,7 @@ memq memql memqual rmemq rmemql rmemqual countq countql countqual posq posql posqual rposq rposql rposqual eq eql equal meq meql mequal neq neql nequal max min clamp bracket take drop if or and progn - prog1 prog2 nilf tf display-width sys:fmt-simple + prog1 prog2 nilf ignore tf display-width sys:fmt-simple sys:fmt-flex sys:fmt-join packagep symbolp keywordp bindable stringp length-str coded-length cmp-str string-lt str= str< str> str<= str>= int-str diff --git a/stdlib/doc-syms.tl b/stdlib/doc-syms.tl index 067d3701..4046ea49 100644 --- a/stdlib/doc-syms.tl +++ b/stdlib/doc-syms.tl @@ -985,6 +985,7 @@ ("ignbrk" "N-02391683") ("igncr" "N-02391683") ("ignerr" "N-007287AC") + ("ignore" "N-007E0508") ("ignpar" "N-02391683") ("ignwarn" "N-02552A58") ("imaxbel" "N-02391683") @@ -1324,7 +1325,7 @@ ("next-file" "N-00839D2F") ("nf" "N-0267AE6D") ("nil" "N-015134D8") - ("nilf" "N-032070EB") + ("nilf" "N-007E0508") ("ninth" "N-01B0FA33") ("nl0" "N-03BD477F") ("nl1" "N-03BD477F") @@ -1994,7 +1995,7 @@ ("test-neq-set-indent-mode" "N-01A1F89C") ("test-set" "N-036C7E9E") ("test-set-indent-mode" "N-01A1F89C") - ("tf" "N-032070EB") + ("tf" "N-007E0508") ("third" "N-01B0FA33") ("throw" "D-0053") ("throwf" "N-015466AD") @@ -58769,10 +58769,11 @@ with both optional arguments omitted: [iff a] <---> [iff a identity nilf] <---> a .brev -.coNP Functions @ tf and @ nilf +.coNP Functions @, tf @ nilf and @ ignore .synb .mets (tf << arg *) .mets (nilf << arg *) +.mets (ignore << arg *) .syne .desc The @@ -58789,6 +58790,11 @@ and the function returns .codn nil . +The +.code ignore +function is a synonym of +.codn nilf . + Note: the following equivalences hold between these functions and the .code ret operator, and @@ -58813,6 +58819,11 @@ and [mapcar (ret nil) list] <--> [mapcar nilf list] .brev +Note: the +.code ignore +function can be used for suppressing unused variable +warnings. + .TP* Example: .verb @@ -58851,6 +58862,16 @@ is even, then iff passes it into the function, which ignores the value and returns .codn nil . +The following example shows how +.code ignore +may be used to suppress compiler warnings about unused parameters +or other variables: + +.verb + (defun (x y) + (ignore x y)) +.brev + .coNP Function @ retf .synb .mets (retf << value ) |