@@ -40,13 +40,13 @@ and so on, returning the accumulated result.
40
40
41
41
Parameters:
42
42
43
- ls_ - The list to fold
43
+ ls - The list to fold
44
44
u - The initial value
45
45
f - The function to apply
46
46
*/
47
- fn foldl < T , U > ( ls_ : list < T > , u : U , f : block ( T , U ) -> U ) -> U {
47
+ fn foldl < T , U > ( ls : list < T > , u : U , f : block ( T , U ) -> U ) -> U {
48
48
let accum: U = u;
49
- let ls = ls_ ;
49
+ let ls = ls ;
50
50
while true {
51
51
alt ls {
52
52
cons( hd, tl) { accum = f ( hd, accum) ; ls = * tl; }
@@ -65,8 +65,8 @@ Apply function `f` to each element of `v`, starting from the first.
65
65
When function `f` returns true then an option containing the element
66
66
is returned. If `f` matches no elements then none is returned.
67
67
*/
68
- fn find < T , U > ( ls_ : list < T > , f : block ( T ) -> option:: t < U > ) -> option:: t < U > {
69
- let ls = ls_ ;
68
+ fn find < T , U > ( ls : list < T > , f : block ( T ) -> option:: t < U > ) -> option:: t < U > {
69
+ let ls = ls ;
70
70
while true {
71
71
alt ls {
72
72
cons( hd, tl) {
@@ -83,8 +83,8 @@ Function: has
83
83
84
84
Returns true if a list contains an element with the given value
85
85
*/
86
- fn has < T > ( ls_ : list < T > , elt : T ) -> bool {
87
- let ls = ls_ ;
86
+ fn has < T > ( ls : list < T > , elt : T ) -> bool {
87
+ let ls = ls ;
88
88
while true {
89
89
alt ls {
90
90
cons( hd, tl) { if elt == hd { ret true ; } else { ls = * tl; } }
0 commit comments