Guest User

Untitled

a guest
May 23rd, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. implicit def trailingConditionals[T](any: => T) = new {
  2. def provided(expr: Boolean) = if (expr) Some(any) else None
  3. def unless(expr: Boolean) = if (!expr) Some(any) else None
  4. }
  5.  
  6. implicit def verbosePlus(i: Int) = new {
  7. def plus(j: Int): Int = {
  8. println("Adding " + i + " and " + j);
  9. i + j
  10. }
  11. }
Add Comment
Please, Sign In to add comment