@tenderlove I'm genuinely confused by the second call. What's going on here?
@nickkelley the 'o' flag on the regular expression means "compile this regexp once and then cache the results". So the first call creates a regex that contains the marshal dump content, and caches it (in the instruction sequences btw). The second call is like "oh this re is already compiled, so just get the source and marshal load it" which returns the cached hash
@tenderlove follow-up question: why are regexes special like this? Normally I'd expect it to be treated as any other local expression, with a new object created on each invocation. This seems to suggest there's some kind of language-level special casing for compiling regex?
@nickkelley when you use the 'o' flag on the regex, there is a special case in the compiler. Any other regex behaves "as you'd expect". Basically, just don't use the 'o' flag (I can't think of a good use case for it except ridiculous code like my post)
@tenderlove ah, that makes sense. (For some definition of "sense" )
I also now see you clarified "in the instruction sequences" in your original explanation, sorry for the repeat question! And thank you as always for being available for teaching so much.
@nickkelley no problem! Glad to help
@tenderlove very "on.source"
@tenderlove in *this* economy??