I invoke Ruby from my shell script like this:
ruby -n -e "print if %r($fromre)...%r($tore)" "$@"
Since Ruby 2.6, I get the warning
warning: flip-flop is deprecated
So it seems that i have to be prepared that the wise high priests of Ruby have decided that this (IMO useful) construct will be completely gone one day.
What would be an easy work-around? Of course I can replace
print if %r($fromre)...%r($tore)
by
inside ||= %r($fromre)
if inside
print
inside = false if %r($tore)
end
but I wonder whether there is a more concise way to write this.
$SAFE
levels, continuations,ObjectSpace
, etc. in that those ones have deep impact on the design of the VM and the kinds of optimizations that can be performed, whereas flip-flop is semantically trivial. So, there are fundamental reasons not to support one of those semantically invasive features but really no fundamental reasons not to support flip-flop (which is why TruffleRuby chose to implement it, despite the fact it's so rarely used). – Caiman