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 /txr.1 | |
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 'txr.1')
-rw-r--r-- | txr.1 | 23 |
1 files changed, 22 insertions, 1 deletions
@@ -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 ) |