Skip to content

Instantly share code, notes, and snippets.

@hassox
Forked from ryan-allen/first-big-wtf-in-months.rb
Created September 2, 2010 06:33
Show Gist options
  • Select an option

  • Save hassox/561960 to your computer and use it in GitHub Desktop.

Select an option

Save hassox/561960 to your computer and use it in GitHub Desktop.

Revisions

  1. hassox revised this gist Sep 2, 2010. 1 changed file with 6 additions and 5 deletions.
    11 changes: 6 additions & 5 deletions first-big-wtf-in-months.rb
    Original file line number Diff line number Diff line change
    @@ -1,10 +1,11 @@
    a = lambda {
    b.call()
    }

    b = lambda {
    :IMA_B_LOL
    }

    # A must enclose B
    a = lambda {
    b.call()
    }

    b.call() # raises nothing
    a.call() # raises NameError: undefined local variable or method ‘b’ for main:Object ... WTF!
    a.call() # raises Nothing
  2. @ryan-allen ryan-allen created this gist Sep 2, 2010.
    10 changes: 10 additions & 0 deletions first-big-wtf-in-months.rb
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,10 @@
    a = lambda {
    b.call()
    }

    b = lambda {
    :IMA_B_LOL
    }

    b.call() # raises nothing
    a.call() # raises NameError: undefined local variable or method ‘b’ for main:Object ... WTF!