Skip to content

Fix destructuring (_)#417

Draft
basil-conto wants to merge 1 commit intomasterfrom
blc/setq
Draft

Fix destructuring (_)#417
basil-conto wants to merge 1 commit intomasterfrom
blc/setq

Conversation

@basil-conto
Copy link
Copy Markdown
Collaborator

Currently dash--match-cons pops leading _ placeholders before checking whether match-form contains only a single pattern.

This PR swaps these around, so that we check for a single pattern even if match-form is (_).

This attempts to address #391.
Cc: @ComedyTomedy

* dash.el (dash--match-cons): Check for single pattern before
popping leading _ placeholders.

Fixes #391.
@basil-conto basil-conto added the bug Existing behavior is incorrect label Mar 11, 2025
@basil-conto basil-conto added this to the 2.20.0 milestone Mar 11, 2025
@basil-conto basil-conto self-assigned this Mar 11, 2025
@basil-conto basil-conto requested a review from Fuco1 March 11, 2025 17:56
@basil-conto basil-conto linked an issue Mar 11, 2025 that may be closed by this pull request
@basil-conto
Copy link
Copy Markdown
Collaborator Author

Hm, no, this isn't right: we still want (_ _ x) to count as a single pattern.

@basil-conto basil-conto modified the milestones: 2.20.0, 2.21.0 Mar 11, 2025
@basil-conto basil-conto marked this pull request as draft March 11, 2025 20:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Existing behavior is incorrect

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: can't destructure to nothing

1 participant