Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@heathermiller
heathermiller / scala-cheatsheet.md
Last active February 11, 2024 15:56
Scala Cheatsheet

This cheat sheet originated from the forum, credits to Laurent Poulain. We copied it and changed or added a few things.

Evaluation Rules

  • Call by value: evaluates the function arguments before calling the function
  • Call by name: evaluates the function first, and then evaluates the arguments if need be
    def example = 2      // evaluated when called
    val example = 2      // evaluated immediately