1 // Copyright (c) 1996 James Clark
2 // See the file copying.txt for copying permission.
4 PRIMITIVE(Cons, "cons", 2, 0, 0)
5 PRIMITIVE(List, "list", 0, 0, 1)
6 PRIMITIVE(IsNull, "null?", 1, 0, 0)
7 PRIMITIVE(IsList, "list?", 1, 0, 0)
8 PRIMITIVE(IsPair, "pair?", 1, 0, 0)
9 PRIMITIVE(IsEqual, "equal?", 2, 0, 0)
10 PRIMITIVE(Car, "car", 1, 0, 0)
11 PRIMITIVE(Cdr, "cdr", 1, 0, 0)
12 PRIMITIVE(Length, "length", 1, 0, 0)
13 PRIMITIVE(Append, "append", 0, 0, 1)
14 PRIMITIVE(Reverse, "reverse", 1, 0, 0)
15 PRIMITIVE(ListTail, "list-tail", 2, 0, 0)
16 PRIMITIVE(ListRef, "list-ref", 2, 0, 0)
17 PRIMITIVE(Member, "member", 2, 0, 0)
18 PRIMITIVE(Not, "not", 1, 0, 0)
19 PRIMITIVE(IsSymbol, "symbol?", 1, 0, 0)
20 PRIMITIVE(IsKeyword, "keyword?", 1, 0, 0)
21 PRIMITIVE(IsBoolean, "boolean?", 1, 0, 0)
22 PRIMITIVE(IsProcedure, "procedure?", 1, 0, 0)
23 PRIMITIVE(IsString, "string?", 1, 0, 0)
24 PRIMITIVE(IsInteger, "integer?", 1, 0, 0)
25 PRIMITIVE(IsReal, "real?", 1, 0, 0)
26 PRIMITIVE(IsNumber, "number?", 1, 0, 0)
27 PRIMITIVE(IsQuantity, "quantity?", 1, 0, 0)
28 PRIMITIVE(IsChar, "char?", 1, 0, 0)
29 PRIMITIVE(IsCharEqual, "char=?", 2, 0, 0)
30 PRIMITIVE(String, "string", 0, 0, 1)
31 PRIMITIVE(SymbolToString, "symbol->string", 1, 0, 0)
32 PRIMITIVE(StringToSymbol, "string->symbol", 1, 0, 0)
33 PRIMITIVE(StringLength, "string-length", 1, 0, 0)
34 PRIMITIVE(IsStringEqual, "string=?", 2, 0, 0)
35 PRIMITIVE(StringAppend, "string-append", 0, 0, 1)
36 PRIMITIVE(StringRef, "string-ref", 2, 0, 0)
37 PRIMITIVE(Substring, "substring", 3, 0, 0)
38 PRIMITIVE(Equal, "=", 0, 0, 1)
39 PRIMITIVE(Plus, "+", 0, 0, 1)
40 PRIMITIVE(Minus, "-", 1, 0, 1)
41 PRIMITIVE(Multiply, "*", 0, 0, 1)
42 PRIMITIVE(Divide, "/", 1, 0, 1)
43 PRIMITIVE(Quotient, "quotient", 2, 0, 0)
44 PRIMITIVE(Remainder, "remainder", 2, 0, 0)
45 PRIMITIVE(Modulo, "modulo", 2, 0, 0)
46 PRIMITIVE(Less, "<", 0, 0, 1)
47 PRIMITIVE(Greater, ">", 0, 0, 1)
48 PRIMITIVE(LessEqual, "<=", 0, 0, 1)
49 PRIMITIVE(GreaterEqual, ">=", 0, 0, 1)
50 PRIMITIVE(Min, "min", 1, 0, 1)
51 PRIMITIVE(Max, "max", 1, 0, 1)
52 PRIMITIVE(Floor, "floor", 1, 0, 0)
53 PRIMITIVE(Ceiling, "ceiling", 1, 0, 0)
54 PRIMITIVE(Truncate, "truncate", 1, 0, 0)
55 PRIMITIVE(Round, "round", 1, 0, 0)
56 PRIMITIVE(Abs, "abs", 1, 0, 0)
57 PRIMITIVE(Sqrt, "sqrt", 1, 0, 0)
58 PRIMITIVE(Time, "time", 0, 0, 0)
59 PRIMITIVE(TimeToString, "time->string", 1, 1, 0)
60 PRIMITIVE(CharProperty, "char-property", 2, 1, 0)
61 PRIMITIVE(Literal, "literal", 0, 0, 1)
62 PRIMITIVE(ProcessChildren, "process-children", 0, 0, 0)
63 PRIMITIVE(ProcessChildrenTrim, "process-children-trim", 0, 0, 0)
64 PRIMITIVE(SosofoAppend, "sosofo-append", 0, 0, 1)
65 PRIMITIVE(NextMatch, "next-match", 0, 1, 0)
66 PRIMITIVE(EmptySosofo, "empty-sosofo", 0, 0, 0)
67 PRIMITIVE(SosofoLabel, "sosofo-label", 2, 0, 0)
68 PRIMITIVE(SosofoDiscardLabeled, "sosofo-discard-labeled", 2, 0, 0)
69 PRIMITIVE(IsSosofo, "sosofo?", 1, 0, 0)
70 PRIMITIVE(IsStyle, "style?", 1, 0, 0)
71 PRIMITIVE(MergeStyle, "merge-style", 0, 0, 1)
72 PRIMITIVE(ProcessElementWithId, "process-element-with-id", 1, 0, 0)
73 PRIMITIVE(ProcessFirstDescendant, "process-first-descendant", 0, 0, 1)
74 PRIMITIVE(ProcessMatchingChildren, "process-matching-children", 0, 0, 1)
75 PRIMITIVE(ProcessNodeList, "process-node-list", 1, 0, 0)
76 PRIMITIVE(CurrentNodePageNumberSosofo, "current-node-page-number-sosofo",
78 PRIMITIVE(PageNumberSosofo, "page-number-sosofo", 0, 0, 0)
79 PRIMITIVE(FormatNumber, "format-number", 2, 0, 0)
80 PRIMITIVE(FormatNumberList, "format-number-list", 3, 0, 0)
81 PRIMITIVE(Error, "error", 1, 0, 0)
82 PRIMITIVE(ExternalProcedure, "external-procedure", 1, 0, 0)
83 PRIMITIVE(StringToNumber, "string->number", 1, 1, 0)
84 PRIMITIVE(NumberToString, "number->string", 1, 1, 0)
85 PRIMITIVE(DisplaySize, "display-size", 0, 0, 0)
86 PRIMITIVE(TableUnit, "table-unit", 1, 0, 0)
87 PRIMITIVE(IsDisplaySpace, "display-space?", 1, 0, 0)
88 PRIMITIVE(DisplaySpace, "display-space", 1, 0, 1)
89 PRIMITIVE(IsInlineSpace, "inline-space?", 1, 0, 0)
90 PRIMITIVE(InlineSpace, "inline-space", 1, 0, 1)
91 PRIMITIVE(IsColor, "color?", 1, 0, 0)
92 PRIMITIVE(IsColorSpace, "color-space?", 1, 0, 0)
93 PRIMITIVE(Color, "color", 1, 0, 1)
94 PRIMITIVE(ColorSpace, "color-space", 1, 0, 1)
95 PRIMITIVE(IsAddress, "address?", 1, 0, 0)
96 PRIMITIVE(IsAddressLocal, "address-local?", 1, 0, 0)
97 PRIMITIVE(IsAddressVisited, "address-visited?", 1, 0, 0)
98 PRIMITIVE(CurrentNodeAddress, "current-node-address", 0, 0, 0)
99 PRIMITIVE(IdrefAddress, "idref-address", 1, 0, 0)
100 PRIMITIVE(EntityAddress, "entity-address", 1, 0, 0)
101 PRIMITIVE(SgmlDocumentAddress, "sgml-document-address", 2, 0, 0)
102 PRIMITIVE(NodeListAddress, "node-list-address", 1, 0, 0)
103 PRIMITIVE(HytimeLinkend, "hytime-linkend", 0, 0, 0)
104 PRIMITIVE(CharScriptCase, "char-script-case", 1, 0, 1)
105 PRIMITIVE(IsGlyphId, "glyph-id?", 1, 0, 0)
106 PRIMITIVE(GlyphId, "glyph-id", 1, 0, 0)
107 PRIMITIVE(IsGlyphSubstTable, "glyph-subst-table?", 1, 0, 0)
108 PRIMITIVE(GlyphSubstTable, "glyph-subst-table", 1, 0, 0)
109 PRIMITIVE(GlyphSubst, "glyph-subst", 2, 0, 0)
110 // Core query language
111 PRIMITIVE(CurrentNode, "current-node", 0, 0, 0)
112 PRIMITIVE(IsNodeListEmpty, "node-list-empty?", 1, 0, 0)
113 PRIMITIVE(IsNodeList, "node-list?", 1, 0, 0)
114 PRIMITIVE(NodeListError, "node-list-error", 2, 0, 0)
115 PRIMITIVE(Gi, "gi", 0, 1, 0)
116 PRIMITIVE(FirstChildGi, "first-child-gi", 0, 1, 0)
117 PRIMITIVE(Id, "id", 0, 1, 0)
118 PRIMITIVE(Parent, "parent", 0, 1, 0)
119 PRIMITIVE(Ancestor, "ancestor", 1, 1, 0)
120 PRIMITIVE(AttributeString, "attribute-string", 1, 1, 0)
121 PRIMITIVE(InheritedAttributeString, "inherited-attribute-string", 1, 1, 0)
122 PRIMITIVE(InheritedElementAttributeString, "inherited-element-attribute-string", 2, 1, 0)
123 PRIMITIVE(IsFirstSibling, "first-sibling?", 0, 1, 0)
124 PRIMITIVE(IsAbsoluteFirstSibling, "absolute-first-sibling?", 0, 1, 0)
125 PRIMITIVE(IsLastSibling, "last-sibling?", 0, 1, 0)
126 PRIMITIVE(IsAbsoluteLastSibling, "absolute-last-sibling?", 0, 1, 0)
127 PRIMITIVE(IsHaveAncestor, "have-ancestor?", 1, 1, 0)
128 PRIMITIVE(ChildNumber, "child-number", 0, 1, 0)
129 PRIMITIVE(AncestorChildNumber, "ancestor-child-number", 1, 1, 0)
130 PRIMITIVE(HierarchicalNumber, "hierarchical-number", 1, 1, 0)
131 PRIMITIVE(HierarchicalNumberRecursive, "hierarchical-number-recursive", 1, 1, 0)
132 PRIMITIVE(ElementNumber, "element-number", 0, 1, 0)
133 PRIMITIVE(ElementNumberList, "element-number-list", 1, 1, 0)
134 PRIMITIVE(EntitySystemId, "entity-system-id", 1, 1, 0)
135 PRIMITIVE(EntityPublicId, "entity-public-id", 1, 1, 0)
136 PRIMITIVE(EntityGeneratedSystemId, "entity-generated-system-id", 1, 1, 0)
137 PRIMITIVE(EntityText, "entity-text", 1, 1, 0)
138 PRIMITIVE(EntityNotation, "entity-notation", 1, 1, 0)
139 PRIMITIVE(EntityType, "entity-type", 1, 1, 0)
140 PRIMITIVE(EntityAttributeString, "entity-attribute-string", 2, 1, 0)
141 PRIMITIVE(NotationSystemId, "notation-system-id", 1, 1, 0)
142 PRIMITIVE(NotationPublicId, "notation-public-id", 1, 1, 0)
143 PRIMITIVE(NotationGeneratedSystemId, "notation-generated-system-id", 1, 1, 0)
144 PRIMITIVE(GeneralNameNormalize, "general-name-normalize", 1, 1, 0)
145 PRIMITIVE(EntityNameNormalize, "entity-name-normalize", 1, 1, 0)
146 // Some non-core query language
147 PRIMITIVE(NodeListFirst, "node-list-first", 1, 0, 0)
148 PRIMITIVE(NodeListRest, "node-list-rest", 1, 0, 0)
149 PRIMITIVE(NodeList, "node-list", 0, 0, 1)
150 PRIMITIVE(Children, "children", 1, 0, 0)
151 PRIMITIVE(Follow, "follow", 1, 0, 0)
152 PRIMITIVE(Preced, "preced", 1, 0, 0)
153 PRIMITIVE(Descendants, "descendants", 1, 0, 0)
154 PRIMITIVE(Attributes, "attributes", 1, 0, 0)
155 PRIMITIVE(NodeListNoOrder, "node-list-no-order", 1, 0, 0)
156 PRIMITIVE(IsNodeListEqual, "node-list=?", 2, 0, 0)
157 PRIMITIVE(IsNamedNodeList, "named-node-list?", 1, 0, 0)
158 PRIMITIVE(NamedNode, "named-node", 2, 0, 0)
159 PRIMITIVE(NamedNodeListNames, "named-node-list-names", 1, 0, 0)
160 PRIMITIVE(NamedNodeListNormalize, "named-node-list-normalize", 3, 0, 0)
161 PRIMITIVE(SelectElements, "select-elements", 2, 0, 0)
162 PRIMITIVE(Data, "data", 1, 0, 0)
163 PRIMITIVE(ElementWithId, "element-with-id", 1, 1, 0)
164 PRIMITIVE(EmptyNodeList, "empty-node-list", 0, 0, 0)
165 PRIMITIVE(NodeProperty, "node-property", 2, 0, 1)
166 PRIMITIVE(SelectByClass, "select-by-class", 2, 0, 0)
167 PRIMITIVE(NodeListMap, "node-list-map", 2, 0, 0)
168 PRIMITIVE(NodeListRef, "node-list-ref", 2, 0, 0)
169 PRIMITIVE(NodeListReverse, "node-list-reverse", 1, 0, 0)
170 PRIMITIVE(NodeListLength, "node-list-length", 1, 0, 0)
171 PRIMITIVE(SgmlParse, "sgml-parse", 1, 0, 1)
172 PRIMITIVE(IsMatchElement, "match-element?", 2, 0, 0)
173 // External procedures
174 XPRIMITIVE(ReadEntity, "read-entity", 1, 0, 0)
175 XPRIMITIVE(Debug, "debug", 1, 0, 0)
176 XPRIMITIVE(IfFirstPage, "if-first-page", 2, 0, 0)
177 XPRIMITIVE(IfFrontPage, "if-front-page", 2, 0, 0)
178 XPRIMITIVE(AllElementNumber, "all-element-number", 0, 1, 0)
180 PRIMITIVE2(IsVector, "vector?", 1, 0, 0)
181 PRIMITIVE2(Vector, "vector", 0, 0, 1)
182 PRIMITIVE2(VectorRef, "vector-ref", 2, 0, 0)
183 PRIMITIVE2(VectorSet, "vector-set!", 3, 0, 0)
184 PRIMITIVE2(MakeVector, "make-vector", 1, 1, 0)
185 PRIMITIVE2(VectorToList, "vector->list", 1, 0, 0)
186 PRIMITIVE2(ListToVector, "list->vector", 1, 0, 0)
187 PRIMITIVE2(VectorFill, "vector-fill!", 2, 0, 0)
188 PRIMITIVE2(IsEqv, "eqv?", 2, 0, 0)
189 PRIMITIVE2(Memv, "memv", 2, 0, 0)
190 PRIMITIVE2(QuantityToString, "quantity->string", 1, 1, 0)
191 //more non-core expression language
192 PRIMITIVE(Assoc, "assoc", 2, 0, 0)
193 PRIMITIVE(KeywordToString, "keyword->string", 1, 0, 0)
194 PRIMITIVE(StringToKeyword, "string->keyword", 1, 0, 0)
195 PRIMITIVE(IsExact, "exact?", 1, 0, 0)
196 PRIMITIVE(IsInexact, "inexact?", 1, 0, 0)
197 PRIMITIVE(IsZero, "zero?", 1, 0, 0)
198 PRIMITIVE(IsPositive, "positive?", 1, 0, 0)
199 PRIMITIVE(IsNegative, "negative?", 1, 0, 0)
200 PRIMITIVE(IsOdd, "odd?", 1, 0, 0)
201 PRIMITIVE(IsEven, "even?", 1, 0, 0)
202 PRIMITIVE(Exp, "exp", 1, 0, 0)
203 PRIMITIVE(Log, "log", 1, 0, 0)
204 PRIMITIVE(Sin, "sin", 1, 0, 0)
205 PRIMITIVE(Cos, "cos", 1, 0, 0)
206 PRIMITIVE(Tan, "tan", 1, 0, 0)
207 PRIMITIVE(Asin, "asin", 1, 0, 0)
208 PRIMITIVE(Acos, "acos", 1, 0, 0)
209 PRIMITIVE(Atan, "atan", 1, 1, 0)
210 PRIMITIVE(Expt, "expt", 2, 0, 0)
211 PRIMITIVE(ExactToInexact, "exact->inexact", 1, 0, 0)
212 PRIMITIVE(InexactToExact, "inexact->exact", 1, 0, 0)
213 PRIMITIVE(QuantityToNumber, "quantity->number", 1, 0, 0)
214 PRIMITIVE(StringToList, "string->list", 1, 0, 0)
215 PRIMITIVE(ListToString, "list->string", 1, 0, 0)
216 PRIMITIVE(TimeLess, "time<?", 2, 0, 0)
217 PRIMITIVE(TimeGreater, "time>?", 2, 0, 0)
218 PRIMITIVE(TimeLessOrEqual, "time<=?", 2, 0, 0)
219 PRIMITIVE(TimeGreaterOrEqual, "time>=?", 2, 0, 0)
220 PRIMITIVE(IsLanguage, "language?", 1, 0, 0)
221 PRIMITIVE(CurrentLanguage, "current-language", 0, 0, 0)
222 PRIMITIVE(WithLanguage, "with-language", 2, 0, 0)
223 PRIMITIVE(CharLess, "char<?", 2, 0, 0)
224 PRIMITIVE(CharLessOrEqual, "char<=?", 2, 0, 0)
225 PRIMITIVE(CharUpcase, "char-upcase", 1, 0, 0)
226 PRIMITIVE(CharDowncase, "char-downcase", 1, 0, 0)
227 PRIMITIVE(StringEquiv, "string-equiv?", 3, 0, 0)
228 PRIMITIVE(StringLess, "string<?", 2, 0, 0)
229 PRIMITIVE(StringLessOrEqual, "string<=?", 2, 0, 0)
230 // more style language
231 PRIMITIVE(MapConstructor, "map-constructor", 2, 0, 0)
232 // more external procedures
233 XXPRIMITIVE(Language, "language", 2, 0, 0)
234 XXPRIMITIVE(XSgmlParse, "sgml-parse", 1, 0, 1)
235 XXPRIMITIVE(XExpt, "expt", 2, 0, 0)