| 
									
										
										
										
											2009-02-06 05:38:31 -05:00
										 |  |  | ! Copyright (C) 2009 Slava Pestov. | 
					
						
							|  |  |  | ! See http://factorcode.org/license.txt for BSD license. | 
					
						
							| 
									
										
										
										
											2009-08-29 21:20:25 -04:00
										 |  |  | USING: accessors tools.test alien.complex classes.struct kernel | 
					
						
							|  |  |  | alien.c-types alien.syntax namespaces math ;
 | 
					
						
							| 
									
										
										
										
											2009-02-06 05:38:31 -05:00
										 |  |  | IN: alien.complex.tests | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-08-29 21:20:25 -04:00
										 |  |  | STRUCT: complex-holder | 
					
						
							|  |  |  |     { z complex-float } ;
 | 
					
						
							| 
									
										
										
										
											2009-02-06 05:38:31 -05:00
										 |  |  | 
 | 
					
						
							|  |  |  | : <complex-holder> ( z -- alien )
 | 
					
						
							| 
									
										
										
										
											2009-08-29 21:20:25 -04:00
										 |  |  |     complex-holder <struct-boa> ;
 | 
					
						
							| 
									
										
										
										
											2009-02-06 05:38:31 -05:00
										 |  |  | 
 | 
					
						
							|  |  |  | [ ] [ | 
					
						
							|  |  |  |     C{ 1.0 2.0 } <complex-holder> "h" set
 | 
					
						
							|  |  |  | ] unit-test | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-08-29 21:20:25 -04:00
										 |  |  | [ C{ 1.0 2.0 } ] [ "h" get z>> ] unit-test | 
					
						
							| 
									
										
										
										
											2009-08-10 17:17:33 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-02-21 13:28:42 -05:00
										 |  |  | [ complex ] [ complex-float c-type-boxed-class ] unit-test | 
					
						
							| 
									
										
										
										
											2009-08-10 17:17:33 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-02-21 13:28:42 -05:00
										 |  |  | [ complex ] [ complex-double c-type-boxed-class ] unit-test |