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.

8.1.2ComponentNames eachhaveacomponentnamedX. havetwodierentcomponentsnamedX,buttwodierentrecordtypescan Componentnamesaredenedinrecord,variant,<strong>and</strong>callmessagetype namespaceforcomponentnames.ThisimpliesthatarecordtypeRcannot denitions.Eachrecord,variant,orcallmessagetypedenitiondenesa 8.Resolution77<br />

resolvedwithinthecomponentnamespaceassociatedwiththevariable's Firstthebasevariableisresolved.Thenthecomponentofavariableis typedenition.Forexample,inthenameX.Y.Z,IrstresolvethenameX. ThenIlookupX'stype.Ilookupthattype'sdenitiontondthename ofX.Ymightnotbevisible,becausethedenitionsmoduledidnotappear whenthetypenameitselfisnotvisible|e.g.intheabovecasethetype theprocesstoobtaintheresolutionofZ.Note:atypemaybeknowneven spacewithinwhichIcanresolveY.IcanthenlookupY'stype,<strong>and</strong>repeat Variablenamescontainingcomponentsareresolvedfromlefttoright.<br />

Typenamesareusedinvariabledeclarations,intypespeciers,<strong>and</strong>indefinitions.Typenamesarewritteneithersimpleidentiers(typeidentiers),<br />

intheusinglist. 8.2TypeNames ortheyaretypeidentiersprecededbyadenitionsmodulename.<br />

tionsmodulewrittenbytheuser,orthepredefinedmodule.Thesetof type{name::=denition{name<br />

names. typedenitionswithinadenitionsmoduleformsanamespace|thatis, twotypedenitionswithinthesamedenitionsmodulemusthavedistinct Typeidentiersaredenedwithinadenitionsmodule|eitheradeni-<br />

::=module{name!denition{name<br />

thoseofthedenitionsmoduleitself,(2)thoseinpredefined,(3)thosein Withinadenitionsmodule,thefollowingtypedenitionsarevisible:(1) ::=identier<br />

ofdenitionsmoduleswhosedenitionswillbemadevisible. denitionsappearingontheimportslist. denitionsofcategories(2)<strong>and</strong>(3)arevisible. isexactlyonevisibledenitionofthattype. Withinanexecutablemodule,therearenotypedenitions,soonlytype Theimportslistappearsattheheaderofeverymodule.Itliststhenames Atypenamenotprecededbyamodulenameislegalif<strong>and</strong>onlyifthere

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

Saved successfully!

Ooh no, something went wrong!