truffleruby
truffleruby copied to clipboard
Array inject accept strings
Attempt to address https://github.com/oracle/truffleruby/issues/2931. This expands the specialisations for InjectNode to accept strings in place of symbols.
Local test:
➜ truffleruby git:(master) ✗ jt ruby -e "p [2,3].inject('*')"
$ /.../ruby \
--experimental-options \
--core-load-path=/.../truffleruby/src/main/ruby/truffleruby \
-e \
p\ \[2,3\].inject\(\'\*\'\)
6
➜ truffleruby git:(master) ✗ jt ruby -e "p [2,3].inject(3, '*')"
Using Interpreted TruffleRuby: mxbuild/truffleruby-jvm
$ /.../truffleruby/mxbuild/truffleruby-jvm/languages/ruby/bin/ruby \
--experimental-options \
--core-load-path=/.../truffleruby/src/main/ruby/truffleruby \
-e \
p\ \[2,3\].inject\(3,\ \'\*\'\)
18
Thank you for your pull request and welcome to our community! To contribute, please sign the Oracle Contributor Agreement (OCA). The following contributors of this PR have not signed the OCA:
- PR author: wasabigeek
- [email protected] (@wasabigeek)
To sign the OCA, please create an Oracle account and sign the OCA in Oracle's Contributor Agreement Application.
When signing the OCA, please provide your GitHub username. After signing the OCA and getting an OCA approval from Oracle, this PR will be automatically updated.
If you are an Oracle employee, please make sure that you are a member of the main Oracle GitHub organization, and your membership in this organization is public.
Thank you for signing the OCA.
I'd like to give it a try! May take some time to get back to this, hope that's alright
Yes, that's fine, there is no urgency for this issue/PR. If you need any help feel free to ask @nirvdrum or on the GraalVM Slack truffleruby channel.
Closing this PR in favor for #3596.