Skip to content
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

1.0.0 Comparing 'string' with number, but old gopher-lua printed a proper number after tonumber syntax #423

Closed
2 tasks
djonskin opened this issue Jan 22, 2023 · 0 comments

Comments

@djonskin
Copy link

You must post issues only here. Questions, ideas must be posted in discussions.

  • GopherLua is a Lua5.1 implementation. You should be familiar with Lua programming language. Have you read Lua 5.1 reference manual carefully?
  • GopherLua is a Lua5.1 implementation. In Lua, to keep it simple, it is more important to remove functionalities rather than to add functionalities unlike other languages . If you are going to introduce some new cool functionalities into the GopherLua code base and the functionalities can be implemented by existing APIs, It should be implemented as a library.

Please answer the following before submitting your issue:

  1. What version of GopherLua are you using? : newest version from git pull
  2. What version of Go are you using? : 1.19.5
  3. What operating system and processor architecture are you using? : Windows 10 64 bit on AMD
  4. What did you do? : Tried running Ikemen GO, which depends on gopher-lua v0.0.0-20220504180219-658193537a64.
  5. What did you expect to see? : https://static.wikia.nocookie.net/mugen/images/6/66/IKEMEN_GO_TitleScreen.png/revision/latest/scale-to-width-down/320?cb=20210814031134 Normal Ikemen-GO operation.
  6. What did you see instead? : https://user-images.githubusercontent.com/106702560/211409973-b611ba28-e9da-4a48-8b68-267d58b976f1.png I ran into an attempt at comparing string-to-number error regarding syntax. The program crashed before I got into it. In the end, my issue was resolved at Ikemen GO's repository after much investigation. My solution was duct taped together in a PR over there.

A performed test here:

local a, b, c = "1", "3", "1"
a, b, c= tonumber(a), tonumber(b) or a, tonumber(c)
print(a, type(a), b, type(b), c, type(c))

printed
1, number, 3, string, 1, number
and the expected type for all 3 arguments should be equal to number.

It seemed I was getting my start crash result as of a few weeks ago with gopher-lua's 1.0.0 update. In the end, I was only suggested to either downgrade the gopher-lua version I was using to v0.0.0-20220504180219-658193537a64, and/or bring it up over here, but this team should certainly know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant