You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When evaluating a Ruby expression that starts with break while not using the debugger, the behavior of the ruby code changes.
$ ruby -e 'p((break :foo while true))':foo
$ irb -f --prompt simple>> break :foo while trueDebugging commands are only available when IRB is started with binding.irb=> nil
The line evaluates to nil while I would expect to evaluate to :foo like it does without IRB.
Result of irb_info
Ruby version: 3.3.3
IRB version: irb 1.13.2 (2024-06-15)
InputMethod: RelineInputMethod with Reline 0.5.9 and /Users/etienne/.inputrc
Completion: Autocomplete, RegexpCompletor
.irbrc paths: /Users/etienne/.config/irb/irbrc
RUBY_PLATFORM: arm64-darwin23
LC_ALL env: en_US.UTF-8
East Asian Ambiguous Width: 1
Terminal Emulator
Terminal.app
Setting Files
Disabled using the -f command-line option.
The text was updated successfully, but these errors were encountered:
The confusing => nil part is now hidden in master branch. #972
This has been released in 1.14.0.
I think it is not easy to improve
Indeed. As a workaround, prepending ; makes sure the line is considered as Ruby code.
$ irb -f --simple-prompt>> break :foo while trueDebugging commands are only available when IRB is started with binding.irb>> ;break :foo while true=> :foo
Description
When evaluating a Ruby expression that starts with
break
while not using the debugger, the behavior of the ruby code changes.The line evaluates to
nil
while I would expect to evaluate to:foo
like it does without IRB.Result of irb_info
Terminal Emulator
Terminal.app
Setting Files
Disabled using the -f command-line option.
The text was updated successfully, but these errors were encountered: