$~ semantics still doesnt match MRI
-----------------------------------
Key: JRUBY-2103
URL: http://jira.codehaus.org/browse/JRUBY-2103
Project: JRuby
Issue Type: Bug
Reporter: Marcin Mielzynski
Assignee: Thomas E Enebo
"ac" =~ /a/
m = $~
"ab" =~ /a/
p m.post_match
$~ = m
p $~.post_match
The code should print
"c"
"c"
whereas in jruby it prints
"b"
"b"
or
"b"
"c"
depending whether the compiler is turned on.
Compiler makes special case for $~ and $- GlobalVariable implementations (we
need to extract their support into RuntimeHelpers so it can be used by
interpreter and compiler, so we can still skip getGlobalVariables/set/get
overhead).
Moreover, the compiler should allow $~ = some_match_data and raise on $~ = 1
Actually, I think we might get rid of RubyGlobal in future since e.g.
getGlobalVariables().get("...") implies hash lookup overhead and is used rather
heavily.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email