From 1cdc46ddad07b2b9eadabad81a7321f6037452bf Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Tue, 21 Mar 2023 21:48:05 -0700 Subject: 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. --- txr.1 | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) (limited to 'txr.1') diff --git a/txr.1 b/txr.1 index 7be5a547..159c958d 100644 --- a/txr.1 +++ b/txr.1 @@ -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 ) -- cgit v1.2.3