2017-10-09 22 views
2

sbcl에서 deflock에 & 옵션과 & 키를 모두 사용할 때 예상 메시지를 숨길 수 있지만 defmacro에서 작동하지 않는 것으로 알고 있습니다. (. 난 그냥 내가 아는,/재 작성을 재 설계해야하지만, 이것은 기존 코드)sbcl : defmacro의 머플 스타일 경고

나는이 파일을 컴파일 ...

(declaim (sb-ext:muffle-conditions style-warning)) 

(defun wilma (&optional wilma1 &key wilma2 wilma3) 
    (declare (ignore wilma1 wilma2 wilma3))) 

(defmacro betty (&optional betty1 &key betty2 betty3) 
    (declare (ignore betty1 betty2 betty3))) 

을 ...이 발생합니다

home:~/sbcl/experiments/style-warning.d$ sbcl --noinform 
* (compile-file "5.lisp") 

; compiling file "/u/home/sbcl/experiments/style-warning.d/5.lisp" (written 09 OCT 2017 03:31:44 PM): 
; compiling (DECLAIM (MUFFLE-CONDITIONS STYLE-WARNING)) 
; compiling (DEFUN WILMA ...) 
; compiling (DEFMACRO BETTY ...) 
; file: /u/home/sbcl/experiments/style-warning.d/5.lisp 
; in: DEFMACRO BETTY 
;  (DEFMACRO BETTY (&OPTIONAL BETTY1 &KEY BETTY2 BETTY3) 
;  (DECLARE (IGNORE BETTY1 BETTY2 BETTY3))) 
; 
; caught STYLE-WARNING: 
; &OPTIONAL and &KEY found in the same lambda list: (&OPTIONAL BETTY1 &KEY BETTY2 
;              BETTY3) 
; 
; compilation unit finished 
; caught 1 STYLE-WARNING condition 


; /u/home/sbcl/experiments/style-warning.d/5.fasl written 
; compilation finished in 0:00:00.018 
#P"/u/home/sbcl/experiments/style-warning.d/5.fasl" 
T 
NIL 
* (exit) 
home:~/sbcl/experiments/style-warning.d$ 

이러한 진단을 어떻게 억제합니까? EDIT 1

이 이후

레거시 코드와 난 그냥 SBCL-준비를 위해 마사지 한 후 내가 어떤 코드 같은 것을 할 수없는 이유가 없다, 혼자 떠날거야하는

home:~/sbcl/experiments/style-warning.d$ sbcl --noinform 
* (with-open-file (*error-output* "/dev/null" :direction :output :if-exists :append) 
(compile-file "5.lisp")) 

; compiling file "/u/home/sbcl/experiments/style-warning.d/5.lisp" (written 09 OCT 2017 03:31:44 PM): 
; compiling (DECLAIM (MUFFLE-CONDITIONS STYLE-WARNING)) 
; compiling (DEFUN WILMA ...) 
; compiling (DEFMACRO BETTY ...) 

; /u/home/sbcl/experiments/style-warning.d/5.fasl written 
; compilation finished in 0:00:00.017 
#P"/u/home/sbcl/experiments/style-warning.d/5.fasl" 
T 
NIL 
* (exit) 
home:~/sbcl/experiments/style-warning.d$ 

매크로 정의에서 스타일 경고를 억제 할 수있는 기능이 있습니까?

답변

4

당신은 전에 (defmacro betty ...)이 컴파일 양식을

(declaim (sb-ext:muffle-conditions style-warning)) 

를 실행해야합니다.

(defun wilma (&optional wilma1 &key wilma2 wilma3) 
    (declare (ignore wilma1 wilma2 wilma3))) 

(defmacro betty (&optional betty1 &key betty2 betty3) 
    (declare (ignore betty1 betty2 betty3))) 
: 그 작업을 수행하는

한 가지 방법은 파일 5.lispwilmabetty을 포함

$ sbcl --non-interactive --eval '(declaim (sb-ext:muffle-conditions style-warning))' --eval '(compile-file "5")' 
This is SBCL 1.4.0, an implementation of ANSI Common Lisp. 
More information about SBCL is available at <http://www.sbcl.org/>. 

SBCL is free software, provided as is, with absolutely no warranty. 
It is mostly in the public domain; some portions are provided under 
BSD-style licenses. See the CREDITS and COPYING files in the 
distribution for more information. 
; compiling file "/Users/sds/lisp/5.lisp" (written 09 OCT 2017 09:51:51 PM): 
; compiling (DEFUN WILMA ...) 
; compiling (DEFMACRO BETTY ...) 

; /Users/sds/lisp/5.fasl written 
; compilation finished in 0:00:00.010 

입니다