Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
clean-compiler-and-rts
compiler
Commits
cdb87fef
Commit
cdb87fef
authored
Aug 17, 2001
by
Vincent Zweije
Browse files
Move inccounter function to basic module
parent
2a0b3c13
Changes
3
Hide whitespace changes
Inline
Side-by-side
sucl/basic.dcl
View file @
cdb87fef
...
...
@@ -82,6 +82,9 @@ indent :: .String -> .([.String] -> .[String])
// `Identifiers' is the list of all identifiers
identifiers
::
[
String
]
// `Inccounter m f' increments counting function f by one at point m.
inccounter
::
a
(
a
->
b
)
a
->
b
|
==
a
&
+,
one
b
// `Intersect xs ys' is the intersection of list `ys' with list `xs'.
intersect
::
![
elem
]
[
elem
]
->
.[
elem
]
|
==
elem
...
...
sucl/basic.icl
View file @
cdb87fef
...
...
@@ -109,6 +109,9 @@ forget :: val -> .(![.(val,res)] -> .[(val,res)]) | == val
forget
x
=
filter
(
neq
x
o
fst
)
neq
x
y
=
x
<>
y
inccounter
::
a
(
a
->
b
)
a
->
b
|
==
a
&
+,
one
b
inccounter
m
f
n
=
if
(
n
==
m
)
(
f
n
+
one
)
(
f
n
)
indent
::
.
String
->
.([.
String
]
->
.[
String
])
indent
first
=
map2
(+++)
[
first
:
repeat
(
createArray
(
size
first
)
' '
)]
...
...
sucl/graph.icl
View file @
cdb87fef
...
...
@@ -178,8 +178,6 @@ refcount graph roots
where
count`
=
inccounter
var
count
(
def
,(_,
args
))
=
varcontents
graph
var
inccounter
m
f
n
=
if
(
n
==
m
)
(
f
n
+1
)
(
f
n
)
/*
Compilegraph compiles a graph from parts.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment