Programming Ruby 3.2 (5th Edition): B4.0 page 598, $_ + $_dup.chop() + PP.pp(self, ''.dup)

@noelrappin

page 598, in Shortcuts

  • A. bullet Kernel#chomp says :

$_ (the result of the most recent expresssion)

But

 r = 1 + 2
 puts $_.inspect # => nil

pages 232, 451, 459 all describe $_ as the most recent line input by gets or readline

  • B. in bullet Kernel#chop, missing dot after $_ in $_dup.chop()

  • C. Kernel.pretty_inspect : something wrong in PP.pp(self, ".dup)