Syntax: Data Types
A fundamental data
object in Coconut is declared as follows:
data [name]([args]) [from "inherits"]:
[body]
where
-
[name]
: the name of your new data type -
[args]
: the arguments for the constructor and the names of the attributes -
[from "inherits"]
: (optional) other base classes to inherit from -
[body]
: the data type's methods