From: Bruno H. <br...@cl...> - 2004-10-13 15:00:22
|
Nikodemus Siivola wrote: > > That's not enough. The SBCL-generated type declaration in itself is > > wrong. > > This is actually not an issue: if the variables are ever assigned to the > declaration is effectively removed.[1] ... > > 1. The declaration is not actually removed, but the form is transformed > as follows: > > <declarations> <body> => <declarations> (let <rebind-parameters> <body>) This appears to work for lexical variables, but not for special variables. For (defvar *var*) (defmethod genfoo ((*var* file-stream)) (setq *var* (make-string-output-stream)) (write-sequence "Hello, world!" *var*)) I get a ; caught WARNING: ; Asserted type FILE-STREAM conflicts with derived type ; (VALUES SB-IMPL::STRING-OUTPUT-STREAM &OPTIONAL). and, when I call the function, * (genfoo (open "/etc/passwd" :direction :input)) debugger invoked on a TYPE-ERROR in thread 22471: The value #<SB-IMPL::STRING-OUTPUT-STREAM {9315BD1}> is not of type FILE-STREAM. This is with SBCL-0.8.13 on Linux/x86. Bruno |