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

irb does not print result for assignments #40

Closed
hanazuki opened this issue Nov 7, 2019 · 2 comments
Closed

irb does not print result for assignments #40

hanazuki opened this issue Nov 7, 2019 · 2 comments

Comments

@hanazuki
Copy link
Contributor

hanazuki commented Nov 7, 2019

Expected behavior: When an assignment expression is entered, irb prints its value.
Actual behavior: Nothing is printed.

% ruby -v
ruby 2.7.0dev (2019-11-07T14:33:45Z master d62abc47c8) [x86_64-linux]
% bundle exec exe/irb -f
irb(main):001:0> a=1
irb(main):002:0>

% ruby -v
ruby 2.6.5p114 (2019-10-01 revision 67812) [x86_64-linux]
% irb -f
irb(main):001:0> a=1
=> 1
irb(main):002:0>
@hanazuki
Copy link
Contributor Author

hanazuki commented Nov 7, 2019

This seems to be a intended change #12

@hanazuki hanazuki closed this as completed Nov 7, 2019
@kj
Copy link

kj commented Feb 1, 2020

I personally think it's a little confusing and inconsistent. Assignments are expressions in Ruby, and return a value, so I'd expect irb to print that just like any other expression. It was a bit jarring when this suddenly changed. I had to ask myself 'wait, this does return a value right?'.

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

No branches or pull requests

2 participants