You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, SP_MAX_EXEC_PARAMS is set to 32, making it so that function calls cannot contain more than 32 parameters. This, importantly, makes it so that very large formatting class calls cannot be made without formatting multiple times in a row, which can be unacceptable in some cases (Such as using Sourcemod translations). Here's an example from a project of mine Showing how many formatting parameters I need and how I am being limited by the maximum parameters.
Additionally, there is currently absolutely no way to manipulate variadic parameters in any way other than using them in VFormat. You cannot grab individual entries in the parameter stack, nor can you pass along the entire stack to another method.
It is difficult to write clean-looking overloads for a method without being able to pass along variadic parameters. Additionally, a somewhat clean workaround for the first issue I described would be possible if I could iterate over the variadic parameters in chunks of <32 until the format is finished.
I can't say I know what the best solution for this codebase would be, but I would really like to see some improvements to variadic parameters. The most important being effectively increasing how many variadic parameters can be used. It would be even better if the parameters could be enumerated on an individual basis and reused in future method calls, even if it's a bit cumbersome.
The goal is to be able to format a very large formatting string (>32 parameters) using Sourcemod's translation system, and make code quality better with better access to the parameter stack.
The text was updated successfully, but these errors were encountered:
I think it's a good idea to support passing variable parameters.
Variable parameters are only available for VFormat, which will significantly increase the complexity of the code in some cases.
Currently,
SP_MAX_EXEC_PARAMS
is set to 32, making it so that function calls cannot contain more than 32 parameters. This, importantly, makes it so that very large formatting class calls cannot be made without formatting multiple times in a row, which can be unacceptable in some cases (Such as using Sourcemod translations). Here's an example from a project of mine Showing how many formatting parameters I need and how I am being limited by the maximum parameters.Additionally, there is currently absolutely no way to manipulate variadic parameters in any way other than using them in VFormat. You cannot grab individual entries in the parameter stack, nor can you pass along the entire stack to another method.
It is difficult to write clean-looking overloads for a method without being able to pass along variadic parameters. Additionally, a somewhat clean workaround for the first issue I described would be possible if I could iterate over the variadic parameters in chunks of <32 until the format is finished.
I can't say I know what the best solution for this codebase would be, but I would really like to see some improvements to variadic parameters. The most important being effectively increasing how many variadic parameters can be used. It would be even better if the parameters could be enumerated on an individual basis and reused in future method calls, even if it's a bit cumbersome.
The goal is to be able to format a very large formatting string (>32 parameters) using Sourcemod's translation system, and make code quality better with better access to the parameter stack.
The text was updated successfully, but these errors were encountered: