-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
static[T] and varargs together #1083
Comments
Can you give an example where you would like to combine them? |
Graphic pipeline which takes a set of transformation matrices. If you know them all in advance you can avoid runtime calculation of result matrix. Possibly a database transaction executing several SQL commands. If you know all of these commands in advance you may check their validity against the database during compile time. Mixing of compile time and runtime parameters looks like a problem:
|
Wouldn't a template work in this case? |
I do not know. This advanced part of the language is underdocumented, I didn't play with it yet. |
The correct syntax would be
... but the combination is not supported yet. |
I would like to have support for that. I hope it will also work with macros. |
this would be handy for making a proc/template for strformat to concat staticly known substrings. |
## Summary Neither the program output nor the comparison string are cut off at the first null byte anymore. ## Details Output comparisons in testament used `strutils.contains`, which uses `strutils.find`, which, by default, uses `c_strstr`. `c_strstr` operates on null-terminated strings, and thus stopped at the first occurrence of one, even if the end of the NimSkull string hasn't been reached yet. Testament now uses a custom `contains` implementation based on C's `memcmp`, so that the `\0` byte doesn't terminate the search.
The documentation does not say how to combine static[T] feature with varargs parameter.
The text was updated successfully, but these errors were encountered: