Handbook
Glossary
pair
Factor handbook
»
The language
»
Collections
»
Arrays
Prev:
resize-array ( n array -- new-array )
Next:
Unsafe array operations
Vocabulary
arrays
Class description
The class of two-element arrays, known as pairs.
Definition
USING:
accessors
math
;
IN:
arrays
PREDICATE:
pair
<
array
length>>
2
number=
;
Methods
USING:
arrays
help.markup
make
math.parser
raylib.private
sequences
;
M:
pair
($raylib-key)
"Represents the key "
print-element
first2
[
%
" ("
%
#
")"
%
]
""
make
$snippet
"."
print-element
;
USING:
arrays
kernel
math
math.bitwise.private
sequences.private
words
;
M:
pair
(bitfield-quot)
first2-unsafe
over
word?
[
[
[
execute
]
curry
]
dip
[
shift
]
curry
compose
]
[
[
shift
]
2curry
]
if
;
USING:
arrays
classes
compiler.cfg.intrinsics.simd.backend
generalizations
kernel
make
sequences
;
M::
pair
>vector-op-cond
( pair #pick #dup -- quotpair )
pair
first2
:>
( class quot ) #pick class #dup quot
[vector-op-checked]
[
[
[
[
2drop
]
]
dip
[
npick
]
curry
compose
]
dip
[
instance?
]
curry
compose
]
dip
[
[
f
f
f
]
if
]
curry
compose
#dup
[
[
%
]
]
dip
[
nnip
]
curry
compose
2array
;
USING:
arrays
kernel
sequences.private
tools.disassembler
tools.disassembler.private
;
M:
pair
disassemble
first2-unsafe
[
convert-address
]
bi@
disassemble*
;
USING:
arrays
effects
kernel
sequences
sequences.private
;
M:
pair
effect>string
first2-unsafe
over
[
[
effect>string
]
bi@
": "
glue
]
[
nip
effect>string
":"
prepend
]
if
;
USING:
arrays
effects
sequences.private
;
M:
pair
effect>type
second-unsafe
effect>type
;
USING:
arrays
help.lint.coverage.private
io.styles
sequences
;
M:
pair
write-object*
first2
write-object
;