Shen-Language / shen-cl

Shen for Common Lisp (Unmaintained)
BSD 3-Clause "New" or "Revised" License
122 stars 11 forks source link

fix declare specifier #4

Closed cxxxr closed 7 years ago

rkoeninger commented 7 years ago

@cxxxr Sorry for the delay on this PR.

I don't completely understand the type declaration syntax. What observable effect does this change have and for which platforms (CLisp, CCL, SBCL)? Have you tested it with all 3 platforms?

cxxxr commented 7 years ago

The syntax before change was incorrect.

for example

sbcl

* (defun f (x y)  
(declare ((type string x) (type string y)))
(concatenate 'string x y))
; in: DEFUN F
;     ((TYPE STRING X) (TYPE STRING Y))
; 
; caught WARNING:
;   unrecognized declaration ((TYPE STRING X) (TYPE STRING Y))
; 
; compilation unit finished
;   caught 1 WARNING condition

F

* (defun f (x y)
(declare (type string x) (type string y))
(concatenate 'string x y))

F

ccl

(declare ((type string x) (type string y)))
(concatenate 'string x y))
;Compiler warnings :
;   In F: Unknown or invalid declaration ((TYPE STRING X) (TYPE STRING Y))
F

? (defun f (x y)
(declare (type string x) (type string y))
(concatenate 'string x y))
F
rkoeninger commented 7 years ago

Ah, the logs are so verbose I never noticed that one.

Merging, Thanks.