-
-
Notifications
You must be signed in to change notification settings - Fork 988
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
wesnoth-s print
is incompatible with normal lua print
#2236
Comments
On IRC chat, JyrkiVesterinen pointed this to be the possible buggy implementation of |
Not buggy but it can be improved. Wesnoth depends upon loa_tostring obtaining a string value. The Lua version calls into the Lua runtime to Give me a few hours ... |
oh.. i didn't see that you already assigned the issue to you. in the meanwhile i fixed the bug: kallaballa@49d1055 Should i create a PR? |
Pass each parameter through Lua tostring() to convert to strings. This also allows meta-method tostring on userdata. This aligns the operation of wesnoth print() to be closer to what a Lua programmer would expect from the normal Lua print() which is not available. Closes Issue #2236
If you compare, I think you'll see you missed a lot of cases. |
You are right, though i see only one case: user data |
boolean, table, userdata, function, thread ... |
Pass each parameter through Lua tostring() to convert to strings. This also allows meta-method tostring on userdata. This aligns the operation of wesnoth print() to be closer to what a Lua programmer would expect from the normal Lua print() which is not available. Closes Issue #2236
Pass each parameter through Lua tostring() to convert to strings. This also allows meta-method tostring on userdata. This aligns the operation of wesnoth print() to be closer to what a Lua programmer would expect from the normal Lua print() which is not available. Closes Issue #2236
Steps to reproduce:
print("test", true)
print("test", true)
Expected:
similar or identical output
Actually:
test
test true
The text was updated successfully, but these errors were encountered: