home
/
code
/
tiger.ml.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
Test every book test case
[tiger.ml.git]
/
compiler
/
testcases
/
test04.tig
diff --git a/compiler/testcases/test04.tig
b/compiler/testcases/test04.tig
new file mode 100644
(file)
index 0000000..
59fd5b8
--- /dev/null
+++ b/
compiler/testcases/test04.tig
@@ -0,0
+1,13
@@
+/* define a recursive function */
+let
+
+/* calculate n! */
+function nfactor(n: int): int =
+ if n = 0
+ then 1
+ else n * nfactor(n-1)
+
+in
+ nfactor(10)
+end
+
This page took
0.026554 seconds
and
4
git commands to generate.