燮preSS预警函数参数LISP中不使用 [英] Suppress warning for function arguments not used in LISP
本文介绍了燮preSS预警函数参数LISP中不使用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在口齿不清,我需要定义一组函数,都用相同数量的参数。
不过,功能可能会或可能不会使用所有的参数,导致警告消息的一种鞭策。例如:
In lisp, I need to define a set of functions, all with the same number of arguments. However, the functions may or may not use all the arguments, leading to a spur of warning messages. For example:
(defun true (X Y) X)
[...]
; caught STYLE-WARNING:
; The variable Y is defined but never used.
有没有一种方法,以警告是旨在编译器?
Is there a way to warn the compiler that is was intended?
推荐答案
查看Common Lisp的Hyperspec:宣言忽略,可忽略
See the Common Lisp Hyperspec: Declaration IGNORE, IGNORABLE
(defun true (X Y)
(declare (ignore y))
X)
这篇关于燮preSS预警函数参数LISP中不使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文