News for hackers. Stuff that matters.
Re:G()('al') by morganhankins on Sunday July 27, 2014 @05:20AM (#8092326)

  # goal.rb
  module G
    def [](o=nil)
      o ? "g#{values[0].to_s}al" : ({ :n => values[0].to_s + "o" }.extend G)
    end
  end

  g = {}.extend G
  
  eval DATA.read.gsub("(", "[").gsub(")", "]")
  
__END__

  gal = g('al')
  p gal
  
  goal = g()('al')
  p goal

  goooooooal = g()()()()()()()('al')
  p goooooooal
  
  # ruby goal.rb
  # "gal"
  # "goal"
  # "goooooooal"

# https://gist.github.com/morganhankins/de13ee378907143a7789

There are no comments on this comment yet.