28.01.2015 Views

Hermes: A Tutorial and Reference Manual - Researcher - IBM

Hermes: A Tutorial and Reference Manual - Researcher - IBM

Hermes: A Tutorial and Reference Manual - Researcher - IBM

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

stmemberisanatomwithprintnamematchingZ.Thetestmustbe endfor; ThisprogramfragmentlooksuptheLispvariablewhichisapairwhose inspect end) callLispPrint(LispObject); 11.<strong>Hermes</strong>Operations101<br />

writtenasanexpressioninsidewhere().Toperformthetest,wemustwrite statementwithinanexpression. Exit arevealstatement,soweneedanexpressionblockinordertoenclosethis<br />

hadbeenraised.Ineect,anexitisalocallydenedexceptioncondition. Example: Theexitstatementterminatesexecutionofablockasifanexception blockbegin simple{statement ifX>200000 then exitTooBig; ::=exitexit{name<br />

inablockwhosemainclausecontainstheexitstatement.Ifthereismore thanonesuchh<strong>and</strong>ler,theinnermostoneischosen.(Thisruleisrepeated branchestoah<strong>and</strong>lerforthatexitname.Theh<strong>and</strong>lerchosenmustbe Thestatementincludesanidentierwhichisanexitname.Control onexit(TooBig) endblock;<br />

... endif;<br />

<strong>Hermes</strong>hasvescalartypefamilies:nominal,enumeration,boolean,integer,<strong>and</strong>real.Thescalartypesfamiliesaresimilartoscalartypesinother<br />

11.4ScalarOperations inthediscussionoftheblockstatement.)<br />

inthesefamilies,<strong>and</strong>thendiscussthescalaroperations. ScalarTypeDenitions Anominaldomainisasetofvalueswhichhavenorelationshipotherthan equality.Theyareusedtogeneratedistinctnames|hencethetermnominal.Youcangenerateanew,distinctnominalvaluewiththeuniqueop-<br />

procedurallanguages.Inthissectionwerstdescribehowtodeclaretypes

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!