]> gitweb.factorcode.org Git - factor.git/blob - core/combinators/combinators-docs.factor
Fix conflict
[factor.git] / core / combinators / combinators-docs.factor
1 USING: arrays help.markup help.syntax strings sbufs vectors
2 kernel quotations generic generic.standard classes
3 math assocs sequences sequences.private combinators.private
4 effects words ;
5 IN: combinators
6
7 ARTICLE: "cleave-shuffle-equivalence" "Expressing shuffle words with cleave combinators"
8 "Cleave combinators are defined in terms of shuffle words, and mappings from certain shuffle idioms to cleave combinators are discussed in the documentation for " { $link bi } ", " { $link 2bi } ", " { $link 3bi } ", " { $link tri } ", " { $link 2tri } " and " { $link 3tri } "."
9 $nl
10 "Certain shuffle words can also be expressed in terms of the cleave combinators. Internalizing such identities can help with understanding and writing code using cleave combinators:"
11 { $code
12     ": keep  [ ] bi ;"
13     ": 2keep [ ] 2bi ;"
14     ": 3keep [ ] 3bi ;"
15     ""
16     ": dup   [ ] [ ] bi ;"
17     ": 2dup  [ ] [ ] 2bi ;"
18     ": 3dup  [ ] [ ] 3bi ;"
19     ""
20     ": tuck  [ nip ] [ ] 2bi ;"
21     ": swap  [ nip ] [ drop ] 2bi ;"
22     ""
23     ": over  [ ] [ drop ] 2bi ;"
24     ": pick  [ ] [ 2drop ] 3bi ;"
25     ": 2over [ ] [ drop ] 3bi ;"
26 } ;
27
28 ARTICLE: "cleave-combinators" "Cleave combinators"
29 "The cleave combinators apply multiple quotations to a single value."
30 $nl
31 "Two quotations:"
32 { $subsections bi 2bi 3bi }
33 "Three quotations:"
34 { $subsections tri 2tri 3tri }
35 "An array of quotations:"
36 { $subsection cleave 2cleave 3cleave }
37 $nl
38 "Technically, the cleave combinators are redundant because they can be simulated using shuffle words and other combinators, and in addition, they do not reduce token counts by much, if at all. However, they can make code more readable by expressing intention and exploiting any inherent symmetry. For example, a piece of code which performs three operations on the top of the stack can be written in one of two ways:"
39 { $code
40     "! First alternative; uses keep"
41     "[ 1 + ] keep"
42     "[ 1 - ] keep"
43     "2 *"
44     "! Second alternative: uses tri"
45     "[ 1 + ]"
46     "[ 1 - ]"
47     "[ 2 * ] tri"
48 }
49 "The latter is more aesthetically pleasing than the former."
50 $nl
51 { $subsection "cleave-shuffle-equivalence" } ;
52
53 ARTICLE: "spread-shuffle-equivalence" "Expressing shuffle words with spread combinators"
54 "Spread combinators are defined in terms of shuffle words, and mappings from certain shuffle idioms to spread combinators are discussed in the documentation for " { $link bi* } ", " { $link 2bi* } ", " { $link tri* } ", and " { $link 2tri* } "."
55 $nl
56 "Certain shuffle words can also be expressed in terms of the spread combinators. Internalizing such identities can help with understanding and writing code using spread combinators:"
57 { $code
58     ": dip   [ ] bi* ;"
59     ": 2dip  [ ] [ ] tri* ;"
60     ""
61     ": nip   [ drop ] [ ] bi* ;"
62     ": 2nip  [ drop ] [ drop ] [ ] tri* ;"
63     ""
64     ": rot"
65     "    [ [ drop ] [      ] [ drop ] tri* ]"
66     "    [ [ drop ] [ drop ] [      ] tri* ]"
67     "    [ [      ] [ drop ] [ drop ] tri* ]"
68     "    3tri ;"
69     ""
70     ": -rot"
71     "    [ [ drop ] [ drop ] [      ] tri* ]"
72     "    [ [      ] [ drop ] [ drop ] tri* ]"
73     "    [ [ drop ] [      ] [ drop ] tri* ]"
74     "    3tri ;"
75     ""
76     ": spin"
77     "    [ [ drop ] [ drop ] [      ] tri* ]"
78     "    [ [ drop ] [      ] [ drop ] tri* ]"
79     "    [ [      ] [ drop ] [ drop ] tri* ]"
80     "    3tri ;"
81 } ;
82
83 ARTICLE: "spread-combinators" "Spread combinators"
84 "The spread combinators apply multiple quotations to multiple values. In this case, " { $snippet "*" } " suffix signify spreading."
85 $nl
86 "Two quotations:"
87 { $subsections bi* 2bi* }
88 "Three quotations:"
89 { $subsections tri* 2tri* }
90 "An array of quotations:"
91 { $subsections spread }
92 "Technically, the spread combinators are redundant because they can be simulated using shuffle words and other combinators, and in addition, they do not reduce token counts by much, if at all. However, they can make code more readable by expressing intention and exploiting any inherent symmetry. For example, a piece of code which performs three operations on three related values can be written in one of two ways:"
93 { $code
94     "! First alternative; uses dip"
95     "[ [ 1 + ] dip 1 - ] dip 2 *"
96     "! Second alternative: uses tri*"
97     "[ 1 + ] [ 1 - ] [ 2 * ] tri*"
98 }
99 "A generalization of the above combinators to any number of quotations can be found in " { $link "combinators" } "."
100 $nl
101 { $subsection "spread-shuffle-equivalence" } ;
102
103 ARTICLE: "apply-combinators" "Apply combinators"
104 "The apply combinators apply a single quotation to multiple values. The " { $snippet "@" } " suffix signifies application."
105 $nl
106 "Two quotations:"
107 { $subsections bi@ 2bi@ }
108 "Three quotations:"
109 { $subsections tri@ 2tri@ }
110 "A pair of utility words built from " { $link bi@ } ":"
111 { $subsections both? either? } ;
112
113 ARTICLE: "retainstack-combinators" "Retain stack combinators"
114 "Sometimes an additional storage area is needed to hold objects. The " { $emphasis "retain stack" } " is an auxilliary stack for this purpose. Objects can be moved between the data and retain stacks using a set of combinators."
115 $nl
116 "The dip combinators invoke the quotation at the top of the stack, hiding the values underneath:"
117 { $subsections dip 2dip 3dip 4dip }
118 "The keep combinators invoke a quotation which takes a number of values off the stack, and then they restore those values:"
119 { $subsections keep 2keep 3keep } ;
120
121 ARTICLE: "curried-dataflow" "Curried dataflow combinators"
122 "Curried cleave combinators:"
123 { $subsections bi-curry tri-curry }
124 "Curried spread combinators:"
125 { $subsections bi-curry* tri-curry* }
126 "Curried apply combinators:"
127 { $subsections bi-curry@ tri-curry@ }
128 { $see-also "dataflow-combinators" } ;
129
130 ARTICLE: "compositional-examples" "Examples of compositional combinator usage"
131 "Consider printing the same message ten times:"
132 { $code ": print-10 ( -- ) 10 [ \"Hello, world.\" print ] times ;" }
133 "if we wanted to abstract out the message into a parameter, we could keep it on the stack between iterations:"
134 { $code ": print-10 ( message -- ) 10 [ dup print ] times drop ;" }
135 "However, keeping loop-invariant values on the stack doesn't always work out nicely. For example, a word to subtract a value from each element of a sequence:"
136 { $code ": subtract-n ( seq n -- seq' ) swap [ over - ] map nip ;" }
137 "Three shuffle words are required to pass the value around. Instead, the loop-invariant value can be partially applied to a quotation using " { $link curry } ", yielding a new quotation that is passed to " { $link map } ":"
138 { $example
139   ": subtract-n ( seq n -- seq' ) [ - ] curry map ;"
140   "{ 10 20 30 } 5 subtract-n ."
141   "{ 5 15 25 }"
142 }
143 "Now consider the word that is dual to the one above; instead of subtracting " { $snippet "n" } " from each stack element, it subtracts each element from " { $snippet "n" } "."
144 $nl
145 "One way to write this is with a pair of " { $link swap } "s:"
146 { $code ": n-subtract ( n seq -- seq' ) swap [ swap - ] curry map ;" }
147 "Since this pattern comes up often, " { $link with } " encapsulates it:"
148 { $example
149   ": n-subtract ( n seq -- seq' ) [ - ] with map ;"
150   "30 { 10 20 30 } n-subtract ."
151   "{ 20 10 0 }"
152 }
153 { $see-also "fry.examples" } ;
154
155 ARTICLE: "compositional-combinators" "Compositional combinators"
156 "Certain combinators transform quotations to produce a new quotation."
157 { $subsections "compositional-examples" }
158 "Fundamental operations:"
159 { $subsections curry compose }
160 "Derived operations:"
161 { $subsections 2curry 3curry with prepose }
162 "These operations run in constant time, and in many cases are optimized out altogether by the " { $link "compiler" } ". " { $link "fry" } " are an abstraction built on top of these operations, and code that uses this abstraction is often clearer than direct calls to the below words."
163 $nl
164 "Curried dataflow combinators can be used to build more complex dataflow by combining cleave, spread and apply patterns in various ways."
165 { $subsections "curried-dataflow" }
166 "Quotations also implement the sequence protocol, and can be manipulated with sequence words; see " { $link "quotations" } ". However, such runtime quotation manipulation will not be optimized by the optimizing compiler." ;
167
168 ARTICLE: "booleans" "Booleans"
169 "In Factor, any object that is not " { $link f } " has a true value, and " { $link f } " has a false value. The " { $link t } " object is the canonical true value."
170 { $subsections f t }
171 "A union class of the above:"
172 { $subsections boolean }
173 "There are some logical operations on booleans:"
174 { $subsections
175     >boolean
176     not
177     and
178     or
179     xor
180 }
181 "Boolean values are most frequently used for " { $link "conditionals" } "."
182 { $heading "The f object and f class" }
183 "The " { $link f } " object is the unique instance of the " { $link f } " class; the two are distinct objects. The latter is also a parsing word which adds the " { $link f } " object to the parse tree at parse time. To refer to the class itself you must use " { $link POSTPONE: POSTPONE: } " or " { $link POSTPONE: \ } " to prevent the parsing word from executing."
184 $nl
185 "Here is the " { $link f } " object:"
186 { $example "f ." "f" }
187 "Here is the " { $link f } " class:"
188 { $example "\\ f ." "POSTPONE: f" }
189 "They are not equal:"
190 { $example "f \\ f = ." "f" }
191 "Here is an array containing the " { $link f } " object:"
192 { $example "{ f } ." "{ f }" }
193 "Here is an array containing the " { $link f } " class:"
194 { $example "{ POSTPONE: f } ." "{ POSTPONE: f }" }
195 "The " { $link f } " object is an instance of the " { $link f } " class:"
196 { $example "USE: classes" "f class ." "POSTPONE: f" }
197 "The " { $link f } " class is an instance of " { $link word } ":"
198 { $example "USE: classes" "\\ f class ." "word" }
199 "On the other hand, " { $link t } " is just a word, and there is no class which it is a unique instance of."
200 { $example "t \\ t eq? ." "t" }
201 "Many words which search collections confuse the case of no element being present with an element being found equal to " { $link f } ". If this distinction is imporant, there is usually an alternative word which can be used; for example, compare " { $link at } " with " { $link at* } "." ;
202
203 ARTICLE: "conditionals-boolean-equivalence" "Expressing conditionals with boolean logic"
204 "Certain simple conditional forms can be expressed in a simpler manner using boolean logic."
205 $nl
206 "The following two lines are equivalent:"
207 { $code "[ drop f ] unless" "swap and" }
208 "The following two lines are equivalent:"
209 { $code "[ ] [ ] ?if" "swap or" }
210 "The following two lines are equivalent, where " { $snippet "L" } " is a literal:"
211 { $code "[ L ] unless*" "L or" } ;
212
213 ARTICLE: "conditionals" "Conditional combinators"
214 "The basic conditionals:"
215 { $subsections if when unless }
216 "Forms abstracting a common stack shuffle pattern:"
217 { $subsections if* when* unless* }
218 "Another form abstracting a common stack shuffle pattern:"
219 { $subsections ?if }
220 "Sometimes instead of branching, you just need to pick one of two values:"
221 { $subsections ? }
222 "Two combinators which abstract out nested chains of " { $link if } ":"
223 { $subsections cond case }
224 { $subsection "conditionals-boolean-equivalence" }
225 { $see-also "booleans" "bitwise-arithmetic" both? either? } ;
226
227 ARTICLE: "dataflow-combinators" "Data flow combinators"
228 "Data flow combinators pass values between quotations:"
229 { $subsections
230     "retainstack-combinators"
231     "cleave-combinators"
232     "spread-combinators"
233     "apply-combinators"
234 }
235 { $see-also "curried-dataflow" } ;
236
237 ARTICLE: "combinators-quot" "Quotation construction utilities"
238 "Some words for creating quotations which can be useful for implementing method combinations and compiler transforms:"
239 { $subsections cond>quot case>quot alist>quot } ;
240
241 ARTICLE: "call-unsafe" "Unsafe combinators"
242 "Unsafe calls declare an effect statically without any runtime checking:"
243 { $subsections call-effect-unsafe execute-effect-unsafe } ;
244
245 ARTICLE: "call" "Fundamental combinators"
246 "The most basic combinators are those that take either a quotation or word, and invoke it immediately."
247 $nl
248 "There are two sets of combinators; they differ in whether or not the stack effect of the expected code is declared."
249 $nl
250 "The simplest combinators do not take an effect declaration. The compiler checks the stack effect at compile time, rejecting the program if this cannot be done:"
251 { $subsections call execute }
252 "The second set of combinators takes an effect declaration. Note that the opening parenthesis is actually part of the word name; these are parsing words, and they read a stack effect until the corresponding closing parenthesis. The stack effect of the quotation or word is then checked at runtime:"
253 { $subsections POSTPONE: call( POSTPONE: execute( }
254 "The above are syntax sugar. The underlying words are a bit more verbose but allow non-constant effects to be passed in:"
255 { $subsections call-effect execute-effect }
256 "The combinator variants that do not take an effect declaration can only be used if the compiler is able to infer the stack effect by other means. See " { $link "inference-combinators" } "."
257 { $subsection "call-unsafe" }
258 { $see-also "effects" "inference" } ;
259
260 ARTICLE: "combinators" "Combinators"
261 "A central concept in Factor is that of a " { $emphasis "combinator" } ", which is a word taking code as input."
262 { $subsections
263     "call"
264     "dataflow-combinators"
265     "conditionals"
266     "looping-combinators"
267     "compositional-combinators"
268     "combinators.short-circuit"
269     "combinators.smart"
270     "combinators-quot"
271     "generalizations"
272 }
273 "More combinators are defined for working on data structures, such as " { $link "sequences-combinators" } " and " { $link "assocs-combinators" } "."
274 { $see-also "quotations" } ;
275
276 ABOUT: "combinators"
277
278 HELP: call-effect
279 { $values { "quot" quotation } { "effect" effect } }
280 { $description "Given a quotation and a stack effect, calls the quotation, asserting at runtime that it has the given stack effect. This is a macro which expands given a literal effect parameter, and an arbitrary quotation which is not required at compile time." }
281 { $examples
282   "The following two lines are equivalent:"
283   { $code
284     "call( a b -- c )"
285     "(( a b -- c )) call-effect"
286   }
287 } ;
288
289 HELP: execute-effect
290 { $values { "word" word } { "effect" effect } }
291 { $description "Given a word and a stack effect, executes the word, asserting at runtime that it has the given stack effect. This is a macro which expands given a literal effect parameter, and an arbitrary word which is not required at compile time." }
292 { $examples
293   "The following two lines are equivalent:"
294   { $code
295     "execute( a b -- c )"
296     "(( a b -- c )) execute-effect"
297   }
298 } ;
299
300 HELP: execute-effect-unsafe
301 { $values { "word" word } { "effect" effect } }
302 { $description "Given a word and a stack effect, executes the word, blindly declaring at runtime that it has the given stack effect. This is a macro which expands given a literal effect parameter, and an arbitrary word which is not required at compile time." }
303 { $warning "If the word being executed has an incorrect stack effect, undefined behavior will result. User code should use " { $link POSTPONE: execute( } " instead." } ;
304     
305 { call-effect call-effect-unsafe execute-effect execute-effect-unsafe } related-words
306
307 HELP: cleave
308 { $values { "x" object } { "seq" "a sequence of quotations with stack effect " { $snippet "( x -- ... )" } } }
309 { $description "Applies each quotation to the object in turn." }
310 { $examples
311     "The " { $link bi } " combinator takes one value and two quotations; the " { $link tri } " combinator takes one value and three quotations. The " { $link cleave } " combinator takes one value and any number of quotations, and is essentially equivalent to a chain of " { $link keep } " forms:"
312     { $code
313         "! Equivalent"
314         "{ [ p ] [ q ] [ r ] [ s ] } cleave"
315         "[ p ] keep [ q ] keep [ r ] keep s"
316     }
317 } ;
318
319 HELP: 2cleave
320 { $values { "x" object } { "y" object }
321           { "seq" "a sequence of quotations with stack effect " { $snippet "( x y -- ... )" } } }
322 { $description "Applies each quotation to the two objects in turn." } ;
323
324 HELP: 3cleave
325 { $values { "x" object } { "y" object } { "z" object }
326           { "seq" "a sequence of quotations with stack effect " { $snippet "( x y z -- ... )" } } }
327 { $description "Applies each quotation to the three objects in turn." } ;
328
329 { bi tri cleave } related-words
330
331 HELP: spread
332 { $values { "objs..." "objects" } { "seq" "a sequence of quotations with stack effect " { $snippet "( x -- ... )" } } }
333 { $description "Applies each quotation to the object in turn." }
334 { $examples
335     "The " { $link bi* } " combinator takes two values and two quotations; the " { $link tri* } " combinator takes three values and three quotations. The " { $link spread } " combinator takes " { $snippet "n" } " values and " { $snippet "n" } " quotations, where " { $snippet "n" } " is the length of the input sequence, and is essentially equivalent to series of retain stack manipulations:"
336     { $code
337         "! Equivalent"
338         "{ [ p ] [ q ] [ r ] [ s ] } spread"
339         "[ [ [ p ] dip q ] dip r ] dip s"
340     }
341 } ;
342
343 { bi* tri* spread } related-words
344
345 HELP: to-fixed-point
346 { $values { "object" object } { "quot" { $quotation "( object(n) -- object(n+1) )" } } { "object(n)" object } }
347 { $description "Applies the quotation repeatedly with " { $snippet "object" } " as the initial input until the output of the quotation equals the input." }
348 { $examples
349     { $example
350         "USING: combinators kernel math prettyprint sequences ;"
351         "IN: scratchpad"
352         ": flatten ( sequence -- sequence' )"
353         "    \"flatten\" over index"
354         "    [ [ 1 + swap nth ] [ nip dup 2 + ] [ drop ] 2tri replace-slice ] when* ;"
355         ""
356         "{ \"flatten\" { 1 { 2 3 } \"flatten\" { 4 5 } { 6 } } } [ flatten ] to-fixed-point ."
357         "{ 1 { 2 3 } 4 5 { 6 } }"
358     }
359 } ;
360
361 HELP: alist>quot
362 { $values { "default" "a quotation" } { "assoc" "a sequence of quotation pairs" } { "quot" "a new quotation" } }
363 { $description "Constructs a quotation which calls the first quotation in each pair of " { $snippet "assoc" } " until one of them outputs a true value, and then calls the second quotation in the corresponding pair. Quotations are called in reverse order, and if no quotation outputs a true value then " { $snippet "default" } " is called." }
364 { $notes "This word is used to implement compile-time behavior for " { $link cond } ", and it is also used by the generic word system. Note that unlike " { $link cond } ", the constructed quotation performs the tests starting from the end and not the beginning." } ;
365
366 HELP: cond
367 { $values { "assoc" "a sequence of quotation pairs and an optional quotation" } }
368 { $description
369     "Calls the second quotation in the first pair whose first quotation yields a true value. A single quotation will always yield a true value."
370     $nl
371     "The following two phrases are equivalent:"
372     { $code "{ { [ X ] [ Y ] } { [ Z ] [ T ] } } cond" }
373     { $code "X [ Y ] [ Z [ T ] [ no-cond ] if ] if" }
374 }
375 { $errors "Throws a " { $link no-cond } " error if none of the test quotations yield a true value." }
376 { $examples
377     { $code
378         "{"
379         "    { [ dup 0 > ] [ \"positive\" ] }"
380         "    { [ dup 0 < ] [ \"negative\" ] }"
381         "    [ \"zero\" ]"
382         "} cond"
383     }
384 } ;
385
386 HELP: no-cond
387 { $description "Throws a " { $link no-cond } " error." }
388 { $error-description "Thrown by " { $link cond } " if none of the test quotations yield a true value. Some uses of " { $link cond } " include a default case where the test quotation is " { $snippet "[ t ]" } "; such a " { $link cond } " form will never throw this error." } ;
389
390 HELP: case
391 { $values { "obj" object } { "assoc" "a sequence of object/word,quotation pairs, with an optional quotation at the end" } }
392 { $description
393     "Compares " { $snippet "obj" } " against the first element of every pair, first evaluating the first element if it is a word. If some pair matches, removes " { $snippet "obj" } " from the stack and calls the second element of that pair, which must be a quotation."
394     $nl
395     "If there is no case matching " { $snippet "obj" } ", the default case is taken. If the last element of " { $snippet "cases" } " is a quotation, the quotation is called with " { $snippet "obj" } " on the stack. Otherwise, a " { $link no-cond } " error is rasied."
396     $nl
397     "The following two phrases are equivalent:"
398     { $code "{ { X [ Y ] } { Z [ T ] } } case" }
399     { $code "dup X = [ drop Y ] [ dup Z = [ drop T ] [ no-case ] if ] if" }
400 }
401 { $examples
402     { $code
403         "SYMBOL: yes  SYMBOL: no  SYMBOL: maybe"
404         "maybe {"
405         "    { yes [ ] } ! Do nothing"
406         "    { no [ \"No way!\" throw ] }"
407         "    { maybe [ \"Make up your mind!\" print ] }"
408         "    [ \"Invalid input; try again.\" print ]"
409         "} case"
410     }
411 } ;
412
413 HELP: no-case
414 { $description "Throws a " { $link no-case } " error." }
415 { $error-description "Thrown by " { $link case } " if the object at the top of the stack does not match any case, and no default case is given." } ;
416
417 HELP: recursive-hashcode
418 { $values { "n" integer } { "obj" object } { "quot" { $quotation "( n obj -- code )" } } { "code" integer } }
419 { $description "A combinator used to implement methods for the " { $link hashcode* } " generic word. If " { $snippet "n" } " is less than or equal to zero, outputs 0, otherwise calls the quotation." } ;
420
421 HELP: cond>quot
422 { $values { "assoc" "a sequence of pairs of quotations" } { "quot" quotation } }
423 { $description  "Creates a quotation that when called, has the same effect as applying " { $link cond } " to " { $snippet "assoc" } "."
424 $nl
425 "The generated quotation is more efficient than the naive implementation of " { $link cond } ", though, since it expands into a series of conditionals, and no iteration through " { $snippet "assoc" } " has to be performed." }
426 { $notes "This word is used behind the scenes to compile " { $link cond } " forms efficiently; it can also be called directly,  which is useful for meta-programming." } ;
427
428 HELP: case>quot
429 { $values { "assoc" "a sequence of pairs of quotations" } { "default" quotation } { "quot" quotation } }
430 { $description "Creates a quotation that when called, has the same effect as applying " { $link case } " to " { $snippet "assoc" } "."
431 $nl
432 "This word uses three strategies:"
433 { $list
434     "If the assoc only has a few keys, a linear search is generated."
435     { "If the assoc has a large number of keys which form a contiguous range of integers, a direct dispatch is generated using the " { $link dispatch } " word together with a bounds check." }
436     "Otherwise, an open-coded hashtable dispatch is generated."
437 } } ;
438
439 HELP: distribute-buckets
440 { $values { "alist" "an alist" } { "initial" object } { "quot" { $quotation "( obj -- assoc )" } } { "buckets" "a new array" } }
441 { $description "Sorts the entries of " { $snippet "assoc" } " into buckets, using the quotation to yield a set of keys for each entry. The hashcode of each key is computed, and the entry is placed in all corresponding buckets. Each bucket is initially cloned from " { $snippet "initial" } "; this should either be an empty vector or a one-element vector containing a pair." }
442 { $notes "This word is used in the implemention of " { $link hash-case-quot } " and " { $link standard-combination } "." } ;
443
444 HELP: dispatch ( n array -- )
445 { $values { "n" "a fixnum" } { "array" "an array of quotations" } }
446 { $description "Calls the " { $snippet "n" } "th quotation in the array." }
447 { $warning "This word is in the " { $vocab-link "kernel.private" } " vocabulary because it is an implementation detail used by the generic word system to accelerate method dispatch. It does not perform type or bounds checks, and user code should not need to call it directly." } ;