about summary refs log tree commit diff stats
path: root/074list.mu
diff options
context:
space:
mode:
Diffstat (limited to '074list.mu')
-rw-r--r--074list.mu9
1 files changed, 9 insertions, 0 deletions
diff --git a/074list.mu b/074list.mu
index 5244deec..79fed038 100644
--- a/074list.mu
+++ b/074list.mu
@@ -47,6 +47,15 @@ scenario list-handling [
   ]
 ]
 
+def length l:address:list:_elem -> result:number [
+  local-scope
+  load-ingredients
+  return-unless l, 0
+  rest:address:list:_elem <- rest l
+  length-of-rest:number <- length rest
+  result <- add length-of-rest, 1
+]
+
 def to-text in:address:list:_elem -> result:address:array:character [
   local-scope
   load-ingredients