Quantcast
Channel: Active questions tagged ruby - Stack Overflow
Viewing all articles
Browse latest Browse all 4616

Make interactive ruby REPL display results for consecutive commands, not only the last?

$
0
0

If I run this

a = "hello"b = "world"ab

in ruby

irb(main):007> a = "hello"=> "hello"irb(main):008> b = "world"=> "world"irb(main):009> airb(main):010> b=> "world"

in python1

>>> a = "hello">>> b = "world">>> a'hello'>>> b'world'

Ruby skips the result of a (and if there were more consecutive lines of code it would skip their output too). Ruby only displays the output of the last consecutive command (in this case, b)

Question

Is there a way to force ruby to not do that, that is, if there's >1 consecutive commands, to show the results of all of them, not just the last?


1. Python is just an example, most other scripting languages too.


Viewing all articles
Browse latest Browse all 4616

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>