-
Notifications
You must be signed in to change notification settings - Fork 286
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
Add concat function (WIP) #338
Conversation
It doesn't work, but in theory, it should be able to be used on G'MIC. I'm missing something here.
It doesn't work on vector. That's something that needs to be addressed.
I would like to figure out how to retrieve characters from mp_arg(i_end). I want the function to be able to differentiate whether the last argument contains a . at the beginning if that is possible. If not, then this can be pushed.
Here's the output so far:
For first one, since the last argument doesn't have a 0 at the beginning, a unnecessary 0 is added. But, I believe users can address that with ease. |
Won't consider this for merging, because:
|
It's not common, yes, I agree. However, this is easier to work with when using math evaluation within G'MIC, which is exactly why I have created it in the first place. It also enables access to this function within filters that supports custom expression, which is another reason why I did this. This doesn't involve strings. One can do something like this in G'MIC with some time though with the setback of having to copy and paste this function.
Yes, large numbers won't work with it, I agree with that. It does work for any number of arguments from 1-n where the concatenated number is less than DBL_MAX. That being said, at the end of the day, I respect your decision. |
Also, there is a way to do this directly with macros :
|
I did not realize that functions with same name can have different numbers of arguments at all. Thanks. |
I may have prematurely closed this. After trying to make own macro generator within G'MIC. I realized that my concat() function in this pull request actually factors into conditions such as whether the first argument is a positive or a negative, and whether every arguments except the last one contains a decimal. It doesn't look very feasible to do this in G'MIC language. My solution solves most of the shortcomings with the G'MIC macro. Maybe, I'll have another crack, but I find it very difficult to work without resorting to math-based approach. Maybe it's not worth reopening. |
This is an attempt at generator for macro lines found here - GreycLab/CImg#338
It doesn't seem discoverable by g'mic cli. I'm also not expecting mp_concat to work due to very little experience with C++. This is more of a starting point.