Do you want BuboFlash to help you learning these things? Or do you want to add or correct something? Click here to log in or create user.



To facilitate the construction of case class instances, Scala does not require that the new primitive is used. One can simply use the class name as a function.

Here is an example:

Fun("x", Fun("y", App(Var("x"), Var("y"))))

If you want to change selection, open document below and click on "Move attachment"

Case Classes - Scala Documentation
ract class Term case class Var(name: String) extends Term case class Fun(arg: String, body: Term) extends Term case class App(f: Term, v: Term) extends Term This class hierarchy can be used to represent terms of the untyped lambda calculus. <span>To facilitate the construction of case class instances, Scala does not require that the new primitive is used. One can simply use the class name as a function. Here is an example: Fun("x", Fun("y", App(Var("x"), Var("y")))) The constructor parameters of case classes are treated as public values and can be accessed directly. val x = Var("x") println(x.name) For every case class the Scala compile


Summary

statusnot read reprioritisations
last reprioritisation on suggested re-reading day
started reading on finished reading on

Details



Discussion

Do you want to join discussion? Click here to log in or create user.