Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > Kernel#blah is documented as Object#blah. Why?

Reply
Thread Tools

Kernel#blah is documented as Object#blah. Why?

 
 
Alex Fortuna
Guest
Posts: n/a
 
      02-18-2009
Hi guys.

There are certain common methods that originate from module Kernel, but
they're documented in class Object.

E.g.

> o = Object.new
> => #<Object:0xb76826c8>
> o.method :send
> => #<Method: Object(Kernel)#send>


method's #inspect clearly shows that #send originates from Kernel, but:

$ ri Kernel#send
Nothing known about Kernel#send
$ ri Object#send
(ri page on #send)

Why this kind of confusion? Why not making methods like #send, #kind_of?
and a bunch of others *ACTUALLY* belong to Object, thus making
method.inspect() more accurate in terms of pointing to the proper place
in the documentation?
--
Posted via http://www.ruby-forum.com/.

 
Reply With Quote
 
 
 
 
Rob Biedenharn
Guest
Posts: n/a
 
      02-18-2009
On Feb 18, 2009, at 11:34 AM, Alex Fortuna wrote:
> Hi guys.
>
> There are certain common methods that originate from module Kernel,
> but
> they're documented in class Object.
>
> E.g.
>
>> o = Object.new
>> => #<Object:0xb76826c8>
>> o.method :send
>> => #<Method: Object(Kernel)#send>

>
> method's #inspect clearly shows that #send originates from Kernel,
> but:
>
> $ ri Kernel#send
> Nothing known about Kernel#send
> $ ri Object#send
> (ri page on #send)
>
> Why this kind of confusion? Why not making methods like #send,
> #kind_of?
> and a bunch of others *ACTUALLY* belong to Object, thus making
> method.inspect() more accurate in terms of pointing to the proper
> place
> in the documentation?



Or use a different program for searching the ri docs, like fastri

$ fri Kernel#send
------------------------------------------------------------ Object#send
obj.send(symbol [, args...]) => obj
obj.__send__(symbol [, args...]) => obj
------------------------------------------------------------------------

It even helps with things like:
$ fri send
------------------------------------------------------ Multiple choices:

Net::SSH::Transport::OutgoingPacketStream#send,
Net::SSH::UserAuth:ageant::Socket#send, Object#send,
Resolv:NS::Requester::ConnectedUDP::Sender#send,
Resolv:NS::Requester::TCP::Sender#send,
Resolv:NS::Requester::UnconnectedUDP::Sender#sen d,
SOAP::HTTPStreamHandler#send, UDPSocket#send

http://rubyforge.org/projects/fastri/

-Rob

Rob Biedenharn http://agileconsultingllc.com
http://www.velocityreviews.com/forums/(E-Mail Removed)
+1 513-295-4739
Skype: rob.biedenharn



 
Reply With Quote
 
 
 
 
Rick DeNatale
Guest
Posts: n/a
 
      02-18-2009
[Note: parts of this message were removed to make it a legal post.]

On Wed, Feb 18, 2009 at 12:03 PM, Rob Biedenharn <(E-Mail Removed)
> wrote:


>
>
> Or use a different program for searching the ri docs, like fastri
>
> $ fri Kernel#send
> ------------------------------------------------------------ Object#send
> obj.send(symbol [, args...]) => obj
> obj.__send__(symbol [, args...]) => obj
> ------------------------------------------------------------------------
>
> It even helps with things like:
> $ fri send
> ------------------------------------------------------ Multiple choices:
>
> Net::SSH::Transport::OutgoingPacketStream#send,
> Net::SSH::UserAuth:ageant::Socket#send, Object#send,
> Resolv:NS::Requester::ConnectedUDP::Sender#send,
> Resolv:NS::Requester::TCP::Sender#send,
> Resolv:NS::Requester::UnconnectedUDP::Sender#sen d,
> SOAP::HTTPStreamHandler#send, UDPSocket#send



And as the name implies, it's MUCH faster than ri, unless ri has made
significant progress in that area since I pretty much stopped using it for
fri, or it's alter ego qri

--
Rick DeNatale

Blog: http://talklikeaduck.denhaven2.com/
Twitter: http://twitter.com/RickDeNatale

 
Reply With Quote
 
Alex Fortuna
Guest
Posts: n/a
 
      02-18-2009
Rob,

Well, using alternative ri implementations might be a way out.

However, for me the point isn't me not being able to find where #send is
documented. ri also supports various kinds of listings etc.

The point is trying to figure out why certain methods are documented in
(supposedly) wrong places, and, if possible, find ways to fix that. That
way we'll found a solid base for misc reflection-based doc solutions.

I'm currently writing a hack that relies upon reflection to
automatically find where the documentation is. For Rails & other gems it
works perfectly. For base Ruby -- well, one of the issues is the topic
of this post.
--
Posted via http://www.ruby-forum.com/.

 
Reply With Quote
 
matt neuburg
Guest
Posts: n/a
 
      02-18-2009
Rob Biedenharn <(E-Mail Removed)> wrote:

> On Feb 18, 2009, at 11:34 AM, Alex Fortuna wrote:
> > Hi guys.
> >
> > There are certain common methods that originate from module Kernel,
> > but
> > they're documented in class Object.
> >
> > E.g.
> >
> >> o = Object.new
> >> => #<Object:0xb76826c8>
> >> o.method :send
> >> => #<Method: Object(Kernel)#send>

> >
> > method's #inspect clearly shows that #send originates from Kernel,
> > but:
> >
> > $ ri Kernel#send
> > Nothing known about Kernel#send
> > $ ri Object#send
> > (ri page on #send)
> >
> > Why this kind of confusion? Why not making methods like #send,
> > #kind_of?
> > and a bunch of others *ACTUALLY* belong to Object, thus making
> > method.inspect() more accurate in terms of pointing to the proper
> > place
> > in the documentation?

>
>
> Or use a different program for searching the ri docs, like fastri


Fastri has been broken for months OMM.

$ fri Object
(druby://127.0.0.1:50026) /usr/local/lib/ruby/1.8/yaml.rb:133:in
`transfer': invalid subclass (TypeError)
from (druby://127.0.0.1:50026)
/usr/local/lib/ruby/1.8/yaml.rb:133:in `node_import'
from (druby://127.0.0.1:50026)
/usr/local/lib/ruby/1.8/yaml.rb:133:in `load'
from (druby://127.0.0.1:50026)
/usr/local/lib/ruby/1.8/yaml.rb:133:in `load'
from (druby://127.0.0.1:50026)
/usr/local/lib/ruby/1.8/rdoc/ri/ri_descriptions.rb:72:in `deserialize'
from (druby://127.0.0.1:50026)
/usr/local/lib/ruby/site_ruby/1.8/fastri/ri_index.rb:354:in `get_class'
from (druby://127.0.0.1:50026)
/usr/local/lib/ruby/site_ruby/1.8/fastri/ri_index.rb:354:in `open'
from (druby://127.0.0.1:50026)
/usr/local/lib/ruby/site_ruby/1.8/fastri/ri_index.rb:354:in `get_class'
from (druby://127.0.0.1:50026)
/usr/local/lib/ruby/site_ruby/1.8/fastri/ri_index.rb:352:in `each'
from (druby://127.0.0.1:50026)
/usr/local/lib/ruby/site_ruby/1.8/fastri/ri_index.rb:352:in `get_class'
from (druby://127.0.0.1:50026)
/usr/local/lib/ruby/site_ruby/1.8/fastri/ri_service.rb:209:in `info'
from (druby://127.0.0.1:50026)
/usr/local/lib/ruby/site_ruby/1.8/fastri/ri_service.rb:422:in
`capture_stdout'
from (druby://127.0.0.1:50026)
/usr/local/lib/ruby/site_ruby/1.8/fastri/ri_service.rb:208:in `info'
from /usr/local/bin/fri:342
from /usr/local/bin/fri:337:in `each'
from /usr/local/bin/fri:337

m.

--
matt neuburg, phd = (E-Mail Removed), http://www.tidbits.com/matt/
Leopard - http://www.takecontrolbooks.com/leop...stomizing.html
AppleScript - http://www.amazon.com/gp/product/0596102119
Read TidBITS! It's free and smart. http://www.tidbits.com
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[Power Post 2000] where is it documented? All Things Mopar Computer Support 1 06-23-2005 01:18 PM
[Possibly a FAQ - but one I can't find documented] netspam@shic.co.uk XML 4 05-27-2005 10:04 PM
How can i get the parameternames of a non documented function ? mzo Python 3 02-24-2004 02:55 PM
Where are error messages documented? clintonG ASP .Net 1 02-10-2004 02:49 PM
Will Python exceptions be documented? Vegard Bakke Python 1 07-07-2003 12:24 PM



Advertisments