Help! what is going on here?

Discussion in 'Ruby' started by Andrew Walrond, May 5, 2005.

  1. $ cat test.rb
    a = {{"hdparm"=>{"version"=>"5.8"}}=>"uri"}
    puts("A.inspect " + a.inspect)

    key = {'hdparm'=>{'version'=>'5.8'}}
    puts("KEY.inspect " + key.inspect)

    puts("a[key].inspect " + a[key].inspect)

    # For some reason it works after doing this:
    a.each {|key,uri| puts("sprinkle magic dust...") }

    puts("a[key].inspect " + a[key].inspect)

    $ ruby test.rb
    A.inspect {{"hdparm"=>{"version"=>"5.8"}}=>"uri"}
    KEY.inspect {"hdparm"=>{"version"=>"5.8"}}
    a[key].inspect nil
    sprinkle magic dust...
    a[key].inspect "uri"

    $ ruby --version
    ruby 1.8.2 (2004-11-27) [i686-linux]

    I'm going for a coffee!

    Andrew Walrond
    Andrew Walrond, May 5, 2005
    #1
    1. Advertising

  2. On Thursday 05 May 2005 11:41, Andrew Walrond wrote:
    > a.each {|key,uri| puts("sprinkle magic dust...") }


    Ok; the coffee worked. I found the 'key' :)

    Andrew
    Andrew Walrond, May 5, 2005
    #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. Kathy Burke
    Replies:
    6
    Views:
    612
    Munsifali Rashid
    Aug 13, 2003
  2. What Is Going On Here?

    , Jul 13, 2005, in forum: ASP .Net
    Replies:
    4
    Views:
    1,339
    Craig Deelsnyder
    Jul 15, 2005
  3. subnet

    What's going on here?

    subnet, May 4, 2004, in forum: C Programming
    Replies:
    3
    Views:
    350
    CBFalconer
    May 5, 2004
  4. Robert J. Hansen

    mod_python: what's going on here?

    Robert J. Hansen, Sep 5, 2005, in forum: Python
    Replies:
    2
    Views:
    385
    Olivier
    Sep 5, 2005
  5. John Salerno

    what's going on here?

    John Salerno, Mar 16, 2006, in forum: Python
    Replies:
    3
    Views:
    228
    =?ISO-8859-1?Q?Sch=FCle_Daniel?=
    Mar 16, 2006
Loading...

Share This Page