Skip to content

Conversation

@joaotavora
Copy link

Some implementations of IN-MEMORY-OUTPUT-STREAM's ancestors, notably
the Allegro-specific implementation of
TRIVIAL-GRAY-STREAMS::FUNDAMENTAL-BINARY-OUTPUT-STREAM, don't expect
Babel-specific objects in :EXTERNAL-FORMAT initarg.

Unfortunately, this happened because the :EXTERNAL-FORMAT initarg was
also used by IN-MEMORY-STREAM, another ancestor to
IN-MEMORY-OUTPUT-STREAM. This fix ensures that the IN-MEMORY-STREAM
class takes an initarg that doesn't easily clash with other takes on
the meaning of :EXTERNAL-FORMAT.

Some implementations of IN-MEMORY-OUTPUT-STREAM's ancestors, notably
the Allegro-specific implementation of
TRIVIAL-GRAY-STREAMS::FUNDAMENTAL-BINARY-OUTPUT-STREAM, don't expect
Babel-specific objects in :EXTERNAL-FORMAT initarg.

Unfortunately, this happened because the :EXTERNAL-FORMAT initarg was
also used by IN-MEMORY-STREAM, another ancestor to
IN-MEMORY-OUTPUT-STREAM. This fix ensures that the IN-MEMORY-STREAM
class takes an initarg that doesn't easily clash with other takes on
the meaning of :EXTERNAL-FORMAT.

* src/streams.lisp (in-memory-stream): Change initarg sym from
:EXTERNAL-FORMAT to BABEL::IN-MEMORY-EXTERNAL-FORMAT
(make-in-memory-output-stream, make-in-memory-input-stream): Use
BABEL::IN-MEMORY-EXTERNAL-FORMAT initarg.

* tests/streams.lisp (make-in-memory-output-stream): New test.
@luismbo
Copy link
Member

luismbo commented Aug 7, 2015

Maybe s/BABEL::IN-MEMORY-EXTERNAL-FORMAT/:BABEL-EXTERNAL-FORMAT/? It's not as robust, but it feels funny to use non-keyword initargs.

@joaotavora
Copy link
Author

@luismbo you've gone full Emacs 😁 : isn't it even stranger to use prefixes in CL, which has packages?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants