word ( -- * )
Factor documentation > Factor handbook > The language > Words > Word introspection
Next:word? ( object -- ? )


Vocabulary
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 } ;


USING: kernel ;

IN: words

: word ( -- * ) "dummy word" throw ;


Methods
USING: bootstrap.image.private words ;

M: word ' ;


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)
dup name>> swap vocabulary>> ast-identifier boa ;


USING: io.styles make prettyprint ui.tools.listener words ;

M: word (print-input)
"Command: "
[ "sans-serif" font-name ,, bold font-style ,, ] H{ } make
format . ;


USING: kernel tools.annotations.private words ;

M: word (reset)
dup "unannotated-def" word-prop [
dup dup "unannotated-def" word-prop define
f "unannotated-def" set-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: alien.data kernel sequences words ;

M: word >c-array c-array-type new clone-like ; inline


USING: assocs kernel ui.backend.gtk ui.pixel-formats words ;

M: word >gl-config-attribs
H{
{ stencil-bits { 13 } }
{ accum-red-bits { 14 } }
{ depth-bits { 12 } }
{ color-bits { 2 } }
{ accum-alpha-bits { 17 } }
{ green-bits { 9 } }
{ samples { 100001 } }
{ stereo { 6 } }
{ sample-buffers { 100000 } }
{ accum-green-bits { 15 } }
{ blue-bits { 10 } }
{ alpha-bits { 11 } }
{ aux-buffers { 7 } }
{ double-buffered { 5 } }
{ red-bits { 8 } }
{ accum-blue-bits { 16 } }
} at [ { } ] unless* ;


USING: combinators kernel words ;

M: word ?execute ( -- value ) execute-effect ; 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.prettyprint.private kernel
prettyprint.sections words ;

M: word c-type-string [ record-vocab ] [ name>> ] bi ;


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.categories 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 quotations sequences sequences.deep
tools.coverage.private words ;

M: word count-callables
def>> [ callable? ] deep-filter length ;


USING: accessors assocs kernel tools.coverage words ;

M: word coverage
"coverage" word-prop >alist
[ drop executed?>> not ] assoc-filter 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: kernel kernel.private words ;

M: word execute (execute) ;


USING: kernel macros.expander words ;

M: word expand-macros*
dup expand-dispatch?
[ drop expand-dispatch ]
[ dup expand-macro? [ expand-macro ] [ drop word, ] if ] if
;


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 ] 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 string-lines "factor"
highlight-lines ;


USING: kernel math.partial-dispatch words ;

M: word integer-op-input-classes
dup "input-classes" word-prop [ ] [ bad-integer-op ] ?if ;


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
dup "c-type" word-prop resolve-typedef
[ ] [ no-c-type ] ?if ;


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.prettyprint.private kernel
prettyprint.sections words ;

M: word pointer-string [ record-vocab ] [ name>> ] bi ;


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: 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: cpu.arm.assembler.private words ;

M: word register "register" word-prop ;


USING: kernel tools.annotations tools.coverage words ;

M: word remove-coverage
[ reset ] [ f "coverage" set-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"
} reset-props ;


USING: accessors alien.parser.private words ;

M: word return-type-name name>> ;


USING: kernel locals.rewrite.sugar make words ;

M: word rewrite-element <wrapper> , ;


USING: generic kernel locals.backend locals.errors
locals.rewrite.sugar 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: 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
[ "declared-effect" word-prop ]
[ parent-word dup [ stack-effect ] when ] bi or ;


USING: accessors json.writer kernel words ;

M: word stream-json-print [ name>> ] dip stream-json-print ;


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
compiler.cfg.registers compiler.tree.builder
compiler.tree.optimizer kernel namespaces words ;

M: word test-builder
0 vreg-counter set-global [ build-tree optimize-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: classes classes.algebra words ;

M: word valid-classoid? class? ;


USING: accessors prettyprint.sections words ;

M: word vocabulary-name vocabulary>> ;


USING: definitions words ;

M: word where "loc" word-prop ;


USING: help kernel words ;

M: word word-help* drop f ;


USING: accessors kernel prettyprint.backend
prettyprint.sections words ;

M: word word-name*
[ name>> "( no name )" or ] [ record-vocab ] bi ;


USING: accessors reports.noise words ;

M: word word-noise-factor def>> quot-noise-factor ;


USING: assocs hashtables io.styles kernel
prettyprint.stylesheet words ;

M: word word-style
[ presented associate ]
[ "word-style" word-prop >hashtable ] bi assoc-union ;


USING: accessors mason.test words ;

M: word word-vocabulary vocabulary>> ;