Go! (programming language): Difference between revisions

Content deleted Content added
remove <syntaxhighlight lang="go"> because this is not google's go
Reverted to revision 659165662 by Codename Lisa (talk): Need to use syntaxhightlighting or source. (TW)
Line 35:
The following example illustrates the "ontology-oriented" type and declarations style of Go!:<ref name=applied />
 
<syntaxhighlight lang="go">
Gender '''::=''' male | female.
person '''<˜''' {dayOfBirth:[]=>day.
Line 44 ⟶ 45:
lives:[string]{}}.
person:[string,day,Gender,string] '''$=''' person.
person(Nm,Born,Sx,Hm)..{
Line 60 ⟶ 61:
newPerson(Nm,Born,Sx,Hm)=>$person(Nm,Born,Sx,Hm).
</syntaxhighlight>
 
The <code>::=</code> rule defines a new [[algebraic data type]], a [[data type]] with only data constructors.