Skip to content

Instantly share code, notes, and snippets.

View waterlink's full-sized avatar

Alex Fedorov waterlink

View GitHub Profile
fun main() {
println("Hello World")
}
fun main(args: Array<String>) {
print("What is your name? > ")
val name = readLine()
print("Hello, ")
print(name)
println("! How are things going?")
}
print("Hello, ")
print(name)
println("! How are things going?")
print("What is your name? > ")
val name = readLine()
fun main(args: Array<String>) {
print("Hello, ")
print(args[0])
println("! How are things going?")
}
fun main(args: Array<String>) {
… your program here …
}
fun main(args: Array<String>) {
println("Hello World")
}
class Try(private val block: () -> Unit,
private val catchHandler: ((Exception) -> Unit)?)
: () -> Unit {
constructor(block: () -> Unit): this(block, null) {}
fun whenThrown(catchHandler: (Exception) -> Unit): Try {
return Try(this, catchHandler)
}
fun main(args: Array<String>) {
println("Hello, Kotlin!")
}
@waterlink
waterlink / hierarchical.cljs
Last active February 1, 2017 01:59
Reagent with Redux?
;; My idea of hierarchical Redux
;; ------------
;; reducers
;; reducers for todos (todo list)
(defmulti todos-reducer (fn [state ty data] ty))
(defmethod todos-reducer :todo-add [state ty {:keys [title done]}]
(let [state (update-in state [:counter] inc)