diff options
Diffstat (limited to '065duplex_list.mu')
-rw-r--r-- | 065duplex_list.mu | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/065duplex_list.mu b/065duplex_list.mu index fa3527fe..58b5468e 100644 --- a/065duplex_list.mu +++ b/065duplex_list.mu @@ -83,6 +83,18 @@ scenario duplex-list-handling [ ] ] +def length l:&:duplex-list:_elem -> result:num [ + local-scope + load-ingredients + result <- copy 0 + { + break-unless l + result <- add result, 1 + l <- next l + loop + } +] + # insert 'x' after 'in' def insert x:_elem, in:&:duplex-list:_elem -> in:&:duplex-list:_elem [ local-scope |