where is instance_eval() defined?

Discussion in 'Ruby' started by 7stud --, May 18, 2011.

  1. 7stud --

    7stud -- Guest

    Where in the hell is instance_eval() defined? In "The Ruby Programming
    Language", it says it's defined in Object, but the 1.9.2 docs don't list
    it in Object:

    http://www.ruby-doc.org/core/classes/Object.html

    Nor is it listed in BasicObjec, Kernel, Module, or Class:

    http://www.ruby-doc.org/core-1.9/classes/BasicObject.html
    http://www.ruby-doc.org/core/classes/Kernel.html
    http://ruby-doc.org/core/classes/Module.html
    http://www.ruby-doc.org/core/classes/Class.html

    --
    Posted via http://www.ruby-forum.com/.
     
    7stud --, May 18, 2011
    #1
    1. Advertising

  2. On Wed, May 18, 2011 at 11:10 PM, 7stud -- <> wrote:
    > Where in the hell is instance_eval() defined? =A0In "The Ruby Programming
    > Language", it says it's defined in Object, but the 1.9.2 docs don't list
    > it in Object:


    irb --simple-prompt
    >> require "pp"
    >> pp Object.methods.sort


    --=20
    Phillip Gawlowski

    Though the folk I have met,
    (Ah, how soon!) they forget
    When I've moved on to some other place,
    There may be one or two,
    When I've played and passed through,
    Who'll remember my song or my face.
     
    Phillip Gawlowski, May 18, 2011
    #2
    1. Advertising

  3. 7stud --

    Su Zhang Guest

    7stud -- wrote in post #999537:
    > Nor is it listed in BasicObjec


    p RUBY_VERSION # => "1.9.2"
    p BasicObject.public_instance_methods.grep(/eval/) # => [:instance_eval]

    and in vm_eval.c:

    rb_define_method(rb_cBasicObject, "instance_eval", rb_obj_instance_eval,
    -1);

    --
    Posted via http://www.ruby-forum.com/.
     
    Su Zhang, May 19, 2011
    #3
  4. 7stud --

    7stud -- Guest

    Thanks. Does anyone want to fix that in the 1.9.2 docs?

    Also, I can never find the methods() method anywhere. Module?
    BasicObject?

    --
    Posted via http://www.ruby-forum.com/.
     
    7stud --, May 19, 2011
    #4
  5. 7stud --

    John Mair Guest

    John Mair, May 21, 2011
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Oodini
    Replies:
    1
    Views:
    1,795
    Keith Thompson
    Sep 27, 2005
  2. Replies:
    1
    Views:
    103
    Mauricio Fernández
    Jul 17, 2003
  3. Tim Bates

    instance_eval and Class Variables

    Tim Bates, Aug 6, 2003, in forum: Ruby
    Replies:
    0
    Views:
    114
    Tim Bates
    Aug 6, 2003
  4. Aron Griffis

    instance_eval and constants

    Aron Griffis, Feb 24, 2004, in forum: Ruby
    Replies:
    2
    Views:
    93
    Aron Griffis
    Feb 24, 2004
  5. Joel VanderWerf

    instance_eval from C ext

    Joel VanderWerf, Apr 26, 2004, in forum: Ruby
    Replies:
    3
    Views:
    195
    Joel VanderWerf
    May 3, 2004
Loading...

Share This Page