Skip to content

Commit

Permalink
Fix typo in RFC #52.
Browse files Browse the repository at this point in the history
  • Loading branch information
whitequark authored Sep 5, 2024
1 parent f4e3de1 commit 4352e0d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions text/0052-choice.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ In addition, the existing `Mux` expression is made valid on the left-hand side o

```py
def Mux(sel, val1, val0):
return Choice(a).case(0, val0).default(val1)
return Choice(sel).case(0, val0).default(val1)
```

`ArrayProxy` (ie. the type currently returned by `Array` indexing) is changed from a native `Value` to a `ValueCastable` that lowers to `Choice` (removing the odd case where we can currently build an invaid `Value`). To avoid problems with lowering the out-of-bounds case, the value returned for out-of-bounds `Array` accesses is changed to 0.
Expand Down Expand Up @@ -180,4 +180,4 @@ The name is subject to bikeshed. An obvious alternative is `Match`, though this
## Future possibilities
[future-possibilities]: #future-possibilities

Optional guard conditions could be added to `Choice` and `m.Switch` cases (like Rust's `if` guards on `match` branches).
Optional guard conditions could be added to `Choice` and `m.Switch` cases (like Rust's `if` guards on `match` branches).

0 comments on commit 4352e0d

Please sign in to comment.