higher-order defun

This commit is contained in:
2026-07-12 20:58:10 -06:00
parent 4522e455dd
commit 269d956566
8 changed files with 194 additions and 46 deletions
+9 -1
View File
@@ -1,14 +1,18 @@
(module
(type (sub (struct (field (mut i32)))))
(type $heap-object (sub (struct (field (mut i32)))))
(func
(param)
(result (ref eq))
(local (ref eq) (ref eq) (ref eq) (ref eq) (ref eq))
(i32.const 3)
(i32.const 2)
i32.shl
ref.i31
(ref.cast (ref i31))
i31.get_s
(i32.const 4)
(i32.const 2)
i32.shl
ref.i31
(ref.cast (ref i31))
i31.get_s
@@ -16,10 +20,14 @@
ref.i31
(local.set 0)
(i32.const 2)
(i32.const 2)
i32.shl
ref.i31
(ref.cast (ref i31))
i31.get_s
(i32.const 5)
(i32.const 2)
i32.shl
ref.i31
(ref.cast (ref i31))
i31.get_s