fukamachi / fast-http

A fast HTTP request/response parser for Common Lisp.
343 stars 37 forks source link

Type error during load fast-http using quicklisp. #35

Open SFurnace opened 6 years ago

SFurnace commented 6 years ago

I got this when I load this system using quicklisp.

Error: Variable +TOKENS+ was declared type (SIMPLE-ARRAY CHARACTER (128)) but is being set to value #(#\Null #\Null #\Null #\Null #\Null #\Null #\Null #\Null #\Null #\Null #\Null #\Null #\Null #\Null #\Null #\Null #\Null #\Null #\Null #\Null #\Null #\Null #\Null #\Null #\Null #\Null #\Null #\Null #\Null #\Null #\Null #\Null #\Null #\! #\Null #\# #\$ #\% #\& #\' ...).
   1 (continue) Try loading ......

Actually, according to CLHS, #( and ) are used to notate a simple vector., and the compound type specifiers derive from simple-vector is the same as (simple-array t (size)). I think this is the reason why an error was signaled.

My lisp implementation is LispWorks 7.1, and this bug can be fixed by using coerceon +tokens+ and +unhex+ like this:

(define-constant +tokens+
                 (coerce #( #\Nul  #\Nul  #\Nul  #\Nul  #\Nul  #\Nul  #\Nul  #\Nul
                            #\Nul  #\Nul  #\Nul  #\Nul  #\Nul  #\Nul  #\Nul  #\Nul
                            #\Nul  #\Nul  #\Nul  #\Nul  #\Nul  #\Nul  #\Nul  #\Nul
                            #\Nul  #\Nul  #\Nul  #\Nul  #\Nul  #\Nul  #\Nul  #\Nul
                            #\Nul   #\!   #\Nul   #\#    #\$    #\%    #\&    #\'
                            #\Nul  #\Nul   #\*    #\+   #\Nul    #\-   #\.   #\Nul
                            #\0    #\1    #\2    #\3    #\4    #\5    #\6    #\7
                            #\8    #\9   #\Nul  #\Nul  #\Nul  #\Nul  #\Nul  #\Nul
                            #\Nul   #\a    #\b    #\c    #\d    #\e    #\f    #\g
                            #\h    #\i    #\j    #\k    #\l    #\m    #\n    #\o
                            #\p    #\q    #\r    #\s    #\t    #\u    #\v    #\w
                            #\x    #\y    #\z   #\Nul  #\Nul  #\Nul   #\^    #\_
                            #\`    #\a    #\b    #\c    #\d    #\e    #\f    #\g
                            #\h    #\i    #\j    #\k    #\l    #\m    #\n    #\o
                            #\p    #\q    #\r    #\s    #\t    #\u    #\v    #\w
                            #\x    #\y    #\z   #\Nul   #\|   #\Nul   #\~   #\Nul ) 
                         '(simple-array character (128)))
                 :test 'equalp)
paulvaneecke commented 6 years ago

I had the same problem, but this seems to be fixed now, not only in the repository version, but also on in the quicklisp version :-)