From: Cyrus H. <ch...@bo...> - 2005-09-07 16:09:11
|
I'm exploring the relatively new bivalent streams in SBCL and I am trying to do the following: (defun bivalent-stream-test-1 () (with-open-file (foo #p"foo" :direction :output :if-does-not-exist :create :if-exists :overwrite :element-type :default) (format foo "bogus!~&") (write-byte 131 foo) (write-sequence #(137 80 78 71 13 10 26 10) foo))) The format and the write-byte succeed, but the write-sequence fails with the error: The value 137 is not of type CHARACTER. [Condition of type TYPE-ERROR] ... Backtrace: 0: (SB-IMPL::OUTPUT-CHAR-LATIN-1-FULL-BUFFERED #<SB-SYS:FD-STREAM for "file /Users/sly/projects/cyrusharmon.org/tes$ 1: ((LABELS SB-IMPL::OUTPUT-SEQ-IN-LOOP)) 2: (SB-IMPL::ANSI-STREAM-WRITE-SEQUENCE #(137 80 78 71 13 10 26 10) #<SB-SYS:FD-STREAM for "file /Users/sly/project$ 3: (WRITE-SEQUENCE #(137 80 78 71 13 10 26 10) #<SB-SYS:FD-STREAM for "file /Users/sly/projects/cyrusharmon.org/tes$ 4: (BIVALENT-STREAM-TEST::BIVALENT-STREAM-TEST-1) is this the desired behavior? I'd like to be able to use write- sequence with a sequence of bytes, but can't, or at least I can't figure out how. Thanks, Cyrus |