Skip to content

Instantly share code, notes, and snippets.

@trptcolin
Created March 19, 2012 21:24
Show Gist options
  • Save trptcolin/2127208 to your computer and use it in GitHub Desktop.
Save trptcolin/2127208 to your computer and use it in GitHub Desktop.
Do or do not, there is no try.
# Ruby is *this* close to implementing the Yoda Spec.
module Kernel
def do_not(&block)
end
end
@paytonrules
Copy link

 module Kernel
   def try
     raise NoMethodError.new
   end
 end

@JoshCheek
Copy link

Not sure what the Yoda Spec is, but there is this :)

@trptcolin
Copy link
Author

To belabor the joke, since it sounds like it was too much of a stretch: "do or do_not, there is no try." - Yoda. That's all correct for Ruby except there is no do_not. Fixed!

@trptcolin
Copy link
Author

@JoshCheek: yeah, that's good stuff :)

@paytonrules
Copy link

@JoshCheek I'm not sure about that spec. Is it complete? Sure it's not 42, but what about 41, or 60, or 18?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment