Handbook
Glossary
word
Factor handbook
»
The language
»
Words
»
Word introspection
Next:
word? ( object -- ? )
Vocabulary
words
Class description
The class of words. One notable subclass is
class
, the class of class words.
Definition
USING:
math
quotations
;
IN:
words
BUILTIN:
word
{
hashcode
fixnum
initial:
0
}
name vocabulary
{
def
quotation
initial:
[
]
}
props pic-def pic-tail-def
{
sub-primitive
read-only
}
;
Methods
USING:
accessors
help.markup
io
kernel
words
;
M:
word
($instance)
dup
name>>
a/an
write
bl
($link)
;
USING:
combinators
tools.annotations.private
words
;
M:
word
(annotate)
prepare-annotate
( old -- new )
call-effect
define
;
USING:
compiler.tree.builder.private
kernel
stack-checker.backend
stack-checker.state
words
;
M:
word
(build-tree)
[
check-no-compile
]
[
word-body
infer-quot-here
]
[
required-stack-effect
check-effect
]
tri
;
USING:
alien.data
combinators
words
;
M:
word
(c-array)
c-(array)-constructor
( len -- array )
execute-effect
;
inline
USING:
combinators
kernel
quotations
sequences.deep
tools.annotations.private
words
;
M:
word
(deep-annotate)
prepare-annotate
[
( old -- new )
call-effect
]
curry
[
[
dup
callable?
]
]
dip
[
when
]
curry
compose
deep-map
define
;
USING:
classes.tuple.private
words
;
M:
word
(define-tuple-class)
define-new-tuple-class
;
USING:
accessors
fjsc
kernel
words
;
M:
word
(parse-factor-quotation)
[
name>>
]
[
vocabulary>>
]
bi
ast-identifier
boa
;
USING:
io.styles
namespaces
prettyprint
ui.tools.listener
words
;
M:
word
(print-input)
"Command: "
listener-word-style
get-global
format
.
;
USING:
kernel
tools.annotations.private
words
;
M:
word
(reset)
dup
"unannotated-def"
word-prop
[
dupd
define
"unannotated-def"
remove-word-prop
]
[
drop
]
if*
;
USING:
accessors
combinators
kernel
serialize
serialize.private
words
;
M:
word
(serialize)
{
{
[
dup
t
eq?
]
[
serialize-true
]
}
{
[
dup
vocabulary>>
not
]
[
serialize-gensym
]
}
[
serialize-word
]
}
cond
;
USING:
accessors
cuda.ptx
io
words
;
M:
word
(write-ptx-element)
name>>
write
;
USING:
accessors
arrays
kernel
math.order
words
;
M:
word
<=>
[
[
name>>
]
[
vocabulary>>
]
bi
2array
]
compare
;
USING:
alien.data
combinators
words
;
M:
word
<c-array>
c-array-constructor
( len -- array )
execute-effect
;
inline
USING:
alien.data
combinators
words
;
M:
word
<c-direct-array>
c-direct-array-constructor
( alien len -- array )
execute-effect
;
inline
USING:
help.lint.coverage
help.lint.coverage.private
kernel
sequences
words
;
M:
word
<word-help-coverage>
dup
[
missing-sections
]
[
empty-examples?
]
bi
2dup
[
empty?
]
both?
word-help-coverage
boa
;
inline
USING:
alien.data
kernel
sequences
words
;
M:
word
>c-array
c-array-type
new
clone-like
;
inline
USING:
accessors
ui.tools.listener
ui.tools.listener.completion
words
;
M:
word
accept-completion-hook
interactor>>
manifest>>
use-if-necessary
;
USING:
assocs
kernel
sequences
tools.annotations
tools.coverage
words
;
M:
word
add-coverage
H{
}
clone
[
"coverage"
set-word-prop
]
2keep
[
set-at
]
curry
[
[
\
coverage-state
new
]
]
dip
[
2keep
[
flag-covered
]
curry
prepend
]
curry
compose
deep-annotate
;
USING:
kernel
stack-checker.backend
stack-checker.inlining
stack-checker.known-words
words
;
M:
word
apply-object
dup
inline?
[
inline-word
]
[
non-inline-word
]
if
;
USING:
help.private
help.topics
words
;
M:
word
article-content
(word-help)
;
USING:
accessors
help.topics
words
;
M:
word
article-name
name>>
;
USING:
help.topics
words
;
M:
word
article-parent
"help-parent"
word-prop
;
USING:
accessors
effects
help.topics
kernel
prettyprint
sequences
words
words.symbol
;
M:
word
article-title
dup
[
parsing-word?
]
[
symbol?
]
bi
or
[
name>>
]
[
[
unparse
]
[
stack-effect
[
effect>string
" "
prepend
]
[
""
]
if*
]
bi
append
]
if
;
USING:
alien.data
combinators
words
;
M:
word
c-array?
c-array-type?
( seq -- array )
execute-effect
;
inline
USING:
accessors
alien.c-types
words
;
M:
word
c-type-string
name>>
;
USING:
quotations
ui.tools.operations
words
;
M:
word
com-stack-effect
1quotation
com-stack-effect
;
USING:
compiler
words
;
M:
word
combinator?
inline?
;
USING:
ui.commands
words
;
M:
word
command-description
+description+
word-prop
;
USING:
accessors
kernel
sequences
splitting
ui.commands
unicode
words
;
M:
word
command-name
name>>
"com-"
?head
drop
"."
?tail
drop
dup
first
Letter?
[
rest
]
unless
(command-name)
;
USING:
ui.commands
words
;
M:
word
command-word
;
USING:
generic.single
words
;
M:
word
compile-engine
;
USING:
accessors
kernel
math
quotations
sequences.deep
tools.coverage.private
words
;
M:
word
count-callables
def>>
0
[
callable?
[
1
+
]
when
]
deep-reduce
;
USING:
accessors
assocs
tools.coverage
words
;
M:
word
coverage
"coverage"
word-prop
[
executed?>>
]
reject-keys
values
;
USING:
kernel
tools.coverage
words
;
M:
word
coverage.
dup
coverage
pair-coverage.
;
USING:
accessors
kernel
words
;
M:
word
crossref?
dup
"forgotten"
word-prop
[
drop
f
]
[
vocabulary>>
>boolean
]
if
;
USING:
kernel
see.private
sequences
words
;
M:
word
declarations.
{
POSTPONE:
delimiter
POSTPONE:
deprecated
POSTPONE:
inline
POSTPONE:
recursive
POSTPONE:
foldable
POSTPONE:
flushable
}
[
declaration.
]
with
each
;
USING:
definitions
kernel
words
;
M:
word
definer
drop
\
:
\
;
;
USING:
accessors
definitions
words
;
M:
word
definition
def>>
;
USING:
definitions.icons
kernel
words
;
M:
word
definition-icon
drop
"normal-word"
definition-icon-path
;
USING:
arrays
tools.disassembler
words
;
M:
word
disassemble
word-code
2array
disassemble
;
USING:
accessors
editors
kernel
sequences
words
;
M:
word
edit-docs
dup
"help-loc"
word-prop
[
nip
first2
edit-location
]
[
vocabulary>>
edit-docs
]
if*
;
USING:
accessors
editors
words
;
M:
word
edit-tests
vocabulary>>
edit-tests
;
USING:
accessors
effects
words
;
M:
word
effect>string
name>>
;
USING:
effects
words
;
M:
word
effect>type
;
USING:
alien.enums
words
;
M:
word
enum>number
"enum-value"
word-prop
;
USING:
combinators.private
gml.runtime
words
;
M:
word
exec-proc
primitive-effect
execute-effect-unsafe
;
USING:
kernel
kernel.private
words
;
M:
word
execute
(execute)
;
USING:
combinators
kernel
macros.expander
words
;
M:
word
expand-macros*
{
{
[
dup
expand-dispatch?
]
[
drop
expand-dispatch
]
}
{
[
dup
expand-macro?
]
[
expand-macro
]
}
[
drop
word,
]
}
cond
;
USING:
accessors
debugger
words
;
M:
word
expected>string
name>>
;
USING:
compiler.tree.finalization
kernel
words
;
M:
word
finalize-word
drop
;
USING:
kernel
words
;
M:
word
flushable?
[
"flushable"
word-prop
]
[
parent-word
dup
[
flushable?
]
when
]
bi
or
;
USING:
kernel
words
;
M:
word
foldable?
[
"foldable"
word-prop
]
[
parent-word
dup
[
foldable?
]
when
]
bi
or
;
USING:
accessors
assocs
definitions
kernel
vocabs
words
;
M:
word
forget*
dup
"forgotten"
word-prop
[
drop
]
[
[
subwords
forget-all
]
[
[
name>>
]
[
vocabulary>>
vocab-words-assoc
]
bi
delete-at
]
[
t
"forgotten"
set-word-prop
]
tri
]
if
;
USING:
accessors
fuel.pprint
fuel.pprint.private
io
kernel
sequences
strings
words
;
M:
word
fuel-pprint
name>>
V{
}
clone
[
fuel-maybe-scape
append
]
reduce
>string
write
;
USING:
kernel
kernel.private
math
slots.private
words
;
M:
word
hashcode*
nip
1
slot
{
fixnum
}
declare
;
inline
foldable
flushable
USING:
io.streams.string
see
splitting
words
xmode.highlight
;
M:
word
highlight.
[
see
]
with-string-writer
split-lines
"factor"
highlight-lines
;
USING:
kernel
math.partial-dispatch
words
;
M:
word
integer-op-input-classes
[
"input-classes"
word-prop
]
[
bad-integer-op
]
?unless
;
USING:
inverse
words
;
M:
word
inverse
undefined-inverse
;
USING:
combinators
ui.commands
words
;
M:
word
invoke-command
command-quot
( -- )
call-effect
;
USING:
help.markup.private
kernel
words
;
M:
word
link-effect?
drop
t
;
USING:
effects
hashtables
help.markup.private
help.stylesheet
help.topics
io
io.styles
kernel
namespaces
words
;
M:
word
link-long-text
dup
presented
associate
[
[
article-name
link-style
get
format
]
[
dup
link-effect?
[
bl
stack-effect
$effect
]
[
drop
]
if
]
bi
]
with-nesting
;
USING:
accessors
lint.private
quotations
sequences
sequences.deep
words
;
M:
word
lint
def>>
[
callable?
]
deep-filter
[
lint
]
map
concat
;
USING:
kernel
quotations
words
;
M:
word
literalize
<wrapper>
;
USING:
io
kernel
logging.parser
words
;
M:
word
log-timestamp.
drop
"multiline"
write
;
USING:
alien.c-types
kernel
words
;
M:
word
lookup-c-type
[
"c-type"
word-prop
resolve-typedef
]
[
no-c-type
]
?unless
;
USING:
kernel
words
;
M:
word
make-inline
dup
inline?
[
drop
]
[
[
t
"inline"
set-word-prop
]
[
changed-effect
]
bi
]
if
;
USING:
combinators.short-circuit
compiler
macros
words
;
M:
word
no-compile?
{
[
macro?
]
[
"special"
word-prop
]
[
"no-compile"
word-prop
]
}
1||
;
USING:
arrays
reports.noise
words
;
M:
word
noise
badness
1
2array
;
USING:
compiler.tree.debugger
hints
words
;
M:
word
optimized.
specialized-def
optimized.
;
USING:
kernel
words
;
M:
word
parent-word
drop
f
;
USING:
accessors
alien.c-types
words
;
M:
word
pointer-string
name>>
;
USING:
kernel
prettyprint.backend
prettyprint.custom
words
;
M:
word
pprint*
[
pprint-word
]
[
?start-group
]
[
?end-group
]
tri
;
USING:
prettyprint.backend
words
;
M:
word
pprint-class
pprint-word
;
USING:
classes
words
;
M:
word
predicate-def
"predicate"
word-prop
;
USING:
bootstrap.image.private
words
;
M:
word
prepare-object
;
USING:
accessors
present
words
;
M:
word
present
name>>
;
USING:
combinators
help.markup
kernel
words
;
M:
word
print-element
{
}
swap
( arg -- )
execute-effect
;
USING:
kernel
see
words
;
M:
word
print-stack-effect?
drop
t
;
USING:
kernel
sets
tools.crossref.private
words
;
M:
word
quot-uses
over
crossref?
[
adjoin
]
[
2drop
]
if
;
USING:
alien.prettyprint.private
prettyprint.sections
words
;
M:
word
record-c-type
record-vocab
;
USING:
alien.prettyprint.private
prettyprint.sections
words
;
M:
word
record-pointer
record-vocab
;
USING:
cpu.arm.32.assembler.private
words
;
M:
word
register
"register"
word-prop
;
USING:
cpu.arm.64.assembler.opcodes
words
;
M:
word
register
"ordinal"
word-prop
;
USING:
kernel
tools.annotations
tools.coverage
words
;
M:
word
remove-coverage
[
reset
]
[
"coverage"
remove-word-prop
]
bi
;
USING:
classes.private
kernel
words
;
M:
word
reset-class
drop
;
USING:
accessors
kernel
tools.coverage
words
;
M:
word
reset-coverage
[
dup
coverage-state?
[
f
>>executed?
]
when
drop
]
each-word
;
USING:
definitions
kernel
words
;
M:
word
reset-word
dup
flushable?
[
dup
changed-conditionally
]
when
{
"unannotated-def"
"parsing"
"inline"
"recursive"
"foldable"
"flushable"
"reading"
"writing"
"reader"
"writer"
"delimiter"
"deprecated"
}
remove-word-props
;
USING:
kernel
locals.rewrite
make
words
;
M:
word
rewrite-element
<wrapper>
,
;
USING:
generic
kernel
locals.backend
locals.errors
locals.rewrite
sequences
words
;
M:
word
rewrite-sugar*
dup
{
load-locals
get-local
drop-locals
}
member-eq?
[
>r/r>-in-lambda-error
]
[
M\
word
rewrite-sugar*
(call-next-method)
]
if
;
USING:
arrays
lint.private
words
;
M:
word
run-lint
1array
run-lint
;
USING:
tools.scaffold
words
;
M:
word
scaffold-docs
scaffold-word-docs
;
USING:
classes
generic
io
kernel
see
see.private
words
words.symbol
;
M:
word
see*
[
see-class
]
[
[
class?
]
[
symbol?
not
]
bi
and
[
nl
nl
]
when
]
[
dup
[
class?
]
[
symbol?
]
bi
and
[
drop
]
[
M\
word
see*
(call-next-method)
]
if
]
tri
;
USING:
kernel
see.private
words
;
M:
word
see-class*
drop
;
USING:
help.topics
kernel
words
;
M:
word
set-article-parent
swap
"help-parent"
set-word-prop
;
USING:
definitions
kernel
words
;
M:
word
set-where
swap
"loc"
set-word-prop
;
USING:
compiler.tree.propagation.inlining
words
;
M:
word
splicing-nodes
splicing-call
;
USING:
effects
kernel
words
;
M:
word
stack-effect
dup
"declared-effect"
word-prop
[
nip
]
[
parent-word
dup
[
stack-effect
]
when
]
if*
;
USING:
accessors
json
kernel
words
;
M:
word
stream-write-json
[
name>>
]
dip
stream-write-json
;
USING:
kernel
words
;
M:
word
subwords
drop
f
;
USING:
see
summary
words
;
M:
word
summary
synopsis
;
USING:
see
see.private
words
;
M:
word
synopsis*
word-synopsis
;
USING:
compiler.cfg.builder
compiler.cfg.debugger
kernel
words
;
M:
word
test-builder
[
build-optimized-tree
]
keep
build-cfg
;
USING:
accessors
arrays
help.html
kernel
words
;
M:
word
topic>filename*
dup
vocabulary>>
[
[
name>>
]
[
vocabulary>>
]
bi
2array
"word"
]
[
drop
f
f
]
if
;
USING:
accessors
tools.crossref
words
;
M:
word
uses
def>>
uses
;
USING:
help.topics
kernel
words
;
M:
word
valid-article?
drop
t
;
USING:
accessors
prettyprint.sections
words
;
M:
word
vocabulary-name
vocabulary>>
;
USING:
definitions
words
;
M:
word
where
"loc"
word-prop
;
USING:
cpu.arm.64.assembler.opcodes
words
;
M:
word
width
"width"
word-prop
;
USING:
effects
help
words
;
M:
word
word-help*
stack-effect
effect-help
;
USING:
kernel
prettyprint.backend
prettyprint.sections
words
;
M:
word
word-name*
[
?qualified-name
"( no name )"
or
]
[
record-vocab
]
bi
;
USING:
accessors
reports.noise
words
;
M:
word
word-noise-factor
def>>
quot-noise-factor
;
USING:
assocs
io.styles
kernel
namespaces
prettyprint.stylesheet
words
;
M:
word
word-style
[
presented
base-word-style
get
clone
[
set-at
]
keep
]
[
"word-style"
word-prop
]
bi
assoc-union!
;