Elixir: Multi-clause functions and interpolated strings#614
Merged
dimitris-m merged 2 commits intomainfrom Mar 17, 2026
Merged
Conversation
dimitris-m
reviewed
Mar 16, 2026
dimitris-m
reviewed
Mar 16, 2026
dimitris-m
reviewed
Mar 16, 2026
| | None -> S (D (FuncDef [ clause ])) :: group_func_clauses rest | ||
| | Some key -> | ||
| let rec take_matching acc = function | ||
| | S (D (FuncDef [ c ])) :: tl when func_clause_key c = Some key -> |
Collaborator
There was a problem hiding this comment.
polymorphic equality which I guess is unavoidable as long as the key is defined as is, but maybe if it was a record with derived equality ....
Contributor
Author
There was a problem hiding this comment.
I introduced a separate type with (hand-defined, but not polymorphic) equality
0a8ebc1 to
26ab1dd
Compare
dimitris-m
approved these changes
Mar 17, 2026
Contributor
Author
|
Closes #602 |
tmeijn
pushed a commit
to tmeijn/dotfiles
that referenced
this pull request
Mar 25, 2026
This MR contains the following updates: | Package | Update | Change | |---|---|---| | [opengrep/opengrep](https://github.com/opengrep/opengrep) | patch | `v1.16.4` → `v1.16.5` | MR created with the help of [el-capitano/tools/renovate-bot](https://gitlab.com/el-capitano/tools/renovate-bot). **Proposed changes to behavior should be submitted there as MRs.** --- ### Release Notes <details> <summary>opengrep/opengrep (opengrep/opengrep)</summary> ### [`v1.16.5`](https://github.com/opengrep/opengrep/releases/tag/v1.16.5): Opengrep 1.16.5 [Compare Source](opengrep/opengrep@v1.16.4...v1.16.5) #### Improvements - Improvements in recognizing language-specific built-in functions in intrafile tainting by [@​corneliuhoffman](https://github.com/corneliuhoffman) in [#​617](opengrep/opengrep#617) - Elixir: Support for multi-clause functions and interpolated strings by [@​maciejpirog](https://github.com/maciejpirog) in [#​614](opengrep/opengrep#614) **Full Changelog**: <opengrep/opengrep@v1.16.4...v1.16.5> </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever MR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this MR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box --- This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My44OS42IiwidXBkYXRlZEluVmVyIjoiNDMuODkuNiIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiUmVub3ZhdGUgQm90IiwiYXV0b21hdGlvbjpib3QtYXV0aG9yZWQiLCJkZXBlbmRlbmN5LXR5cGU6OnBhdGNoIl19-->
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR fixes two things:
Multi-clause functions
Functions can be defined via multiple clauses, like:
Before: these were understood as two separate functions with the same name (+
whenclauses were not supported).After: they are the same function (+
whenclauses work now).Note that the mechanism works slightly differently than in Clojure, because in Elixir two functions with the same name but different arities are actually two functions. For example, the following code defines two functions:
Interpolated strings
They didn't work before, they work now