[#65451] [ruby-trunk - Feature #10333] [PATCH 3/1] optimize: "yoda literal" == string — ko1@...

Issue #10333 has been updated by Koichi Sasada.

9 messages 2014/10/07

[ruby-core:65429] Why $LAST_MATCH_INFO is always nil

From: roro codeath <rorocodeath@...>
Date: 2014-10-06 02:42:20 UTC
List: ruby-core #65429
# when i try:
"smth".match(%r{s})
puts "$LAST_MATCH_INFO:#{$LAST_MATCH_INFO} ---- #{::File.basename
__FILE__}:#{__LINE__}"
puts "$~:#{$~} ---- #{::File.basename __FILE__}:#{__LINE__}"

# output
# $LAST_MATCH_INFO: ---- ex.rb:2
# $~:s ---- ex.rb:3
"smth".match(%r{s})

roroco@roroco ~/Dropbox/rb-projs/try_ro_r4py $ ruby -v
ruby 2.1.2p95 (2014-05-08 revision 45877) [x86_64-linux]

In This Thread

Prev Next