Skip to content

Commit a7fdb38

Browse files
fix(stdlib): rename as param/var -> xs in collections (#135 slice 6b) (#158)
#135 slice 6b — keyword-as-identifier (sibling of slice 6). `zip` and `unzip` in collections.affine used `as` as a parameter/variable name; `as` is the AS keyword (cast/import-alias), so it could not parse in binding position. Renamed `as` -> `xs` (the `bs` companion is not a keyword, left as-is). Pure stdlib rename — zero grammar/compiler change, zero risk. Effect: collections.affine clears its last parse wall (was PARSE 40:13) and advances to RESOLVE (module-resolution, slice 8 class). Suite unaffected (stdlib-only). Advances #135. Refs #128, #135. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent c6305b9 commit a7fdb38

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

stdlib/collections.affine

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,23 +37,23 @@ fn drop<T>(n: Int, list: [T]) -> [T] {
3737
}
3838

3939
/// Zip two lists together
40-
fn zip<A, B>(as: [A], bs: [B]) -> [(A, B)] {
41-
if len(as) == 0 || len(bs) == 0 {
40+
fn zip<A, B>(xs: [A], bs: [B]) -> [(A, B)] {
41+
if len(xs) == 0 || len(bs) == 0 {
4242
[]
4343
} else {
44-
[(as[0], bs[0])] ++ zip(as[1:], bs[1:])
44+
[(xs[0], bs[0])] ++ zip(xs[1:], bs[1:])
4545
}
4646
}
4747

4848
/// Unzip a list of pairs
4949
fn unzip<A, B>(pairs: [(A, B)]) -> ([A], [B]) {
50-
let as = [];
50+
let xs = [];
5151
let bs = [];
5252
for (a, b) in pairs {
53-
as = as ++ [a];
53+
xs = xs ++ [a];
5454
bs = bs ++ [b];
5555
}
56-
(as, bs)
56+
(xs, bs)
5757
}
5858

5959
/// Find first element matching predicate

0 commit comments

Comments
 (0)