{"action":"created","issue":{"url":"https://api.github.com/repos/simoncozens/sile/issues/103","labels_url":"https://api.github.com/repos/simoncozens/sile/issues/103/labels{/name}","comments_url":"https://api.github.com/repos/simoncozens/sile/issues/103/comments","events_url":"https://api.github.com/repos/simoncozens/sile/issues/103/events","html_url":"https://github.com/simoncozens/sile/issues/103","id":89568884,"number":103,"title":"Really compatible with lua-5.1?","user":{"login":"ff2000","id":1973708,"avatar_url":"https://avatars.githubusercontent.com/u/1973708?v=3","gravatar_id":"","url":"https://api.github.com/users/ff2000","html_url":"https://github.com/ff2000","followers_url":"https://api.github.com/users/ff2000/followers","following_url":"https://api.github.com/users/ff2000/following{/other_user}","gists_url":"https://api.github.com/users/ff2000/gists{/gist_id}","starred_url":"https://api.github.com/users/ff2000/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ff2000/subscriptions","organizations_url":"https://api.github.com/users/ff2000/orgs","repos_url":"https://api.github.com/users/ff2000/repos","events_url":"https://api.github.com/users/ff2000/events{/privacy}","received_events_url":"https://api.github.com/users/ff2000/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":11,"created_at":"2015-06-19T13:48:57Z","updated_at":"2015-06-20T00:40:30Z","closed_at":null,"body":"I built sile with lua-5.1.5 and running sile fails.\r\n\r\n```\r\n❯ sile simple.sil\r\nThis is SILE 0.9.2\r\n<simple.sil>\r\nError detected:\r\n/usr/share/sile/lua-libraries/bit32-compat.lua:26: attempt to call field 'mod' (a nil value)\r\n\r\n❯ sile bibtex.sil\r\nThis is SILE 0.9.2\r\n<bibtex.sil>\r\nError detected:\r\n/usr/share/sile/packages/bibtex.lua:27: attempt to index local 'fh' (a nil value)\r\n```\r\n\r\nIn 5.1 IMHO it's still fmod. Don't know lua that well (yet) but I think I read the change to math.mod was introduced in 5.3 together with an integer type. Am I correct?\r\nWhen I change mod to fmod sile works (but it produces weird pdfs, because it uses different fonts and seems to mess up metrics).\r\nDon't know how to deal with the bibtex error..."},"comment":{"url":"https://api.github.com/repos/simoncozens/sile/issues/comments/113687009","html_url":"https://github.com/simoncozens/sile/issues/103#issuecomment-113687009","issue_url":"https://api.github.com/repos/simoncozens/sile/issues/103","id":113687009,"user":{"login":"pkulchenko","id":77071,"avatar_url":"https://avatars.githubusercontent.com/u/77071?v=3","gravatar_id":"","url":"https://api.github.com/users/pkulchenko","html_url":"https://github.com/pkulchenko","followers_url":"https://api.github.com/users/pkulchenko/followers","following_url":"https://api.github.com/users/pkulchenko/following{/other_user}","gists_url":"https://api.github.com/users/pkulchenko/gists{/gist_id}","starred_url":"https://api.github.com/users/pkulchenko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pkulchenko/subscriptions","organizations_url":"https://api.github.com/users/pkulchenko/orgs","repos_url":"https://api.github.com/users/pkulchenko/repos","events_url":"https://api.github.com/users/pkulchenko/events{/privacy}","received_events_url":"https://api.github.com/users/pkulchenko/received_events","type":"User","site_admin":false},"created_at":"2015-06-20T00:40:30Z","updated_at":"2015-06-20T00:40:30Z","body":"@simoncozens, you are right; I did mix the styles a bit and wasn't sure about that part.\r\n\r\nI pushed another commit into [the same branch](https://github.com/pkulchenko/sile/tree/lua51-compat-env), which keeps the same style and restores the functionality for Lua 5.2+. I can't test it with Lua 5.3, but I'd expect it to work better. In the fragments I added, I only test for capabilities, not versions, which is the right way to do it.\r\n\r\nYour approach was correct, but you missed `setfenv` call; you also seem to have `setfenv` added in a couple of places, so I removed one of them where I don't think it's needed.\r\n\r\nI'll clean up/squash the commits before sending a pull request if the changes look good to you."}}