-
Notifications
You must be signed in to change notification settings - Fork 52
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
Printing concatenated results #36
Comments
Use string interpolation:
C translation:
|
The concatenation operator is only partially implemented for C. I will either implement it fully or block it. |
As a temporary solution, I've added this
My first thought was to remove the concatenation operator from the language. It has several shortcomings:
There are however two reasons to keep it:
|
@pfusik Is this still an issue in 2023? |
This was low-priority because of the string interpolation workaround. Now that b29f67c restricts concatenation to strings, it was trivial to implement. Thanks! |
@pfusik Thank you! |
Are there any plans for more general concatenation support when going to languages without proper support like c?
This came up while trying Console.Write as
Console.Write(int + string)
givesfputs(int + string, stdout)
and so relies on c to handle it which of course it won't do. This doesn't happen when the int and string are printed separately asConsole.Write(int)
will correctly giveprintf("%d", int)
. Is printing different types separately just the intended way or is this a bug?Provided this is reasonable to fix,
printf(%d%s, int, string)
should work fine and generalise to other combinations but I haven't checked what the support for format strings is like since most of the supported languages don't even have them.The text was updated successfully, but these errors were encountered: