forked from MightyPork/crsn
Routine arity disambiguation, slash syntax (add/2, add/3)
This commit is contained in:
@@ -0,0 +1,48 @@
|
||||
(
|
||||
(call slash 1)
|
||||
(cmp res0 1 (ne? (fault)))
|
||||
|
||||
(call named 2)
|
||||
(cmp res0 2 (ne? (fault)))
|
||||
|
||||
(call both 3)
|
||||
(cmp res0 3 (ne? (fault)))
|
||||
|
||||
(call slash 1 2)
|
||||
(cmp res0 1 (ne? (fault)))
|
||||
(cmp res1 2 (ne? (fault)))
|
||||
|
||||
(call named 2 3)
|
||||
(cmp res0 2 (ne? (fault)))
|
||||
(cmp res1 3 (ne? (fault)))
|
||||
|
||||
(call both 3 4)
|
||||
(cmp res0 3 (ne? (fault)))
|
||||
(cmp res1 4 (ne? (fault)))
|
||||
|
||||
(halt)
|
||||
|
||||
(proc slash/1
|
||||
(ret arg0)
|
||||
)
|
||||
|
||||
(proc slash/2
|
||||
(ret arg0 arg1)
|
||||
)
|
||||
|
||||
(proc named a
|
||||
(ret a)
|
||||
)
|
||||
|
||||
(proc named a b
|
||||
(ret a b)
|
||||
)
|
||||
|
||||
(proc both/1 a
|
||||
(ret a)
|
||||
)
|
||||
|
||||
(proc both/2 a b
|
||||
(ret a b)
|
||||
)
|
||||
)
|
||||
@@ -3,7 +3,7 @@
|
||||
(ld r0 res0)
|
||||
(halt)
|
||||
|
||||
(proc fac
|
||||
(proc fac/1
|
||||
(cmp arg0 2
|
||||
(eq? (ret 2)))
|
||||
(sub r0 arg0 1)
|
||||
|
||||
Reference in New Issue
Block a user