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

luaharfbuzz breaks tostring #49

Open
deepakjois opened this issue Mar 15, 2020 · 1 comment
Open

luaharfbuzz breaks tostring #49

deepakjois opened this issue Mar 15, 2020 · 1 comment

Comments

@deepakjois
Copy link
Member

deepakjois commented Mar 15, 2020

Email from Simon Dales:

When testing I spotted an issue with
tostring().

"Receives a value of any type and converts it to a string in a
human-readable format"[1].


///////////

Run:
//////////////////
for k,v in pairs(luaharfbuzz) do
  print(k,v)
end
//////////////////
Should only fail if your lua, say texlua, hasn't got luaharfbuzz. Else
it should list the elements of the table.

I have a more sophisticated version of this loop that does it
recursively. So your code breaks a recursive list of _G.

//////
I did a couple of versions of the same hack: remove __tostring. Either
subsequently in lua or by commenting out in the sources.

Then the above lua works as the lua manual says it should.

But this breaks the use of tostring in some of your lua code, that
expects the returned string to be an internal value, such as language's
4 letter code.

//////////
2 obvious solutions:
* rename the function, but this probably breaks existing lua code
* fix the __tostring so that it works as the default class behaviour.

Any other better ones?

//////////////////////

[1] https://www.lua.org/manual/5.3/manual.html#pdf-tostring

//////////////////////

Simon
@deepakjois
Copy link
Member Author

Fixed by #57?

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