- Types
- NilClass
- Numeric
- Integer
- Fixnum (deprecated in Ruby 2.4)
- Bignum (deprecated in Ruby 2.4)
- Float
- Rational (the
r
suffix was added in Ruby 2.1) - Complex (the
i
suffix was added in Ruby 2.1)
- Integer
- String
- Regexp (? not sure)
- Symbol
- Range
- Array
- Hash
Note:
Since Ruby 2.1.0, Rational literals are available, like these: 0r
, 2r/3
, 2/3r
.
Note:
Since Ruby 2.1.0, Complex literals are available, like these: 0i
, 1+0i
, 1+1i
.
Note: Since Ruby 2.4.0, Fixnum and Bignum are unified into Integer.
Note: It seems that there does not exist an official Ruby Language Specification. Therefore, the above information was gathered from various sources, including:
-
Running the following commands:
git clone https://github.com/ruby/ruby cd ruby ruby sample/exyacc.rb < parse.y