#scala
The constructor parameters of case classes are treated as public values and can be accessed directly.
val x = Var("x")
println(x.name)
If you want to change selection, open document below and click on "Move attachment"
Case Classes - Scala Documentationction 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"))))
<span>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 compiler generates an equals method which implements structural equality and a toString method. For instance:
val x1 = Var("x")
val x2 = Var(&qu Summary
status | not read | | reprioritisations | |
---|
last reprioritisation on | | | suggested re-reading day | |
---|
started reading on | | | finished reading on | |
---|
Details