From schaeffer.michael.a at gmail.com Wed Oct 15 21:46:09 2008 From: schaeffer.michael.a at gmail.com (Mike Schaeffer) Date: Wed, 15 Oct 2008 17:46:09 -0400 Subject: [flexi-streams-devel] Formatted output under CLISP Message-ID: <6d6eac060810151446t47be1d11n3065ee76fc7b7f7d@mail.gmail.com> All, I'm currently trying to use DRAKMA on CLISP to write a script that will automatically fetch a web page and scrape some information out of a table. While trying to get this to work, I ran into an issue that I'm able to reproduce with only FLEXI-STREAMS. Given a fresh CLISP (with flexi-streams loaded via ASDF) I'm getting the following behavior: CL-USER> (format *standard-output* "Hello World!") Hello World!NIL CL-USER> (setq my-flexi-stream (flexi-streams:make-flexi-stream *standard-output*)) # CL-USER> (format my-flexi-stream "Hello World!") At this point, I get the following error: NO-APPLICABLE-METHOD: When calling #1=# with arguments #2=(#(72 101 108 108 111 32 87 111 114 108 ...) # NIL 12), no method is applicable. [Condition of type METHOD-CALL-ERROR] The original error I encountered in Drakma is also easy to reproduce. I get the following error on the first call to DRAKMA:HTTP-REQUEST: NO-APPLICABLE-METHOD: When calling #1=# with arguments #2=(#(71 69 84) # NIL 3), no method is applicable. [Condition of type METHOD-CALL-ERROR] The #(71 69 84) is basically "GET", so this looks like the first write to the stream for the outgoing HTTP request. I'm still ascending the learning curve, so I'm not quite sure what to make of these errors, but my best guess is that maybe I have an inconsistent set of packages installed. Has anybody seen anything like this before? Google seems to think not. I've attached the output from the ASDF call (stripped of some directory names) at the end of this mail, if it's useful. Other possibly relevant information is that this is CLISP 2.45 (2008-05-15) and it's running on a Windows XP SP3 machine. Any help would be very much appreciated. Thanks, Mike ; loading system definition from ...\lisp\flexi-streams-1.0.7\flexi-streams.asd into # ;; Loading file ...\lisp\flexi-streams-1.0.7\flexi-streams.asd ... ; registering # as FLEXI-STREAMS ; registering # as FLEXI-STREAMS-TEST ;; Loaded file ...\lisp\flexi-streams-1.0.7\flexi-streams.asd ; loading system definition from ...\lisp\trivial-gray-streams-2006-09-16\trivial-gray-streams.asd into # ;; Loading file ...\lisp\trivial-gray-streams-2006-09-16\trivial-gray-streams.asd ... ; registering # as TRIVIAL-GRAY-STREAMS ;; Loaded file ...\lisp\trivial-gray-streams-2006-09-16\trivial-gray-streams.asd ;; Loading file ...\lisp\trivial-gray-streams-2006-09-16\package.fas ... ;; Loaded file ...\lisp\trivial-gray-streams-2006-09-16\package.fas ;; Loading file ...\lisp\trivial-gray-streams-2006-09-16\mixin.fas ... WARNING: The generic function # is being modified, but has already been called. ;; Loaded file ...\lisp\trivial-gray-streams-2006-09-16\mixin.fas ;; Loading file ...\lisp\flexi-streams-1.0.7\packages.fas ... ;; Loaded file ...\lisp\flexi-streams-1.0.7\packages.fas ;; Loading file ...\lisp\flexi-streams-1.0.7\mapping.fas ... ;; Loaded file ...\lisp\flexi-streams-1.0.7\mapping.fas ;; Loading file ...\lisp\flexi-streams-1.0.7\ascii.fas ... ;; Loaded file ...\lisp\flexi-streams-1.0.7\ascii.fas ;; Loading file ...\lisp\flexi-streams-1.0.7\koi8-r.fas ... ;; Loaded file ...\lisp\flexi-streams-1.0.7\koi8-r.fas ;; Loading file ...\lisp\flexi-streams-1.0.7\iso-8859.fas ... ;; Loaded file ...\lisp\flexi-streams-1.0.7\iso-8859.fas ;; Loading file ...\lisp\flexi-streams-1.0.7\code-pages.fas ... ;; Loaded file ...\lisp\flexi-streams-1.0.7\code-pages.fas ;; Loading file ...\lisp\flexi-streams-1.0.7\specials.fas ... ;; Loaded file ...\lisp\flexi-streams-1.0.7\specials.fas ;; Loading file ...\lisp\flexi-streams-1.0.7\util.fas ... ;; Loaded file ...\lisp\flexi-streams-1.0.7\util.fas ;; Loading file ...\lisp\flexi-streams-1.0.7\conditions.fas ... ;; Loaded file ...\lisp\flexi-streams-1.0.7\conditions.fas ;; Loading file ...\lisp\flexi-streams-1.0.7\external-format.fas ... ;; Loaded file ...\lisp\flexi-streams-1.0.7\external-format.fas ;; Loading file ...\lisp\flexi-streams-1.0.7\length.fas ... ;; Loaded file ...\lisp\flexi-streams-1.0.7\length.fas ;; Loading file ...\lisp\flexi-streams-1.0.7\encode.fas ... ;; Loaded file ...\lisp\flexi-streams-1.0.7\encode.fas ;; Loading file ...\lisp\flexi-streams-1.0.7\decode.fas ... ;; Loaded file ...\lisp\flexi-streams-1.0.7\decode.fas ;; Loading file ...\lisp\flexi-streams-1.0.7\in-memory.fas ... WARNING: The generic function # is being modified, but has already been called. ;; Loaded file ...\lisp\flexi-streams-1.0.7\in-memory.fas ;; Loading file ...\lisp\flexi-streams-1.0.7\stream.fas ... WARNING: The generic function # is being modified, but has already been called. ;; Loaded file ...\lisp\flexi-streams-1.0.7\stream.fas ;; Loading file ...\lisp\flexi-streams-1.0.7\output.fas ... WARNING: The generic function # is being modified, but has already been called. WARNING: The generic function # is being modified, but has already been called. WARNING: The generic function # is being modified, but has already been called. WARNING: The generic function # is being modified, but has already been called. ;; Loaded file ...\lisp\flexi-streams-1.0.7\output.fas ;; Loading file ...\lisp\flexi-streams-1.0.7\input.fas ... WARNING: The generic function # is being modified, but has already been called. ;; Loaded file ...\lisp\flexi-streams-1.0.7\input.fas ;; Loading file ...\lisp\flexi-streams-1.0.7\io.fas ... WARNING: The generic function # is being modified, but has already been called. ;; Loaded file ...\lisp\flexi-streams-1.0.7\io.fas ;; Loading file ...\lisp\flexi-streams-1.0.7\strings.fas ... ;; Loaded file ...\lisp\flexi-streams-1.0.7\strings.fas 0 errors, 0 warnings From avodonosov at yandex.ru Wed Oct 15 21:57:28 2008 From: avodonosov at yandex.ru (Anton Vodonosov) Date: Thu, 16 Oct 2008 00:57:28 +0300 Subject: [flexi-streams-devel] Formatted output under CLISP In-Reply-To: <6d6eac060810151446t47be1d11n3065ee76fc7b7f7d@mail.gmail.com> References: <6d6eac060810151446t47be1d11n3065ee76fc7b7f7d@mail.gmail.com> Message-ID: <711703324.20081016005728@yandex.ru> Hello Mike, try to apply this patch to trival-gray-streams, maybe it will help: http://common-lisp.net/pipermail/cl-plus-ssl-devel/2008-June/000061.html Best regards, - Anton on Thursday, October 16, 2008, 12:46:09 AM Mike wrote: > All, > I'm currently trying to use DRAKMA on CLISP to write a script that > will automatically fetch a web page and scrape some information out of > a table. While trying to get this to work, I ran into an issue that > I'm able to reproduce with only FLEXI-STREAMS. > Given a fresh CLISP (with flexi-streams loaded via ASDF) I'm getting > the following behavior: > CL-USER> (format *standard-output* "Hello World!") > Hello World!NIL > CL-USER> (setq my-flexi-stream (flexi-streams:make-flexi-stream > *standard-output*)) > # > CL-USER> (format my-flexi-stream "Hello World!") > At this point, I get the following error: > NO-APPLICABLE-METHOD: When calling #1=# STREAM-WRITE-BYTE-SEQUENCE> with arguments #2=(#(72 101 108 > 108 111 32 87 111 114 108 ...) > # NIL 12), no > method is applicable. > [Condition of type METHOD-CALL-ERROR] > The original error I encountered in Drakma is also easy to reproduce. > I get the following error on the first call to DRAKMA:HTTP-REQUEST: > NO-APPLICABLE-METHOD: When calling #1=# STREAM-WRITE-BYTE-SEQUENCE> with arguments #2=(#(71 69 84) > # NIL 3), no method > is applicable. > [Condition of type METHOD-CALL-ERROR] > The #(71 69 84) is basically "GET", so this looks like the first write > to the stream for the outgoing HTTP request. > I'm still ascending the learning curve, so I'm not quite sure what to > make of these errors, but my best guess is that maybe I have an > inconsistent set of packages installed. Has anybody seen anything like > this before? Google seems to think not. I've attached the output from > the ASDF call (stripped of some directory names) at the end of this > mail, if it's useful. Other possibly relevant information is that this > is CLISP 2.45 (2008-05-15) and it's running on a Windows XP SP3 > machine. > Any help would be very much appreciated. > Thanks, > Mike > ; loading system definition from > ...\lisp\flexi-streams-1.0.7\flexi-streams.asd into # > ;; Loading file ...\lisp\flexi-streams-1.0.7\flexi-streams.asd ... > ; registering # as FLEXI-STREAMS > ; registering # as FLEXI-STREAMS-TEST > ;; Loaded file ...\lisp\flexi-streams-1.0.7\flexi-streams.asd > ; loading system definition from > ...\lisp\trivial-gray-streams-2006-09-16\trivial-gray-streams.asd into > # > ;; Loading file > ...\lisp\trivial-gray-streams-2006-09-16\trivial-gray-streams.asd ... > ; registering # as TRIVIAL-GRAY-STREAMS > ;; Loaded file > ...\lisp\trivial-gray-streams-2006-09-16\trivial-gray-streams.asd > ;; Loading file > ...\lisp\trivial-gray-streams-2006-09-16\package.fas ... > ;; Loaded file ...\lisp\trivial-gray-streams-2006-09-16\package.fas > ;; Loading file ...\lisp\trivial-gray-streams-2006-09-16\mixin.fas ... > WARNING: The generic function # GRAY:STREAM-WRITE-CHAR-SEQUENCE> is being modified, but has already > been called. > ;; Loaded file ...\lisp\trivial-gray-streams-2006-09-16\mixin.fas > ;; Loading file ...\lisp\flexi-streams-1.0.7\packages.fas ... > ;; Loaded file ...\lisp\flexi-streams-1.0.7\packages.fas > ;; Loading file ...\lisp\flexi-streams-1.0.7\mapping.fas ... > ;; Loaded file ...\lisp\flexi-streams-1.0.7\mapping.fas > ;; Loading file ...\lisp\flexi-streams-1.0.7\ascii.fas ... > ;; Loaded file ...\lisp\flexi-streams-1.0.7\ascii.fas > ;; Loading file ...\lisp\flexi-streams-1.0.7\koi8-r.fas ... > ;; Loaded file ...\lisp\flexi-streams-1.0.7\koi8-r.fas > ;; Loading file ...\lisp\flexi-streams-1.0.7\iso-8859.fas ... > ;; Loaded file ...\lisp\flexi-streams-1.0.7\iso-8859.fas > ;; Loading file ...\lisp\flexi-streams-1.0.7\code-pages.fas ... > ;; Loaded file ...\lisp\flexi-streams-1.0.7\code-pages.fas > ;; Loading file ...\lisp\flexi-streams-1.0.7\specials.fas ... > ;; Loaded file ...\lisp\flexi-streams-1.0.7\specials.fas > ;; Loading file ...\lisp\flexi-streams-1.0.7\util.fas ... > ;; Loaded file ...\lisp\flexi-streams-1.0.7\util.fas > ;; Loading file ...\lisp\flexi-streams-1.0.7\conditions.fas ... > ;; Loaded file ...\lisp\flexi-streams-1.0.7\conditions.fas > ;; Loading file ...\lisp\flexi-streams-1.0.7\external-format.fas ... > ;; Loaded file ...\lisp\flexi-streams-1.0.7\external-format.fas > ;; Loading file ...\lisp\flexi-streams-1.0.7\length.fas ... > ;; Loaded file ...\lisp\flexi-streams-1.0.7\length.fas > ;; Loading file ...\lisp\flexi-streams-1.0.7\encode.fas ... > ;; Loaded file ...\lisp\flexi-streams-1.0.7\encode.fas > ;; Loading file ...\lisp\flexi-streams-1.0.7\decode.fas ... > ;; Loaded file ...\lisp\flexi-streams-1.0.7\decode.fas > ;; Loading file ...\lisp\flexi-streams-1.0.7\in-memory.fas ... > WARNING: The generic function #> is being modified, but has already been called. > ;; Loaded file ...\lisp\flexi-streams-1.0.7\in-memory.fas > ;; Loading file ...\lisp\flexi-streams-1.0.7\stream.fas ... > WARNING: The generic function # is > being modified, but has already been called. > ;; Loaded file ...\lisp\flexi-streams-1.0.7\stream.fas > ;; Loading file ...\lisp\flexi-streams-1.0.7\output.fas ... > WARNING: The generic function #> is being modified, but has already been called. > WARNING: The generic function # STREAM-FINISH-OUTPUT> is being modified, but has already been called. > WARNING: The generic function #> is being modified, but has already been called. > WARNING: The generic function #> is being modified, but has already been called. > ;; Loaded file ...\lisp\flexi-streams-1.0.7\output.fas > ;; Loading file ...\lisp\flexi-streams-1.0.7\input.fas ... > WARNING: The generic function #> is being modified, but has already been called. > ;; Loaded file ...\lisp\flexi-streams-1.0.7\input.fas > ;; Loading file ...\lisp\flexi-streams-1.0.7\io.fas ... > WARNING: The generic function #> is being modified, but has already been called. > ;; Loaded file ...\lisp\flexi-streams-1.0.7\io.fas > ;; Loading file ...\lisp\flexi-streams-1.0.7\strings.fas ... > ;; Loaded file ...\lisp\flexi-streams-1.0.7\strings.fas > 0 errors, 0 warnings > _______________________________________________ > flexi-streams-devel mailing list > flexi-streams-devel at common-lisp.net > http://common-lisp.net/cgi-bin/mailman/listinfo/flexi-streams-devel From avodonosov at yandex.ru Wed Oct 15 23:34:21 2008 From: avodonosov at yandex.ru (Anton Vodonosov) Date: Thu, 16 Oct 2008 02:34:21 +0300 Subject: [flexi-streams-devel] Formatted output under CLISP In-Reply-To: <6d6eac060810151538x78bf30a0k3986a221feacfc24@mail.gmail.com> References: <6d6eac060810151446t47be1d11n3065ee76fc7b7f7d@mail.gmail.com> <711703324.20081016005728@yandex.ru> <6d6eac060810151538x78bf30a0k3986a221feacfc24@mail.gmail.com> Message-ID: <1866007231.20081016023421@yandex.ru> on Thursday, October 16, 2008, 1:38:12 AM Mike wrote: > Thanks! This is a definite improvement. (and amazingly fast :-) > The patch seems to have changed the error message to where it's now > complaining about a slightly different generic function, this time > called on the underlying SWANK output stream: > NO-APPLICABLE-METHOD: When calling #1=# STREAM-WRITE-CHAR-SEQUENCE> with arguments #2=(#(72 101 108 > 108 111 32 87 111 114 108 ...) > # 0 12), no method > is applicable. > [Condition of type METHOD-CALL-ERROR] > Is it reasonable to belive I need to provide a definition of the > method for the SLIME-OUTPUT-STREAM? Flexi-streams are designed to wrap binary stream - a stream that supports WRITE-BYTE and WRITE-SEQUENCE with a byte array as argument. SILE-OUTPUT-STREAM is a character stream, it inherits from FUNDAMENTAL-CHARACTER-OUTPUT-STREAM. Therefore, your example: (setq my-flexi-stream (flexi-streams:make-flexi-stream *standard-output*)) (format my-flexi-stream "Hello World!") is not 100% correct. As far as I understood, the example is only created to isolate the error you encountered when used Drakma with CLISP, and there is no real need to wrap *standard-output* by flexi-stream. With patched trivial-gray-streams Drakma must work in CLISP. Best regards, - Anton