| 
									
										
										
										
											2010-03-30 21:47:48 -04:00
										 |  |  | ! Copyright (C) 2007, 2010 Slava Pestov. | 
					
						
							| 
									
										
										
										
											2007-09-20 18:09:08 -04:00
										 |  |  | ! See http://factorcode.org/license.txt for BSD license. | 
					
						
							| 
									
										
										
										
											2011-11-30 19:02:37 -05:00
										 |  |  | USING: assocs init kernel.private namespaces ;
 | 
					
						
							| 
									
										
										
										
											2009-05-02 14:45:38 -04:00
										 |  |  | IN: system | 
					
						
							| 
									
										
										
										
											2007-09-20 18:09:08 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-05-20 18:11:50 -04:00
										 |  |  | SINGLETONS: x86.32 x86.64 arm ppc.32 ppc.64 ;
 | 
					
						
							| 
									
										
										
										
											2008-04-02 17:32:58 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-04-02 18:07:38 -04:00
										 |  |  | UNION: x86 x86.32 x86.64 ;
 | 
					
						
							| 
									
										
										
										
											2011-05-20 18:11:50 -04:00
										 |  |  | UNION: ppc ppc.32 ppc.64 ;
 | 
					
						
							| 
									
										
										
										
											2008-04-02 18:07:38 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-10-02 06:15:05 -04:00
										 |  |  | : cpu ( -- class ) \ cpu get-global ; foldable
 | 
					
						
							| 
									
										
										
										
											2008-04-02 17:32:58 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-11-02 20:13:31 -04:00
										 |  |  | SINGLETONS: windows macosx linux ;
 | 
					
						
							| 
									
										
										
										
											2008-04-02 19:25:33 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-11-02 20:13:31 -04:00
										 |  |  | UNION: unix macosx linux ;
 | 
					
						
							| 
									
										
										
										
											2008-04-02 17:32:58 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-10-02 06:15:05 -04:00
										 |  |  | : os ( -- class ) \ os get-global ; foldable
 | 
					
						
							| 
									
										
										
										
											2008-04-02 17:32:58 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-03-01 16:32:07 -05:00
										 |  |  | : vm-compiler ( -- string ) \ vm-compiler get-global ; foldable
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-04-02 18:07:38 -04:00
										 |  |  | <PRIVATE
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | : string>cpu ( str -- class )
 | 
					
						
							|  |  |  |     H{ | 
					
						
							|  |  |  |         { "x86.32" x86.32 } | 
					
						
							|  |  |  |         { "x86.64" x86.64 } | 
					
						
							|  |  |  |         { "arm" arm } | 
					
						
							| 
									
										
										
										
											2011-05-20 18:11:50 -04:00
										 |  |  |         { "ppc.32" ppc.32 } | 
					
						
							|  |  |  |         { "ppc.64" ppc.64 } | 
					
						
							| 
									
										
										
										
											2008-04-02 18:07:38 -04:00
										 |  |  |     } at ;
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-04-02 19:25:33 -04:00
										 |  |  | : string>os ( str -- class )
 | 
					
						
							|  |  |  |     H{ | 
					
						
							| 
									
										
										
										
											2011-09-18 21:25:06 -04:00
										 |  |  |         { "windows" windows } | 
					
						
							| 
									
										
										
										
											2008-04-02 19:25:33 -04:00
										 |  |  |         { "macosx" macosx } | 
					
						
							|  |  |  |         { "linux" linux } | 
					
						
							|  |  |  |     } at ;
 | 
					
						
							| 
									
										
										
										
											2008-04-02 18:07:38 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-04-02 19:25:33 -04:00
										 |  |  | PRIVATE>
 | 
					
						
							| 
									
										
										
										
											2008-04-02 17:32:58 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-09-18 23:08:12 -04:00
										 |  |  | : image ( -- path ) \ image get-global ;
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | : vm ( -- path ) \ vm get-global ;
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-11-02 15:54:31 -04:00
										 |  |  | : embedded? ( -- ? ) OBJ-EMBEDDED special-object ;
 | 
					
						
							| 
									
										
										
										
											2008-11-19 02:50:05 -05:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-03-30 21:47:48 -04:00
										 |  |  | : exit ( n -- * ) do-shutdown-hooks (exit) ;
 |