guicho271828 / trivia

Pattern Matcher Compatible with Optima
Other
334 stars 22 forks source link

Declare unused variable in `ASSOC` pattern. #72

Closed daewok closed 7 years ago

daewok commented 7 years ago

SBCL's warnings about this are annoying. Before this change, compiling an ASSOC or ALIST pattern would result in something like:

; in: MATCH '((A . 1))
;     (HANDLER-BIND ((TYPE-ERROR
;                     (LAMBDA (TRIVIA.LEVEL2.IMPL::C) (UNLESS #:FLAG775 #))))
;       (ASSOC 'A #:IT774))
; --> SB-IMPL::%HANDLER-BIND SB-INT:DX-FLET
; ==>
;   (FLET ((#:H0 (TRIVIA.LEVEL2.IMPL::C)
;            (UNLESS #:FLAG775 (RETURN-FROM #:BLK778 NIL))))
;     (DECLARE (SB-INT:TRULY-DYNAMIC-EXTENT (FUNCTION #:H0)))
;     (SB-INT:DX-LET ((SB-KERNEL:*HANDLER-CLUSTERS*
;                      (CONS # SB-KERNEL:*HANDLER-CLUSTERS*)))
;       (PROGN (ASSOC 'A #:IT774))))
;
; caught STYLE-WARNING:
;   The variable TRIVIA.LEVEL2.IMPL::C is defined but never used.
;
; compilation unit finished
;   caught 1 STYLE-WARNING condition
guicho271828 commented 7 years ago

thanks, will be merged after the test.

guicho271828 commented 7 years ago

I just noticed that PR commits are not built on Travis by default (I thought it used to be so before). Anyways, this should not introduce any bugs.