{"action":"opened","issue":{"url":"https://api.github.com/repos/ldrumm/libbeemo/issues/40","labels_url":"https://api.github.com/repos/ldrumm/libbeemo/issues/40/labels{/name}","comments_url":"https://api.github.com/repos/ldrumm/libbeemo/issues/40/comments","events_url":"https://api.github.com/repos/ldrumm/libbeemo/issues/40/events","html_url":"https://github.com/ldrumm/libbeemo/issues/40","id":92943421,"number":40,"title":"lua interface cleanup","user":{"login":"ldrumm","id":4323144,"avatar_url":"https://avatars.githubusercontent.com/u/4323144?v=3","gravatar_id":"","url":"https://api.github.com/users/ldrumm","html_url":"https://github.com/ldrumm","followers_url":"https://api.github.com/users/ldrumm/followers","following_url":"https://api.github.com/users/ldrumm/following{/other_user}","gists_url":"https://api.github.com/users/ldrumm/gists{/gist_id}","starred_url":"https://api.github.com/users/ldrumm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ldrumm/subscriptions","organizations_url":"https://api.github.com/users/ldrumm/orgs","repos_url":"https://api.github.com/users/ldrumm/repos","events_url":"https://api.github.com/users/ldrumm/events{/privacy}","received_events_url":"https://api.github.com/users/ldrumm/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-07-03T22:22:01Z","updated_at":"2015-07-03T22:22:01Z","closed_at":null,"body":"The Lua interface is pretty messy, particularly - the definition and interface to the buffer object relies on a number of messy global variables. The accepted way to handle interfaces like this is to use a `userdata` object, and define it's methods to work only on instances of itself.\r\n\r\nsee PiL chapter 29 for a discussion of the reasons for this.\r\n\r\nAlso, we can use this as an opportunity to refactor the entire Lua object interface as described in the current docs [describing what the Lua API should look like](https://github.com/ldrumm/libbeemo/blame/f1ddd17f3a9317a1747275813d609f976bcc9d7d/docs/source/lua_api.rst#L93)\r\n\r\n"}}