HCoop
/
hcoop
/
debian
/
mlton.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
blame
|
history
|
raw
|
HEAD
Import Upstream version 20180207
[hcoop/debian/mlton.git]
/
regression
/
local-ref.sml
1
2
local
3
val
c
=
ref
0
4
in
5
fun
fib n
6
=
let
7
val
_
=
if
!
c
mod
5
=
0
8
then
print
(
concat
[
Int
.
toString
(!
c
),
9
"th invocation of fib
\n
"
])
10
else
()
11
val
_
=
c
:= !
c
+
1
12
in
13
case
n
14
of
0
=>
1
15
|
1
=>
1
16
| n
=> (
fib
(
n
-
1
)) + (
fib
(
n
-
2
))
17
end
18
end
19
20
val
n
=
fib
5
21
22
val
_
=
print
(
concat
[
"fib(5) = "
,
Int
.
toString n
,
"
\n
"
])