From blindglobe at gmail.com Sat Jul 11 06:30:48 2009 From: blindglobe at gmail.com (A.J. Rossini) Date: Sat, 11 Jul 2009 08:30:48 +0200 Subject: [cl-pdf-devel] strange error in most recent CL-PDF with more recent SBCL? Message-ID: <1abe3fa90907102330g73ef4938v4b36f621d80bcb55@mail.gmail.com> Dear all - Working through the examples for CL-PDF (trying to put together a quick substitute for R's Sweave literate programming tool) is giving me some weird errors, for example, evaluation of the EXAMPLE1 function (error from SLIME below). In general, PDF:WRITE-DOCUMENT function seems to be unable to take a string or pathname, but throws the following error (which I tried to resolve by OPENing the proper handle and passing it): # is not a binary output stream. [Condition of type SIMPLE-TYPE-ERROR] Restarts: 0: [RETRY] Retry SLIME interactive evaluation request. 1: [ABORT] Return to SLIME's top level. 2: [TERMINATE-THREAD] Terminate this thread (#) Backtrace: 0: (SB-KERNEL:ILL-BOUT #)[:EXTERNAL] 1: (SB-IMPL::ANSI-STREAM-WRITE-SEQUENCE #(8 153 115 10 225 210 ...) # 0 NIL) 2: (WRITE-SEQUENCE #(8 153 115 10 225 210 ...) #)[:EXTERNAL] This is with SBCL from Debian Unstable: SBCL 1.0.29.11.debian Now, looking through the code, I'm thinking this might be an SBCL issue and should be reported there? Or is this a bug with recent CL-PDF's? Or perhaps I'm mixing and matching packages which shouldn't be mixed and matched? Insight appreciated, including a clue-stick if I need one. best, -tony blindglobe at gmail.com Muttenz, Switzerland. "Commit early,commit often, and commit in a repository from which we can easily roll-back your mistakes" (AJR, 4Jan05). Drink Coffee: Do stupid things faster with more energy! From blindglobe at gmail.com Sat Jul 11 07:15:10 2009 From: blindglobe at gmail.com (A.J. Rossini) Date: Sat, 11 Jul 2009 09:15:10 +0200 Subject: [cl-pdf-devel] [Sbcl-help] strange error in most recent CL-PDF with more recent SBCL? In-Reply-To: <16b7c45afbdc6db46e8cb4f9444bf048.squirrel@www.electronic-quill.net> References: <1abe3fa90907102330g73ef4938v4b36f621d80bcb55@mail.gmail.com> <16b7c45afbdc6db46e8cb4f9444bf048.squirrel@www.electronic-quill.net> Message-ID: <1abe3fa90907110015tebbea81jde7f096e2be14c96@mail.gmail.com> James - That does the trick, THANKS! On Sat, Jul 11, 2009 at 8:48 AM, James Fleming wrote: >> PDF:WRITE-DOCUMENT function >> seems to be unable to take a string or pathname, but throws the >> following error (which I tried to resolve by OPENing the proper handle >> and passing it): >> >> # is not a binary >> output stream. > > > Tony, > > I've recently run into this myself. > After a bit of experimentation, I've had consistent success with passing > it a filehandle opened for writing with :element-type :default, like so: > > (with-open-file (outstream #p"/path/to/outfile.pdf" > ? ? ? ? ? ? ? ? ? ? ? ? ? ? :direction :output > ? ? ? ? ? ? ? ? ? ? ? ? ? ? :if-exists :rename > ? ? ? ? ? ? ? ? ? ? ? ? ? ? :element-type :default) > ?(pdf:with-document > ? ? > ? ?(pdf:write-document outstream))) > > I first tried passing it a filehandle opened with :element-type > '(unsigned-byte 8) but it them complained that it didn't have a stream of > type character. I've no idea why you have to explicitly tell it to use the > default element-type, but also don't have the time to dig around and > figure that out. > > > HTH, > James > > ------------------------------------------------------------------------------ > Enter the BlackBerry Developer Challenge > This is your chance to win up to $100,000 in prizes! For a limited time, > vendors submitting new applications to BlackBerry App World(TM) will have > the opportunity to enter the BlackBerry Developer Challenge. See full prize > details at: http://p.sf.net/sfu/Challenge > _______________________________________________ > Sbcl-help mailing list > Sbcl-help at lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/sbcl-help > -- best, -tony blindglobe at gmail.com Muttenz, Switzerland. "Commit early,commit often, and commit in a repository from which we can easily roll-back your mistakes" (AJR, 4Jan05). Drink Coffee: Do stupid things faster with more energy!