@@ -30,27 +30,16 @@ test3 = STRUCT [DOUBLE, DOUBLE, I8, I64]
3030test4 : Composite
3131test4 = PACKEDSTRUCT [I8, I8, I8, I64]
3232
33−printMore : IO ()
34−printMore = do
35− p <- alloc test3
36− f3 <- return $ (test3 # 1) p
37− a <- peek DOUBLE f3
38− printLn a
39− free p
40− fms <- return $ (test2#0) !mystruct
41− poke I32 fms 122
42− print_mystruct
43− printLn test4
44− printLn !size1
45− printLn !size2
46− printLn $ fields test3
47− printLn $ offsets (STRUCT [I8, I8, I8, I64, test3])
48− printLn $ sizeOf (ARRAY 67 I32)
49− printLn $ sizeOf test1
50− printLn $ sizeOf test2
51−
5233main : IO ()
5334main = do
5435 printLn $ sizeOf test1 == !size1
5536 printLn $ sizeOf test2 == !size2
56−-- printMore
37+ fms <- return $ (test2#0) !mystruct
38+ poke I32 fms 122
39+ print_mystruct
40+ printLn $ fields test3
41+ withAlloc test2 $ \p => do
42+ f1 <- return $ (test2 # 0) p
43+ poke I32 f1 8
44+ update I32 f1 (* 2)
45+ print !(peek I32 f1)