Go! (programming language): Difference between revisions

Content deleted Content added
Per WP:LEDE "Apart from trivial basic facts, significant information should not appear in the lead if it is not covered in the remainder of the article."
Line 37:
 
<div style="text-transform: uppercase;">
<source lang="javascript">
Gender::= male | female.
 
Gender'''::=''' male | female.
person <˜ {dayOfBirth:[]=>day.
age:[]=>integer.
person '''''' {dayOfBirth:[]=>day.
gender:[]=>Gender.
name age:[]=>stringinteger.
home gender:[]=>stringGender.
lives name:[string]{}}=>string.
age home:[]=>integerstring.
 
gender lives:[string]=>Gender{}}.
person:[string,day,Gender,string]$=person.
 
person:[string,day,Gender,string]'''$='''person.
person(Nm,Born,Sx,Hm)..{
dayOfBirth()=>Born.
person(Nm,Born,Sx,Hm)..{
age() => yearsBetween(now(),Born).
gender dayOfBirth()=>SxBorn.
age() => yearsBetween(now(),Born).
name()=>Nm.
home gender()=>HmSx.
lives name(Pl) :- Pl=home()>Nm.
name home()=>NmHm.
yearsBetween:[integer,day]=>integer.
yearsBetween lives(...Pl) =>:- .Pl=home().
yearsBetween:[integer,day]=>integer.
}.
yearsBetween(...) => ..
 
}.
newPerson:[string,day,Gender,string]=>person.
 
newPerson(Nm:[string,Bornday,SxGender,Hm)string]=>$person(Nm,Born,Sx,Hm).
</source>
newPerson(Nm,Born,Sx,Hm)=>$person(Nm,Born,Sx,Hm).
</div>