diff options
Diffstat (limited to 'sucl')
-rw-r--r-- | sucl/basic.dcl | 3 | ||||
-rw-r--r-- | sucl/basic.icl | 3 | ||||
-rw-r--r-- | sucl/graph.icl | 2 |
3 files changed, 6 insertions, 2 deletions
diff --git a/sucl/basic.dcl b/sucl/basic.dcl index 27c170d..c6057ec 100644 --- a/sucl/basic.dcl +++ b/sucl/basic.dcl @@ -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 diff --git a/sucl/basic.icl b/sucl/basic.icl index 0953741..7ba2c51 100644 --- a/sucl/basic.icl +++ b/sucl/basic.icl @@ -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) ' ')] diff --git a/sucl/graph.icl b/sucl/graph.icl index 2929125..076220b 100644 --- a/sucl/graph.icl +++ b/sucl/graph.icl @@ -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. |