Skip to content

add FixKw, a companion to Fix{N}#55711

Open
matthias314 wants to merge 2 commits into
JuliaLang:masterfrom
matthias314:m3/fixkw
Open

add FixKw, a companion to Fix{N}#55711
matthias314 wants to merge 2 commits into
JuliaLang:masterfrom
matthias314:m3/fixkw

Conversation

@matthias314

Copy link
Copy Markdown
Contributor

Keyword arguments are mentioned several times in the discussion of the recent Fix{N} PR #54653. However, support for them was dropped in the end. I don't know if that was to keep Fix{N} simple or for more fundamental reasons. I would like to propose FixKw as a way to do for keyword arguments what Fix{N} does for positional arguments. I think it should exist for the sake of completeness. It is also helpful because map, reduce and the like don't allow to pass keyword arguments to the function one uses.

I've chosen the name FixKw to resemble Fix although the "fixed" keyword arguments can still be overridden. I'm open to other names.

Please let me know what you think. If you like it, I can add tests and update NEWS.md.

@Roger-luo

Copy link
Copy Markdown
Contributor

Should this extend Fix instead of having a new struct? E.g if we consider the senario of fixing kwargs it's also possible to fix some args and some kwargs.

@matthias314

Copy link
Copy Markdown
Contributor Author

That's of course debatable. However, if one wants to fix two positional arguments, then there is also no functionality at present to combine them. FixKw allows to combine several keyword arguments because that's not more complicated than a single one.

@nsajko nsajko added feature Indicates new feature / enhancement requests design Design of APIs or of the language itself needs tests Unit tests are required for this change labels Sep 8, 2024
@matthias314

Copy link
Copy Markdown
Contributor Author

Are you interested in moving forward with this?

I think that there should be some functionality to fix keyword arguments, be it this proposal or some other solution.

@nsajko nsajko added the needs news A NEWS entry is required for this change label Sep 18, 2024
@nsajko nsajko added the keyword arguments f(x; keyword=arguments) label Aug 24, 2025
@nsajko

nsajko commented Aug 24, 2025

Copy link
Copy Markdown
Member

Fixes #59375

@DilumAluthge

Copy link
Copy Markdown
Member

I'll mark this for triage. The questions for triage are:

  1. Do we want this functionality in Base?
  2. If we do want this functionality, should it be a new struct, or should it be added to Base.Fix?

@DilumAluthge DilumAluthge added triage This should be discussed on a triage call status: waiting for triage feedback labels Apr 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

design Design of APIs or of the language itself feature Indicates new feature / enhancement requests keyword arguments f(x; keyword=arguments) needs news A NEWS entry is required for this change needs tests Unit tests are required for this change status: waiting for triage feedback triage This should be discussed on a triage call

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants