[1.9] Symbols are allowed in Range: (:Z..:a).to_a, etc.
-------------------------------------------------------

                 Key: JRUBY-4194
                 URL: http://jira.codehaus.org/browse/JRUBY-4194
             Project: JRuby
          Issue Type: Bug
          Components: Ruby 1.9, RubySpec
    Affects Versions: JRuby 1.5
            Reporter: Hiro Asari
            Assignee: Thomas E Enebo


In 1.9, Symbols are allowed in Range, and they should be treated special.
{noformat}
surfboard:~$ ruby19 -ve 'p (:Z..:a).to_a'
ruby 1.9.2dev (2009-10-31 trunk 25580) [x86_64-darwin10.0.0]
-e:1: warning: (...) interpreted as grouped expression
[:Z, :"[", :"\\", :"]", :^, :_, :`, :a]
{noformat}

The symbols that appear above are those between 'Z' and 'a' in the ASCII table.

Right now, in JRuby, (:Z..:a).each (.step, .to_a) go into an infinite loop, 
since successive invocation of 'succ' for ':Z' will never get to ':a'.

Also, there is a spec for this in spec/ruby/core/range/to_a_spec.rb.

A question remains whether :Z..:a should behave as above; but that's a question 
for MRI, I guess.

-- 
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


Reply via email to