-
Notifications
You must be signed in to change notification settings - Fork 145
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Convert lisp stream dispatch to virtual methods #1531
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good work.
claspCharacter decode_passthrough(unsigned char** buffer, unsigned char* buffer_end); | ||
int encode_passthrough(unsigned char* buffer, claspCharacter c); | ||
|
||
claspCharacter decode_ascii(unsigned char** buffer, unsigned char* buffer_end); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might be good to move out all these methods to some general class rather than FileStream. (something for the later changes, of course)
l = compute_char_size(string.unsafe_character()); | ||
} else if (cl__stringp(string)) { | ||
Fixnum iEnd; | ||
String_sp sb = string.asOrNull<String_O>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Obviously this is just code you're copying and so fixing it is a bit out of scope, but just to mention (you probably already know):
- asOrNull is to be avoided. we have
gc::As
etc - this conditional is pointless, since
cl__length
will return the fill pointer - ditto StringFillp and SetStringFillp. they should be on the chopping block
src/core/lispStream.cc
Outdated
unlikely_if(!AnsiStreamP(strm)) ERROR_WRONG_TYPE_ONLY_ARG(cl::_sym_open_stream_p, strm, cl::_sym_Stream_O); | ||
return (StreamClosed(strm) ? nil<T_O>() : _lisp->_true()); | ||
AnsiStream_sp ansi_stream = strm.asOrNull<AnsiStream_O>(); | ||
return ansi_stream ? (ansi_stream->_Closed ? nil<T_O>() : _lisp->_true()) : eval::funcall(gray::_sym_open_stream_p, strm); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe oughta have a reader rather than using a field directly
No description provided.