Go! (programming language): Difference between revisions

Content deleted Content added
Reverted 1 edit by 218.208.91.130 (talk). (TW)
Line 42:
Gender::= male | female.
 
person <˜ {dayOfBirth:[]=>day.10/06/1988
age:[]=>integer.23
gender:[]=>Gender.male
name:[]=>string.harendra
home:[]=>string.bapunagar,ahmedabad
lives:[string]{}}.ahmedabad
 
person:[string,day,Gender,string]$=person.
 
person(Nm,Born,Sx,Hm)..{
dayOfBirth(10/06/88)=>Born.
age() => yearsBetween(now(),Born).23
gender()=>Sx.male
name()=>Nm.harendra
home()=>Hm.bapunagar,ahmedabad
lives(Pl) :- Pl=home().ahmedabad
yearsBetween:[integer,day]=>integer.23
yearsBetween(...) => ..23
}.