▲ | apgwoz 8 days ago | |
“Compilation”, I think, is exactly right. This feature is less about interpolation than it is about compilation of a single regexp to be used many times. It’s just shrouded in confusing documentation that should say: “/o tells ruby to rewrite this code such that it refers to a new statically allocated regexp object.” And when you write it that way, you see how insane it is for a function call to be hoisted automatically like this, without an explicit, obvious, syntactic annotation. | ||
▲ | gpvos 7 days ago | parent [-] | |
The implications of "statically allocated" are less clear than if you'd just write "compiled only once". |