Ruby interpreter not working

Discussion in 'Ruby' started by Will Dresh, Jan 27, 2009.

  1. Will Dresh

    Will Dresh Guest

    Hello,

    I think this problem will be best explained by simply showing you the
    code first..
    Code:
    class ConfigSettings
    def initiliaze
    puts 'initializing ConfigSettings'
    end
    end
    
    class Dog
    def initialize
    puts 'initiliazing Dog'
    end
    end
    
    dog = Dog.new
    settings = ConfigSettings.new
    I would, of course, expect this to result in two prints to stdout:
    "initializing Dog" and "initializing ConfigSettings". However, when I
    run this program, "initializing ConfigSettings" is never output.

    What in the world is going on?
    --
    Posted via http://www.ruby-forum.com/.
    Will Dresh, Jan 27, 2009
    #1
    1. Advertising

  2. Alle marted=C3=AC 27 gennaio 2009, Will Dresh ha scritto:
    > initiliaze


    Look closer at this.

    Stefano
    Stefano Crocco, Jan 27, 2009
    #2
    1. Advertising

  3. Re: [initialize keyword] Ruby interpreter not working

    Stefano Crocco wrote:
    > Alle martedì 27 gennaio 2009, Will Dresh ha scritto:
    >> initiliaze

    >
    > Look closer at this.
    >
    > Stefano


    I've come across into this mistake several times.
    For non English-speakers I think this is the hardest key word ruby has.
    I think this keyword could be replaced for something easier to spell.

    Does anyone knows any planned change in this regard /?

    Ruby.wishlist+=1

    Novody is perfect.
    -r.
    --
    Posted via http://www.ruby-forum.com/.
    Rodrigo Bermejo, Jan 27, 2009
    #3
  4. Will Dresh

    Tom Cloyd Guest

    Re: [initialize keyword] Ruby interpreter not working

    Rodrigo Bermejo wrote:
    > Stefano Crocco wrote:
    >
    >> Alle martedì 27 gennaio 2009, Will Dresh ha scritto:
    >>
    >>> initiliaze
    >>>

    >> Look closer at this.
    >>
    >> Stefano
    >>

    >
    > I've come across into this mistake several times.
    > For non English-speakers I think this is the hardest key word ruby has.
    > I think this keyword could be replaced for something easier to spell.
    >
    > Does anyone knows any planned change in this regard /?
    >
    > Ruby.wishlist+=1
    >
    > Novody is perfect.
    > -r.
    >

    Actually, English isn't all that easy for us English speakers either. If
    we're going to replace this keyword, why not clean house and replace the
    whole English language? Ever try to spell anything in English? The only
    thing worse I know is French. Personally, I very much prefer Spanish,
    but what do I know?

    Sounds like a great way to start a war...!

    t.

    --

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    Tom Cloyd, MS MA, LMHC - Private practice Psychotherapist
    Bellingham, Washington, U.S.A: (360) 920-1226
    << >> (email)
    << TomCloyd.com >> (website)
    << sleightmind.wordpress.com >> (mental health weblog)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    Tom Cloyd, Jan 27, 2009
    #4
  5. Will Dresh

    Phlip Guest

    Re: [initialize keyword] Ruby interpreter not working

    >>>> initiliaze

    >>> Look closer at this.


    Thank God the Brits have not foisted their phonetically incorrect 'initialise'
    on us!

    Writing initialize too much is a design smell.

    I suspect one could rename it with class Object; alias initialize embiggen ;
    end, or similar.
    Phlip, Jan 27, 2009
    #5
  6. Will Dresh

    Robert Dober Guest

    Re: [initialize keyword] Ruby interpreter not working

    On Tue, Jan 27, 2009 at 10:06 PM, Tom Cloyd <> wrote:
    This is really something ugly, biting me very often. Actually I
    finished to define initialize as a keyword in my ruby mode on vim. And
    if I type
    def initalize ( my favorite misspelling ;) and it is not highlighted I
    get warned immediately (this word is worse than initialize actually).

    Hopefully this idea helps some folk.

    R.
    BTW. English is impossible to write, French is impossible to
    pronounce. Possiamo parlare italiano? (Well actually the logical
    consequence would be to use Esperanto, but that is ***ugly***.


    --
    It is change, continuing change, inevitable change, that is the
    dominant factor in society today. No sensible decision can be made any
    longer without taking into account not only the world as it is, but
    the world as it will be ... ~ Isaac Asimov
    Robert Dober, Jan 28, 2009
    #6
  7. Will Dresh

    Tim Greer Guest

    Re: [initialize keyword] Ruby interpreter not working

    Rodrigo Bermejo wrote:

    > I've come across into this mistake several times.
    > For non English-speakers I think this is the hardest key word ruby
    > has. I think this keyword could be replaced for something easier to
    > spell.
    >
    > Does anyone knows any planned change in this regard /?
    >
    > Ruby.wishlist+=1
    >
    > Novody is perfect.
    > -r.


    I don't suspect there are many languages that would create aliases by
    default in an effort to prevent typos, but you could probably create
    your own. I'd prefer no one forced that logic on me, just in case I
    want to use a variable that's closely named like a reserved
    word/function, only to find out that it's now a reserved word.
    --
    Tim Greer, CEO/Founder/CTO, BurlyHost.com, Inc.
    Shared Hosting, Reseller Hosting, Dedicated & Semi-Dedicated servers
    and Custom Hosting. 24/7 support, 30 day guarantee, secure servers.
    Industry's most experienced staff! -- Web Hosting With Muscle!
    Tim Greer, Jan 28, 2009
    #7
  8. Re: [initialize keyword] Ruby interpreter not working

    Rodrigo Bermejo wrote:
    > Stefano Crocco wrote:
    >> Alle martedì 27 gennaio 2009, Will Dresh ha scritto:
    >>> initiliaze

    >> Look closer at this.
    >>
    >> Stefano

    >
    > I've come across into this mistake several times.
    > For non English-speakers I think this is the hardest key word ruby has.
    > I think this keyword could be replaced for something easier to spell.
    >
    > Does anyone knows any planned change in this regard /?
    >
    > Ruby.wishlist+=1


    Sure, how about we name it __init__

    - Charlie
    Charles Oliver Nutter, Jan 28, 2009
    #8
  9. Re: [initialize keyword] Ruby interpreter not working

    [Note: parts of this message were removed to make it a legal post.]

    On Wed, Jan 28, 2009 at 5:06 AM, Robert Dober <>wrote:

    > On Tue, Jan 27, 2009 at 10:06 PM, Tom Cloyd <> wrote:
    > This is really something ugly, biting me very often. Actually I
    > finished to define initialize as a keyword in my ruby mode on vim. And
    > if I type
    > def initalize ( my favorite misspelling ;) and it is not highlighted I
    > get warned immediately (this word is worse than initialize actually).
    >
    > Hopefully this idea helps some folk.
    >


    Nice.

    I use gedit with the snippets[1] plugin. I set up a "defi" tap trigger so
    that whenever I write "defi" and hit Tab, "def initialize end" will be
    inserted automatically. This way, I don't have to worry about misspelling
    "initialize" - which I did while writing this response! Can't live without a
    spell checker! :)

    Regards,
    Yaser

    [1]: http://live.gnome.org/Gedit/Plugins/Snippets
    Yaser Sulaiman, Jan 28, 2009
    #9
  10. Re: [initialize keyword] Ruby interpreter not working

    On Wed, Jan 28, 2009 at 2:47 AM, Phlip <> wrote:
    >>>>> initiliaze

    >
    >>>> Look closer at this.

    >
    > Thank God the Brits have not foisted their phonetically incorrect
    > 'initialise' on us!


    I must admit, I did that one a lot when I was learning Ruby. `init`
    would be nice :)

    martin
    Martin DeMello, Jan 28, 2009
    #10
  11. Will Dresh

    Robert Dober Guest

    Re: [initialize keyword] Ruby interpreter not working

    > I use gedit with the snippets[1] plugin. I set up a "defi" tap trigger so
    > that whenever I write "defi" and hit Tab, "def initialize end" will be
    > inserted automatically. This way, I don't have to worry about misspelling
    > "initialize" - which I did while writing this response! Can't live without a
    > spell checker! :)
    >
    > Regards,
    > Yaser
    >
    > [1]: http://live.gnome.org/Gedit/Plugins/Snippets
    >

    That seems a good idea too. I guess it is important to let each tool
    do its work. Editors are here to help us with spelling, alias_method
    is not.
    +1 for Charlie's idea however ;).
    R.


    --
    It is change, continuing change, inevitable change, that is the
    dominant factor in society today. No sensible decision can be made any
    longer without taking into account not only the world as it is, but
    the world as it will be ... ~ Isaac Asimov
    Robert Dober, Jan 28, 2009
    #11
  12. I think Charles was being ironic , making fun of the python guys . It's
    enough that perl copied the python object model ( and Larry regrets that
    even today ) ... let's not do the same mistake again .
    --
    Posted via http://www.ruby-forum.com/.
    Tsunami Script, Jan 28, 2009
    #12
  13. Will Dresh

    Robert Dober Guest

    And I felt actually bad, adding the smiley, just to discover it was
    not even enough.

    I do not think that Perl copied Python's object model. When I talked
    to Larry last time he said that he had copied Ruby's object model. The
    last sentence is true, believe me.

    Cheers
    Robert


    --
    It is change, continuing change, inevitable change, that is the
    dominant factor in society today. No sensible decision can be made any
    longer without taking into account not only the world as it is, but
    the world as it will be ... ~ Isaac Asimov
    Robert Dober, Jan 28, 2009
    #13
  14. Robert Dober wrote:
    > And I felt actually bad, adding the smiley, just to discover it was
    > not even enough.
    >
    > I do not think that Perl copied Python's object model. When I talked
    > to Larry last time he said that he had copied Ruby's object model. The
    > last sentence is true, believe me.
    >
    > Cheers
    > Robert


    def new ...would be the "least surprise way" of doing it.
    But I suspect there should be a good reason for not doing that.

    Would be cool to have some kind of magic file where you could alias the
    ruby key words (maybe able to recompile the interpreter with these new
    alias) to any word/language you want.

    define inicializando
    pon "giiaaacc"
    final



    -r.
    --
    Posted via http://www.ruby-forum.com/.
    Rodrigo Bermejo, Jan 28, 2009
    #14
    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. Replies:
    3
    Views:
    758
    Ziga Seilnacht
    Jan 3, 2007
  2. Replies:
    4
    Views:
    182
    Erik Hollensbe
    May 2, 2006
  3. cies
    Replies:
    1
    Views:
    92
    Dominik Bathon
    Oct 24, 2006
  4. Ranieri Teixeira
    Replies:
    21
    Views:
    416
    phlip
    Jul 14, 2008
  5. Eelco
    Replies:
    12
    Views:
    259
    John Carter
    Feb 11, 2009
Loading...

Share This Page