| 
									
										
										
										
											2009-01-21 00:06:23 -05:00
										 |  |  | ! Copyright (C) 2009 Slava Pestov. | 
					
						
							|  |  |  | ! See http://factorcode.org/license.txt for BSD license. | 
					
						
							| 
									
										
										
										
											2014-12-13 19:25:59 -05:00
										 |  |  | USING: alien assocs byte-arrays core-foundation | 
					
						
							|  |  |  | core-foundation.arrays core-foundation.data | 
					
						
							|  |  |  | core-foundation.dictionaries core-foundation.numbers | 
					
						
							|  |  |  | core-foundation.strings destructors hashtables kernel math | 
					
						
							|  |  |  | sequences strings ;
 | 
					
						
							| 
									
										
										
										
											2009-01-21 00:06:23 -05:00
										 |  |  | IN: core-foundation.utilities | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | GENERIC: (>cf) ( obj -- cf )
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | M: number (>cf) <CFNumber> ;
 | 
					
						
							|  |  |  | M: t (>cf) <CFNumber> ;
 | 
					
						
							|  |  |  | M: f (>cf) <CFNumber> ;
 | 
					
						
							|  |  |  | M: string (>cf) <CFString> ;
 | 
					
						
							|  |  |  | M: byte-array (>cf) <CFData> ;
 | 
					
						
							|  |  |  | M: hashtable (>cf) [ [ (>cf) &CFRelease ] bi@ ] assoc-map <CFDictionary> ;
 | 
					
						
							|  |  |  | M: sequence (>cf) [ (>cf) &CFRelease ] map <CFArray> ;
 | 
					
						
							|  |  |  | M: alien (>cf) CFRetain ;
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-12-13 19:25:59 -05:00
										 |  |  | : >cf ( obj -- cf ) [ (>cf) ] with-destructors ;
 |