Content deleted Content added
m Make disambig link more explanatory |
Cybercobra (talk | contribs) m →Example |
||
Line 35:
== Example ==
{{Unreferenced section|date=July 2010}}
The following example illustrates the 'ontology-oriented' type and declarations style of Go!
<source lang="javascript">
Gender::= male | female.
Line 55 ⟶ 54:
newPerson:[string,day,Gender,string]=>person.
newPerson(Nm,Born,Sx,Hm)=>$person(Nm,Born,Sx,Hm).
</source>
The <code>::=</code> rule defines a new [[algebraic data type]], a [[data type]] with only data constructors.
|