#477 parameter confusion in new Gray Streams functions

closed-fixed
clisp (525)
5
2008-05-28
2008-05-28
DEATH
No

Both gray:stream-read-sequence and gray:stream-write-sequence are supposed to accept (and pass down) a stream and a sequence, in that order. The actual order of the parameters, however, is the reverse.

See:

http://clisp.cvs.sourceforge.net/clisp/clisp/src/gray.lisp?revision=1.17&view=markup

http://clisp.cons.org/impnotes/gray-gf-general.html

Discussion

  • Sam Steingold

    Sam Steingold - 2008-05-28

    Logged In: YES
    user_id=5735
    Originator: NO

    I fixed the doc, thanks.

     
  • Sam Steingold

    Sam Steingold - 2008-05-28
    • assigned_to: haible --> sds
    • status: open --> closed-fixed
     
  • Anton Vodonosov

    Anton Vodonosov - 2008-05-28

    Logged In: YES
    user_id=1659504
    Originator: NO

    It's also necessary to change as follows (because in the
    stream-read-byte-sequence and friends stream is the first param):

    --- gray.lisp 2008-05-28 17:44:32.873125000 +0300
    +++ gray.fixed.lisp 2008-05-28 17:45:42.341875000 +0300
    @@ -161,17 +161,17 @@

    (clos:defgeneric stream-read-sequence (sequence stream &key start end)
    (:method (sequence (stream fundamental-binary-input-stream) &key start end)
    - (stream-read-byte-sequence sequence stream start end))
    + (stream-read-byte-sequence stream sequence start end))
    (:method (sequence (stream fundamental-character-input-stream) &key start end)
    - (stream-read-char-sequence sequence stream start end))
    + (stream-read-char-sequence stream sequence start end))
    (:method (sequence (stream fundamental-input-stream) &rest rest)
    (apply #'sys::%read-sequence sequence stream rest)))

    (clos:defgeneric stream-write-sequence (sequence stream &key start end)
    (:method (sequence (stream fundamental-binary-output-stream) &key start end)
    - (stream-write-byte-sequence sequence stream start end))
    + (stream-write-byte-sequence stream sequence start end))
    (:method (sequence (stream fundamental-character-output-stream) &key start end)
    - (stream-write-char-sequence sequence stream start end))
    + (stream-write-char-sequence stream sequence start end))
    (:method (sequence (stream fundamental-output-stream) &rest rest)
    (apply #'sys::%write-sequence sequence stream rest)))

    Perhaps it would have been better if we had made stream the first
    parameter of the stream-read-sequence as well, but on the other
    hand standard read-sequence has has sequence the first.

     
  • Sam Steingold

    Sam Steingold - 2008-05-28

    Logged In: YES
    user_id=5735
    Originator: NO

    thank you for your bug report.
    the bug has been fixed in the CVS tree.
    you can either wait for the next release (recommended)
    or check out the current CVS tree (see http://clisp.cons.org\)
    and build CLISP from the sources (be advised that between
    releases the CVS tree is very unstable and may not even build
    on your platform).

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks