Hey groovy cats. I’ve decided to stretch myself and start being more
useful to the Ruby community (I hope) by breaking the core.
…I mean, by submitting patches, implementing features I think look
interesting and/or easy to achieve.
I was looking at issue #7795 https://bugs.ruby-lang.org/issues/7795
and decided to implement String#to_existing_sym and String#interned,
which are new methods that act like #to_sym and #intern, except that if
the Symbol doesn’t already exist #to_existing_sym raises an
ArgumentError and #interned returns nil.
Because it deviates a bit from the feature request I’m not going to
submit it as a real patch, but I was wondering if someone could take a
look at what I’ve done and let me know if there are any obvious goofs
(like, missed function registrations, or mismatched types, or things
missing from headers, or other typical core-patching gotchas).
Note: I haven’t built it yet, because I haven’t had a chance to patch it
into a buildable environment like the 2.0.0-p0 source.