Support pattern-matching in comprehensions
Open
feature
partially resolved
- Dominant language
- Python
- Stars
- 4.4k
- Forks
- 142
- PR merge metrics
- No merged PRs in 30d
Description
Should compile
```python
[a + b for Pair(a, b) in pairs]
```
or
```python
[a + b match for Pair(a, b) in pairs]
```
into the equivalent of
```python
[(def (Pair(a, b)) => a + b)(p) for p in pairs]
```
Contributor guide
Research direction
Start by tracing Coconut’s compiler handling for comprehensions and pattern matching, using the issue’s two proposed forms as the cases to investigate. Confirm that the implementation produces the shown equivalent behavior for Pair(a, b) over pairs, and add focused tests for the supported syntax and result.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- compilers
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100