Skip to content

Instantly share code, notes, and snippets.

@disolovyov
Created April 29, 2013 12:30
Show Gist options
  • Save disolovyov/5481329 to your computer and use it in GitHub Desktop.
Save disolovyov/5481329 to your computer and use it in GitHub Desktop.
[29.04.2013 15:05:41] Alexey Buzdin:
assertThat(jonSnow.knows(any(Object.class), is(true)))
AssertionError!
[29.04.2013 15:09:21] Dimitry Solovyov:
class JonSnow {
public <T> boolean knows(T subject) {
return false;
}
}
[29.04.2013 15:10:21] Dimitry Solovyov:
jonSnowKnows :: a -> Bool
jonSnowKnows _ = False
[29.04.2013 15:12:48] Alexey Buzdin:
def knows? (aThing: Any) = this match {
case _: JonSnow => false
case _ => tryToRemember(aThing)
}
[29.04.2013 15:21:21] Dimitry Solovyov:
(defn knows? [this thing]
(condp instance? this
JonSnow false
(try-to-remember thing)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment