Http://ruby-doc.org/docs/keywords/1.9/ : (Object)

What is the purpose of
  (Object)
next to every keyword in http://ruby-doc.org/docs/keywords/1.9/
?

Trivia question: What is the only keyword with a question mark?

Object is their class, and the root object in Ruby. (Well,
technically BasicObject is now the root object. But that's if you
want to bypass the rest of the object heirarchy.) As shown in the
core docs, similar notation is standard for all methods.

http://ruby-doc.org/core-1.9.3/

···

On Tue, Mar 6, 2012 at 3:50 PM, Ralph Shnelvar <ralphs@dos32.com> wrote:

What is the purpose of
(Object)
next to every keyword in RDoc Documentation
?

Trivia question: What is the only keyword with a question mark?

--
Carina

defined?

However, the ones Ralph asked about are NOT methods on Object, or any
other class -- they are Ruby keywords. There's an explanation of that
at http://ruby-doc.org/docs/keywords/1.9/keywords_rb.html\. Apparently
the keywords were just shoehorned into RDoc, which isn't really cut
out for describing keywords (just yet).

···

On Tue, Mar 6, 2012 at 3:50 PM, Ralph Shnelvar <ralphs@dos32.com> wrote:

What is the purpose of
(Object)
next to every keyword in RDoc Documentation
?

Trivia question: What is the only keyword with a question mark?

On Tue, Mar 6, 2012 at 8:18 PM, Carina C. Zona <cczona@gmail.com> wrote:

Object is their class, and the root object in Ruby. (Well,
technically BasicObject is now the root object. But that's if you
want to bypass the rest of the object heirarchy.) As shown in the
core docs, similar notation is standard for all methods.

Class: Object (Ruby 1.9.3)
Class: BasicObject (Ruby 1.9.3)
Index of Files, Classes & Methods in Ruby 1.9.3 (Ruby 1.9.3)

Hmm, I was under the impression that keywords were distinct from
methods. After all, I can't explicitly specify a receiver when using a
keyword:

$ irb
1.9.2-p290 :001 > self.begin
NoMethodError: undefined method `begin' for main:Object
  from (irb):1
  from /Users/kendall/.rvm/rubies/ruby-1.9.2-p290/bin/irb:16:in `<main>'
1.9.2-p290 :002 > self.def hi
NameError: undefined local variable or method `hi' for main:Object
  from (irb):2
  from /Users/kendall/.rvm/rubies/ruby-1.9.2-p290/bin/irb:16:in `<main>'

As such, I'm also confused why a *keyword* is somehow affiliated with
a class. I'd guess/assume it's just how the RDoc engine works and was
used to document keywords (???) as opposed to it actually indicating
that keywords are somehow implemented as methods on Object. I'd love
to know, semantically speaking as well as technically, what the case
is here.

···

On Tue, Mar 6, 2012 at 7:18 PM, Carina C. Zona <cczona@gmail.com> wrote:

Object is their class, and the root object in Ruby. (Well,
technically BasicObject is now the root object. But that's if you
want to bypass the rest of the object heirarchy.) As shown in the
core docs, similar notation is standard for all methods.

--
Kendall Gifford
zettabyte@gmail.com

More info here. Where are keywords defined in Ruby? - Stack Overflow Short
version: keywords are an exception to "everything is an object in
Ruby". Interesting.

···

On Tue, Mar 6, 2012 at 6:34 PM, Kendall Gifford <zettabyte@gmail.com> wrote:

On Tue, Mar 6, 2012 at 7:18 PM, Carina C. Zona <cczona@gmail.com> wrote:

Object is their class, and the root object in Ruby. (Well,
technically BasicObject is now the root object. But that's if you
want to bypass the rest of the object heirarchy.) As shown in the
core docs, similar notation is standard for all methods.

Hmm, I was under the impression that keywords were distinct from
methods. After all, I can't explicitly specify a receiver when using a
keyword:

$ irb
1.9.2-p290 :001 > self.begin
NoMethodError: undefined method `begin' for main:Object
from (irb):1
from /Users/kendall/.rvm/rubies/ruby-1.9.2-p290/bin/irb:16:in `<main>'
1.9.2-p290 :002 > self.def hi
NameError: undefined local variable or method `hi' for main:Object
from (irb):2
from /Users/kendall/.rvm/rubies/ruby-1.9.2-p290/bin/irb:16:in `<main>'

As such, I'm also confused why a *keyword* is somehow affiliated with
a class. I'd guess/assume it's just how the RDoc engine works and was
used to document keywords (???) as opposed to it actually indicating
that keywords are somehow implemented as methods on Object. I'd love
to know, semantically speaking as well as technically, what the case
is here.

--
Kendall Gifford
zettabyte@gmail.com