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.

valueofthetable,ifany,isdiscarded. Theoperationnewcreatesaninitializedbutemptytable.Theprevious literalisanorderedtableofenumerationorbooleanvalues.Eachcharacter StringLiteral Astringliteralisaself-deningcharacterstringvalue.Thetypeofastring 11.<strong>Hermes</strong>Operations109<br />

Concatenate denedasorderedtableofBit. stringofatypewhichincludesvaluesnamed'0'<strong>and</strong>'1'|e.g.atype theenumerationorbooleantype. inthestringliteralmustcorrespondtoasingle-characternamedliteralof Soif"0011010"isusedasastringliteral,itsresolvedtypemustbea<br />

Thisoperationconcatenatestwoorderedtablestoproducearesultcontainingacopyoftheelementsoftheleftoper<strong>and</strong>followedbyacopyofthe<br />

Selector elementsoftherightoper<strong>and</strong>.Theelementsmustbecopyable. concat::=term<br />

selector::=base{variableintable{variable ::=concatjterm<br />

simplyabbreviationsforlongselectors. threesyntacticformspermittedbythesyntax.Therstformiscalled Theselectorisasyntacticconstructusedinseveraloperations.Thereare alongselector,theothersmappingselectors.Themappingselectorsare ::=table{variable[[expression[,expression]...]]<br />

where(selector{expression)<br />

inaselectoriscalledanelementdeclaration.Itdenesanewvariablename Thevariablename(tablevariable)isthenameofatable.Thebasevariable<br />

Thisvariablenameisvisiblewithinthewhereexpression.Theexpression iscalledtheselectorexpression.Itevaluatestoaresultwhichisinferred calledtheelementvariable,whosetypeistheelementtypeofthattable. table.Theelementvariableissetequaltoaconstantcopyoftheelement. Theelementsforwhichtheselectorexpressionaretruearesaidtobe tobeoftypepredefined!boolean. selected. selectors.Ifthemappinglistisempty,thenallelementsareselected|itis Atexecutiontime,theselectorisevaluatedonceforeachelementinthe Amappingselectorisashorth<strong>and</strong>representingsomecommonusesof

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

Saved successfully!

Ooh no, something went wrong!