Handbook
Glossary
add-startup-hook ( quot name -- )
Factor handbook
»
The implementation
»
Initialization and startup
Prev:
do-startup-hooks ( -- )
Next:
add-shutdown-hook ( quot name -- )
Vocabulary
init
Inputs
quot
a
quotation
name
a
string
Outputs
None
Word description
Registers a startup hook. The hook will always run when Factor is started. If the hook was not already defined, this word also calls it immediately.
See also
startup-hooks
,
do-startup-hooks
,
add-shutdown-hook
,
do-shutdown-hooks
,
shutdown-hooks
Definition
USING:
assocs
combinators
kernel
namespaces
;
IN:
init
:
add-startup-hook
( quot name -- )
startup-hooks
get
[
at
[
drop
]
[
( -- )
call-effect
]
if
]
[
set-at
]
3bi
;