<kares[m]>
yeah makes sense but there should be an option to turn it off - have seen folks start short-life rubies scripting JRuby's Java APIs from the main runtime 😇
<headius[m]>
yeah for sure
shellac has joined #jruby
shellac has quit [Ping timeout: 240 seconds]
drbobbeaty has quit [Read error: Connection reset by peer]
drbobbeaty has joined #jruby
ChrisBr has quit [Ping timeout: 245 seconds]
ChrisBr has joined #jruby
shellac has joined #jruby
lucasb has joined #jruby
<fidothe>
lopex: potentially daft question. In `RubyRegexp.regsub()` a Joni Regex object is used, but only to check whether there are any named captures, or to deref them to a capture group. To handle `\0` etc in the pattern-is-a-string case in `String#gsub`, would it be stupid to have a constant Joni Regex to pass in here to confirm that there are no named groups (impossible when pattern is a string)?
<fidothe>
That would allow me to just use `RubyRegexp.regsub()` and not re-implement that non-trivial logic
<fidothe>
i guess `RubyRegexp.regsub` could also be refactored to extract a method with no need for a Joni Regex, given that the place it's always needed, irrespective of code path, is basically a lookup that's unchanging per instance, rather than the deref case which is per-match
<enebo[m]>
fidothe: we can start there and then see if it ends up having any perf impact
<enebo[m]>
fidothe: but I was also thinking an end game version would be a boolean which notices that it have replacements in it so it can just do the regexp code path for gsub
<fidothe>
enebo[m]: All the `Regex` instance needs is to return appropriately for `noNameGroupIsActive()`
<fidothe>
so an empty or single-char pattern would probably do it
<fidothe>
the content of the pattern is immaterial AFAICT
<fidothe>
so it could be cached as a static property?
<fidothe>
i'll try doing it inline to see if it works
<fidothe>
and i also need to figure out the sane way to set `$&, $', and $\``
<fidothe>
and i also need to figure out the sane way to set `$&, $', and $``
<fidothe>
and i also need to figure out the sane way to set `$&, $', and $```
<fidothe>
and i also need to figure out the sane way to set $-backtick
<fidothe>
for those without IRCCloud's markdown interpretation that'll have made absolutely no sense
<enebo[m]>
yeah it can be made a static helper I think
<enebo[m]>
fidothe: from what I rememebr just setting last match will indirectly set those as they are all derived from last match
<enebo[m]>
$~ that is
<enebo[m]>
fidothe: if you look at RubyGlobal and the for example PreMatchGlobalVariable within there you can see it accessing from backref
<fidothe>
sweet
<fidothe>
okay, i have `spec/ruby/core/string/gsub_spec.rb` passing now
<fidothe>
have to go do dad things, will be back later
KeyJoo has joined #jruby
<enebo[m]>
fidothe: ok cool. This may be commitable with that round of fixes
xardion has quit [Remote host closed the connection]
xardion has joined #jruby
subbu is now known as subbu|away
subbu|away is now known as subbu
shellac has quit [Ping timeout: 240 seconds]
rusk has quit [Remote host closed the connection]
KeyJoo has quit [Quit: KeyJoo]
<headius[m]>
that's excellent
lucasb has quit [Quit: Connection closed for inactivity]
<fidothe>
enebo[m]: alas, `spec/ruby/core/string/sub_spec.rb` is failing now. Annoyingly, I think it's down to stuff that could be shared in `subBangCommon` no longer being entirely shareable.
<fidothe>
I'll take a look tomorrow...
<fidothe>
Nope. Me being tired and dumb. both gsub and sub specs passing
<fidothe>
Am too tired to write a decent commit message, so am pushing to my branch with a terrible one
<fidothe>
rebases clean with master, so will push that in the morning once the travis build has finished
<headius[m]>
Haha ok
<enebo[m]>
fidothe: don't sweat it. I will merge on Monday.