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

wrong printing for single-element matrix #36732

Closed
simeonschaub opened this issue Jul 19, 2020 · 5 comments
Closed

wrong printing for single-element matrix #36732

simeonschaub opened this issue Jul 19, 2020 · 5 comments
Labels
display and printing Aesthetics and correctness of printed representations of objects.

Comments

@simeonschaub
Copy link
Member

The following printing is wrong, as the output would produce a vector, not a matrix:

julia> show(IOContext(stdout, :compact=>true), fill(42, 1, 1))
[42]

Observed on master and 1.5.

@StefanKarpinski
Copy link
Member

The trouble is we don't have an input syntax for single-column matrices.

@simeonschaub
Copy link
Member Author

We could probably just print this as fill(42, 1, 1). I don't think there is a more concise way to otherwise express this.

@JeffBezanson JeffBezanson added the display and printing Aesthetics and correctness of printed representations of objects. label Jul 19, 2020
@JeffBezanson
Copy link
Member

Related: #28905

@simeonschaub
Copy link
Member Author

@thofma and @mbauman seemed against this in #36737, but I still think it would be good to be able to distinguish matrices from vectors when printed inside arrays. Perhaps a compromise would be printing matrices with a trailing semicolon, for example [42;], although this would of course still produce a vector, so might be more confusing.

@simeonschaub
Copy link
Member Author

This is now fixed by #33697

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
display and printing Aesthetics and correctness of printed representations of objects.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants