Why use __FILE_, __LINE__ in class_eval?

Discussion in 'Ruby' started by Ben Johnson, Sep 5, 2008.

  1. Ben Johnson

    Ben Johnson Guest

    I've noticed in code that some people do:

    class_eval src

    amd some do

    class_eval src, __FILE__, __LINE__

    What exactly is the difference and why should I use one over the other?

    Thanks for your help.
    --
    Posted via http://www.ruby-forum.com/.
    Ben Johnson, Sep 5, 2008
    #1
    1. Advertising

  2. Ben Johnson

    ara.t.howard Guest

    On Sep 5, 2008, at 9:48 AM, Ben Johnson wrote:

    > I've noticed in code that some people do:
    >
    > class_eval src
    >
    > amd some do
    >
    > class_eval src, __FILE__, __LINE__
    >
    > What exactly is the difference and why should I use one over the
    > other?
    >
    > Thanks for your help.


    raise an error inside the eva'd code and see

    a @ http://codeforpeople.com/
    --
    we can deny everything, except that we have the possibility of being
    better. simply reflect on that.
    h.h. the 14th dalai lama
    ara.t.howard, Sep 5, 2008
    #2
    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. Mr. SweatyFinger
    Replies:
    2
    Views:
    1,735
    Smokey Grindel
    Dec 2, 2006
  2. Replies:
    5
    Views:
    318
    Keith Thompson
    Mar 12, 2005
  3. Generic Usenet Account

    stringification of __LINE__: why two passes?

    Generic Usenet Account, Oct 18, 2006, in forum: C Programming
    Replies:
    5
    Views:
    413
  4. Generic Usenet Account

    stringification of __LINE__: why two passes?

    Generic Usenet Account, Oct 18, 2006, in forum: C++
    Replies:
    5
    Views:
    370
  5. Han Holl

    if __FILE_ == $0 executed twice

    Han Holl, May 24, 2005, in forum: Ruby
    Replies:
    19
    Views:
    165
    Michal Suchanek
    May 26, 2005
Loading...

Share This Page