Skip to content

Parameter names in types.newfunction#196

Open
DavidLoveLuau wants to merge 8 commits intoluau-lang:masterfrom
DavidLoveLuau:types-newfunction-named-parameters
Open

Parameter names in types.newfunction#196
DavidLoveLuau wants to merge 8 commits intoluau-lang:masterfrom
DavidLoveLuau:types-newfunction-named-parameters

Conversation

@DavidLoveLuau
Copy link
Copy Markdown

@DavidLoveLuau DavidLoveLuau commented Apr 12, 2026

RFC: Parameter names in types.newfunction

This RFC proposes adding the ability to specify parameter names when dynamically constructing function types using types.newfunction()

This will significantly improve readability and developer experience when working with dynamically generated function types in User-Defined Type Functions

RFC file: docs/types-newfunction-named-parameters.md

@DavidLoveLuau DavidLoveLuau changed the title types.newfunction named parameters Parameter names in types.newfunction Apr 12, 2026
@itsmath
Copy link
Copy Markdown

itsmath commented Apr 12, 2026

Also, as time goes on since I made my RFC on the same topic, I'm starting to think that this is only going to get accepted if there's a nicer solution that doesn't break backwards compatibility (you say this solution doesn't break it, but it does, specifically because of the :parameters() function).

So I'm thinking that we'll probably need to do something closer to my original idea using SoA instead of AoS

@DavidLoveLuau
Copy link
Copy Markdown
Author

Also, as time goes on since I made my RFC on the same topic, I'm starting to think that this is only going to get accepted if there's a nicer solution that doesn't break backwards compatibility (you say this solution doesn't break it, but it does, specifically because of the :parameters() function).

So I'm thinking that we'll probably need to do something closer to my original idea using SoA instead of AoS

Thanks for the feedback!

I agree that backwards compatibility is important. While my current proposal tries to extend the existing setparameters() / :parameters() API with minimal disruption, I also see the potential issues you mentioned.

Your original idea using SoA style instead of AoS actually sounds quite clean and might indeed be a nicer long-term solution. I really like that direction as well.

Honestly, I would be happy if either of our approaches gets accepted

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants