Skip to content
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

Introduce Object>>printOneLineString #4849

Open
Ducasse opened this issue Oct 7, 2019 · 0 comments · Fixed by #4854

Comments

@Ducasse
Copy link
Member

commented Oct 7, 2019

The idea is that we should be able to have printOn: but that replaces cr and lf by space
and probably limited to a certain amount of character.

printOneLineString
should invoke printOnOneLine:
on a special Stream class (that interprets cr and lf as space).

By default printOnOneLine: should delegate to printOn: so that we get for free all
the printOn:

@Ducasse Ducasse added the Easy label Oct 7, 2019
leonardoce added a commit to leonardoce/pharo that referenced this issue Oct 7, 2019
It's nice to have a #printOneLineString that is just like #printString
but avoids printing CRs and LFs. This patch implements such idea adding
a method named #printOnOneLine:, working on a Stream, and a
FilteringStream.

The FilteringStream is used to replace CRs and LFs with a space, but can
be used to filter elements going into a Stream via a generic block.

Fixes: pharo-project#4849
leonardoce added a commit to leonardoce/pharo that referenced this issue Oct 7, 2019
It's nice to have a #printOneLineString that is just like #printString
but avoids printing CRs and LFs. This patch implements such idea adding
also a method named #printOnOneLine: which will get called with a
FilteringStream implementing the required behaviour.

The FilteringStream is used to replace CRs and LFs with a space, but can
also be used to filter elements going into a Stream via a generic block.

Fixes: pharo-project#4849
leonardoce added a commit to leonardoce/pharo that referenced this issue Oct 7, 2019
It's nice to have a #printOneLineString that is just like #printString
but avoids printing CRs and LFs. This patch implements such idea adding
also a method named #printOnOneLine: which will get called with a
FilteringStream implementing the required behaviour.

The FilteringStream is used to replace CRs and LFs with a space, but can
also be used to filter elements going into a Stream via a generic block.

Fixes: pharo-project#4849
@tesonep tesonep reopened this Oct 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.