This repository has been archived on 2024-01-18. You can view files and clone it, but cannot push or open issues or pull requests.
compilation/flap/tests/02-Interpreter/66-concat.eval.hopix.human-readable

26 lines
383 B
Text
Raw Permalink Normal View History

2023-10-25 15:16:53 +02:00
fun concat (l1, l2) =
match (l1) {
| N -> l2
| C (x, xs) -> C (x, concat (xs, l2))
}
let l = C (1, C (2, N))
let l = concat (l, l)
let l = concat (l, l)
let l = concat (l, l)
let l = concat (l, l)
let l = concat (l, l)
let l = concat (l, l)
fun len (l) =
match (l) {
| N -> 0
| C (x, xs) -> 1 + len (xs)
}
let test =
print_int (len (l));
print_string ("\n")