Skip to content

Instantly share code, notes, and snippets.

@whytrall
Created January 10, 2022 09:23
Show Gist options
  • Save whytrall/6c5904d00c3c4d090bee2b2dcefee8d0 to your computer and use it in GitHub Desktop.
Save whytrall/6c5904d00c3c4d090bee2b2dcefee8d0 to your computer and use it in GitHub Desktop.
import RickRoll.writer
object RickRoll { var writer: (String) -> Unit = { println(it) } }
val Never = RickAstleyNever // to get different highlighting color
object RickAstleyNever {
infix fun gonna(x: give) = give
infix fun gonna(x: let) = let
infix fun gonna(x: run) = run
infix fun gonna(x: make) = make
infix fun gonna(x: say) = say
infix fun gonna(x: tell) = tell
}
object give { infix fun you(x: up) = Unit }
object let { infix fun you(x: down) = Unit }
object make { infix fun you(x: cry) = Unit }
object say { infix fun goodbye(x: RickAstleyNever) = Never.apply { writer("Never gonna say goodbye") } }
object tell { infix fun a(x: lie) = lie }
object lie { infix fun and(x: hurt) = hurt }
object hurt { infix fun you(x: YouHaveBeenRickRolled) { writer("Never gonna tell a lie and hurt you") } }
object cry { init { writer("Never gonna make you cry") } }
object up { init { writer("Never gonna give you up") } }
object down { init { writer("Never gonna let you down") } }
object run { infix fun around(x: and) = and }
object you { init { writer("Never gonna run around and desert you") } }
object and { infix fun desert(x: you) {} }
object YouHaveBeenRickRolled
val dQw4w9WgXcQ = YouHaveBeenRickRolled
@sureshg
Copy link

sureshg commented Jan 11, 2022

❤️

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