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

fix io.read & file:read signature #718

Closed
wants to merge 1 commit into from

Conversation

fperrad
Copy link
Contributor

@fperrad fperrad commented Nov 5, 2023

No description provided.

Copy link

github-actions bot commented Nov 5, 2023

Teal Playground URL: https://718--teal-playground-preview.netlify.app

@hishamhm
Copy link
Member

hishamhm commented Nov 6, 2023

I think it's better to declare this as a polymorphic function so we don't have to use casts in the most common cases. I will try my hand at an alternative implementation, but thank you for the PR pointing out the issue!

@hishamhm hishamhm closed this in e82af91 Nov 6, 2023
@fperrad fperrad deleted the io_read branch November 8, 2023 11:35
@fperrad
Copy link
Contributor Author

fperrad commented Nov 8, 2023

From Reference Manuals, available formats are:

  • Lua 5.1: "*n", "*a", "*l"
  • Lua 5.2: "*n", "*a", "*l", "*L"
  • Lua 5.3: "n", "a", "l", "L"
  • Lua 5.4: "n", "a", "l", "L"

The starting * is allowed in implementation of Lua 5.3 & 5.4, only for compatibily reason (see function g_read() in liolib.c).

It could be nice that Teal allows only Lua 5.3/4 formats, and the * will be added by the generation targeting Lua 5.1/2.

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

Successfully merging this pull request may close these issues.

2 participants