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.

incompatiblewiththeinputporttypeoftheinitializationportofthenew<br />

iscreatedisnotaprocessrunningthedesignatedprogram,butinsteadis ageneratorprocess. Theeectofprocedureisidenticaltothatofcreateexceptthatwhat Eachtimethegeneratorprocessiscalled,itconstructsanewinstanceof 11.<strong>Hermes</strong>Operations125<br />

exactlylikethesemanticsofproceduresinAlgol-likelanguages. iscalledprocedureofbecausethesemanticsofgeneratorprocessesis aprocessrunningthedesignatedprogram.Itthensendsthecallmessageit receivedtotheinitializationportofthenewprocess. ofthedesignatedprogram.Theoperationtocreateageneratorprocess callaninputportinthesameprocesswillproduceadeadlock.Acalltoa generatorprocesswillnotdeadlocksinceeachcallgeneratesanewinstance Ordinaryprocessesarenotrecursive,sinceanattemptbyaprocessto<br />

11.9PolymorphOperations Apolymorphisavalueconsistingoftwoparts:(1)awrappedvalue,which PolymorphTypeFamily formaltypestateofthewrappedvalue. thepurposesofassignment<strong>and</strong>comparison.Forexample: canbeofanytype<strong>and</strong>typestate,(2)awrapperdescribingthetype<strong>and</strong> Resource:polymorph; Apolymorphtypedenitiondenesadistinctdomainofpolymorphsfor type{construction<br />

MailItem:polymorph; ::=polymorph<br />

wrappedvaluesofanytype;however,avariableoftypeResourcecannot if<strong>and</strong>onlyifbothwrappers<strong>and</strong>bothwrappedvaluesareequal. Wrap beassignedwithorcomparedtoavariableoftypeMailItem. VariablesoftypeResource<strong>and</strong>variablesoftypeMailItemcancontain Twopolymorphscanbecomparedforequality.Thepolymorphsareequal<br />

containingthesourcevariable'stype<strong>and</strong>formaltypestate,<strong>and</strong>movesthe resultantpolymorphvalueintothepolymorphvariable.Thepolymorph ofthetypestateofthewrappedvalue.Thesourcevariable'stypestatewill Thewrapstatementremovesavaluefromasourcevariable,addsawrapper variableitselfwillhaveatypestateofinitaftertheoperation,regardless simple{statement ::=wrapsource{expressionaspolymorph{variable

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

Saved successfully!

Ooh no, something went wrong!