| 
									
										
										
										
											2008-07-28 23:03:13 -04:00
										 |  |  | ! Copyright (C) 2004, 2008 Slava Pestov. | 
					
						
							| 
									
										
										
										
											2007-09-20 18:09:08 -04:00
										 |  |  | ! See http://factorcode.org/license.txt for BSD license. | 
					
						
							|  |  |  | USING: continuations continuations.private kernel | 
					
						
							|  |  |  | kernel.private sequences assocs namespaces namespaces.private ;
 | 
					
						
							|  |  |  | IN: init | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | SYMBOL: init-hooks | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | init-hooks global [ drop V{ } clone ] cache drop
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | : do-init-hooks ( -- )
 | 
					
						
							|  |  |  |     init-hooks get [ nip call ] assoc-each ;
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | : add-init-hook ( quot name -- )
 | 
					
						
							|  |  |  |     dup init-hooks get at [ over call ] unless
 | 
					
						
							|  |  |  |     init-hooks get set-at ;
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-07-28 23:03:13 -04:00
										 |  |  | : boot ( -- ) init-namespaces init-catchstack init-error-handler ;
 | 
					
						
							| 
									
										
										
										
											2007-09-20 18:09:08 -04:00
										 |  |  | 
 | 
					
						
							|  |  |  | : boot-quot ( -- quot ) 20 getenv ;
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | : set-boot-quot ( quot -- ) 20 setenv ;
 |