Hermes: A Tutorial and Reference Manual - Researcher - IBM
Hermes: A Tutorial and Reference Manual - Researcher - IBM
Hermes: A Tutorial and Reference Manual - Researcher - IBM
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
isdiscarded. Merge,Merge-At 11211.6.TableOperations mentsareremovedfromthetablenamedintheselector,<strong>and</strong>movedinto thedestinationtable.Ifnoelementsareselected,thedestinationtableis initializedtoanemptytable.Thepreviousvalue,ifany,ofthedestination<br />
thesourcevariablewillbeuninitialized.Ifthetableisordered,theelements(ifany)fromthesourcetablewillbeinsertedattheendofthe<br />
elementswillbeofthesametype<strong>and</strong>typestate.Onnormalcompletion, tinationtable.Thetwotablesareofthesametype|meaningthatthe Themergestatementmovesthecontentsofthesourcetableintothedes-<br />
simple{statement<br />
destinationtable,<strong>and</strong>theirorderwillbepreserved.Ifthetableiskeyed, ::=mergetable{expressionintotable{variable<br />
theDuplicateKeyexceptionisraisedifthemergewouldhaveviolatedthe [atposition{expression]<br />
requirementofuniquekeys.<br />
asformerge,exceptthataRangeErrorexceptiontakesprecedence. whichspecieswheretoinsertthesourcetableelements.Ifthisposition actlylikemerge,exceptithasanadditionaloper<strong>and</strong>oftypepredefined!integer ceptionRangeErrorisraised.Otherwisetheelementsareinsertedatthe designatedposition.Thepositionsofearlierelementsinthetableremain thesame.Thepositionsoflaterelements(ifany)areincreasedbythenumberofelementsmerged.TheexceptionDuplicateKeycanberaisedexactly<br />
isnegative,orgreaterthanthenumberofelementsinthetable,theex-<br />
Themerge-atstatementislegalonlyfororderedtables.Itbehavesex-<br />
table.Thiscopyisstoredintoanewvariable{theinspectvariablehaving Inspect-table Thisstatementmakesaconstantcopyofthechosenselectedelementofa thesamenameastheelementvariableoftheselector.Theinspectvariable isautomaticallydeclaredtobeoftheelementtypeofthetable,<strong>and</strong>tohave compound{statement<br />
ascopeincludingtheclausewithinthebodyoftheinspectstatement.If ::=inspectselectorbegin<br />
thereisnoselectedelement,theNotFoundexceptionisraised. endinspect [statement;]...<br />
be\dangerous"(receive,return)whenperformedonordinarycopiesare aconstantcopyofanyvalue.Thisisbecausetheoperationswhichwould sages,inputports,orvaluescontainingthem),itisalwayslegaltomake Whereasitisillegaltomakeordinarycopiesofcertainvalues(callmes-