Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Kotlinってこんな言語 #jkug

Kotlinってこんな言語 #jkug

Kotlin言語について、その特徴とサードパーティ製ライブラリの簡単な紹介。

Taro Nagasawa

July 26, 2013
Tweet

More Decks by Taro Nagasawa

Other Decks in Programming

Transcript

  1. ߴ֊ؔ਺/ϥϜμࣜ (1..999).filter { it % 3 == 0 || it

    % 5 == 0 }.reduce { sum, e -> sum + e }
  2. Ϋϥε class Person( val name: String, val age: Int =

    20 ) ίϯετϥΫλ ϓϩύςΟ σϑΥϧτ஋
  3. class IndexView(val task: Task = Task()): HtmlView() { override fun

    render(context: ActionContext) { h2("λεΫͷొ࿥") formFor(task, "/task".link(), FormMethod.post) { p { labelFor("title", "໊݅") textFieldFor("title") } p { labelFor("content", "಺༰") textAreaFor("content") } p { input(inputType = InputType.submit, value = "ొ࿥") } } } }
  4. public class calculatorSpecs : JUnitSpec() {{ given("a calculator") { val

    calculator = Calculator() on("calling sum with two numbers") { val sum = calculator.sum(2, 4) it("should return the result of adding the first number to the second number") { shouldEqual(6, sum) } } } }} https://github.com/hhariri/spekΑΓҾ༻