]> gitweb.factorcode.org Git - factor.git/blob - core/init/init.factor
953340b985a5c064ece12fbc4516ba5e7b50e22d
[factor.git] / core / init / init.factor
1 ! Copyright (C) 2004, 2008 Slava Pestov.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: continuations continuations.private kernel
4 kernel.private sequences assocs namespaces namespaces.private ;
5 IN: init
6
7 SYMBOL: init-hooks
8
9 init-hooks global [ drop V{ } clone ] cache drop
10
11 : do-init-hooks ( -- )
12     init-hooks get [ nip call ] assoc-each ;
13
14 : add-init-hook ( quot name -- )
15     dup init-hooks get at [ over call ] unless
16     init-hooks get set-at ;
17
18 : boot ( -- ) init-namespaces init-catchstack init-error-handler ;
19
20 : boot-quot ( -- quot ) 20 getenv ;
21
22 : set-boot-quot ( quot -- ) 20 setenv ;