Skip to content

Commit dc6fc16

Browse files
committed
---
yaml --- r: 2801 b: refs/heads/master c: 83cdb47 h: refs/heads/master i: 2799: abe3bea v: v3
1 parent 668ba1a commit dc6fc16

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: fc31aa7f85796275bcbdd836c8bd4dae60442dcc
2+
refs/heads/master: 83cdb47a7ce5285b815e4c11b1b0151d79391f58

trunk/src/lib/list.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,20 @@ fn car[T](&list[T] ls) -> T {
7070
}
7171
}
7272

73+
74+
fn append[T](&list[T] l, &list[T] m) -> list[T] {
75+
alt (l) {
76+
case (nil[T]) {
77+
ret m;
78+
}
79+
case (cons[T](?x, ?xs)) {
80+
let list[T] rest = append[T](*xs, m);
81+
ret cons[T](x, @rest);
82+
}
83+
}
84+
}
85+
86+
7387
// Local Variables:
7488
// mode: rust;
7589
// fill-column: 78;

0 commit comments

Comments
 (0)