Loading ...
Sorry, an error occurred while loading the content.
 

Re: [id-ruby] OOT: in Ruby, you can shoot your own feet

Expand Messages
  • Arie Kusuma Atmaja
    ... Subject: Re: irb crash Date: Tue, 9 May 2006 14:55:28 +0900 From: Yukihiro Matsumoto Reply-To: ruby-talk@ruby-lang.org To:
    Message 1 of 7 , Jul 5 7:01 PM
      Yohanes Santoso wrote:
      > Tanpa konteks dimana dia ucapakan itu, susah diketahui apa yang dia
      > maksud.
      >
      > Tetapi pada umumnya, 'you can shoot your own feet' artinya kamu masih
      > bisa melakukan hal2x yang merugikan kamu atau yang kamu tidak
      > harapkan.

      Hi, Yohanes, ini konteks forward dari yang pernah Matz ucapkan dulu:

      -------- Original Message --------
      Subject: Re: irb crash
      Date: Tue, 9 May 2006 14:55:28 +0900
      From: Yukihiro Matsumoto <matz@...>
      Reply-To: ruby-talk@...
      To: ruby-talk@... (ruby-talk ML)

      Hi,

      In message "Re: irb crash"
      on Tue, 9 May 2006 14:36:33 +0900, Elliot Temple <curi@...> writes:

      |I'm new so I don't know if/where I should report this...
      |
      |if I type:
      |
      |String = Hash
      |
      |in irb twice it crashes. it crashed with other stuff besides Hash,
      |too. just doing it twice at once with a semicolon doesn't crash
      |immediately.

      Re-assigning predefined class like String should cause serious
      problems such as you've seen. Ruby allows you to shoot your foot.

      matz.
      > YS.

      kalau dibawah ini saya yang iseng:

      sayang:~ arie$ irb
      Arigatou jyanai! Pizza wa (2) ni-mai, OK!
      Terima kasih boleh2 saja, pizza+hotel_empuk itulah yg lebih dari boleh2 saja
      irb(main):001:0> String = Hash
      (irb):1: warning: already initialized constant String
      => Hash
      irb(main):002:0> String = Hash
      /opt/local/lib/ruby/1.8/irb/ruby-token.rb:101:in `Token': undefined method
      `ancestors' for "=":String (NoMethodError)
      from /opt/local/lib/ruby/1.8/irb/ruby-lex.rb:400:in `lex_init'
      from /opt/local/lib/ruby/1.8/irb/slex.rb:237:in `call'
      from /opt/local/lib/ruby/1.8/irb/slex.rb:237:in `match_io'
      from /opt/local/lib/ruby/1.8/irb/slex.rb:222:in `match_io'
      from /opt/local/lib/ruby/1.8/irb/slex.rb:76:in `match'
      from /opt/local/lib/ruby/1.8/irb/ruby-lex.rb:287:in `token'
      from /opt/local/lib/ruby/1.8/irb/ruby-lex.rb:263:in `lex'
      from /opt/local/lib/ruby/1.8/irb/ruby-lex.rb:234:in
      `each_top_level_statement'
      from /opt/local/lib/ruby/1.8/irb/ruby-lex.rb:230:in `loop'
      from /opt/local/lib/ruby/1.8/irb/ruby-lex.rb:230:in
      `each_top_level_statement'
      from /opt/local/lib/ruby/1.8/irb/ruby-lex.rb:229:in `catch'
      from /opt/local/lib/ruby/1.8/irb/ruby-lex.rb:229:in
      `each_top_level_statement'
      from /opt/local/lib/ruby/1.8/irb.rb:146:in `eval_input'
      from /opt/local/lib/ruby/1.8/irb.rb:70:in `start'
      from /opt/local/lib/ruby/1.8/irb.rb:69:in `catch'
      from /opt/local/lib/ruby/1.8/irb.rb:69:in `start'
      from /opt/local/bin/irb:13
      sayang:~ arie$

      To be clear, I'm not asking you about "Re-assigning predefined class", it's just
      for the "shoot your feet" context clarification.

      --
      r9 = { nama: Arie, nick: ariekeren, ym!: riyari3,
      blog: http://ariekusumaatmaja.wordpress.com,
      myst: http://groups.yahoo.com/groups/id-ruby,
      naruto: 'ochikobore da kara' }
    • Steven Haryanto
      ... pengertiannya adalah sesuatu yang cukup (sangat) powerful (fleksibel) sampe2x kita bisa melakukan banyak hal (apa saja) dengannya, termasuk melukai
      Message 2 of 7 , Sep 19, 2007
        Arie Kusuma Atmaja wrote:
        > Nah!!! jadinya saya penasaran... ada yang bisa menjelaskan idiom bahasa
        > inggris
        > tersebut?

        pengertiannya adalah sesuatu yang cukup (sangat) powerful (fleksibel)
        sampe2x kita bisa melakukan banyak hal (apa saja) dengannya, termasuk
        melukai (merugikan) diri sendiri.

        mungkin waktu zaman idiom ini diciptakan, pistol termasuk sesuatu yang
        cukup baru. sebuah senjata yang, dibanding pisau/pedang, lebih powerful,
        deadly, mudah digunakan. cukup sekali tarik pelatuk, seseorang yang
        lemah fisiknya pun bisa membunuh orang. tentu saja, dia yang
        ceroboh/tidak mengerti cara penggunaannya bisa melukai diri sendiri
        dengan sama mudahnya pula.

        di indo istilah "senjata makan tuan" gak persis ekivalen, tapi mungkin
        dalam sebagian konteks bisa dijadikan padanan.

        gitu kali ya 'ri.

        btw, gw biasanya dulu seringnya liat frase "shoot oneself in the foot"
        sehubungan dengan bahasa pemrograman c. c amat powerful, bisa manage
        memori secara langsung, tapi tentu kita bisa shoot our own foot jika
        menulisi lokasi memori yang salah...

        --
        Mirror CPAN, Debian, Fedora di IIX:
        * http://mirror-id0.masterweb.net/
        * http://mirror-id1.masterweb.net/
        * http://mirror-id2.masterweb.net/
      Your message has been successfully submitted and would be delivered to recipients shortly.