{"action":"created","issue":{"url":"https://api.github.com/repos/rvirding/lfe/issues/297","repository_url":"https://api.github.com/repos/rvirding/lfe","labels_url":"https://api.github.com/repos/rvirding/lfe/issues/297/labels{/name}","comments_url":"https://api.github.com/repos/rvirding/lfe/issues/297/comments","events_url":"https://api.github.com/repos/rvirding/lfe/issues/297/events","html_url":"https://github.com/rvirding/lfe/issues/297","id":190080137,"number":297,"title":"Create a version function","user":{"login":"oubiwann","id":894251,"avatar_url":"https://avatars.githubusercontent.com/u/894251?v=3","gravatar_id":"","url":"https://api.github.com/users/oubiwann","html_url":"https://github.com/oubiwann","followers_url":"https://api.github.com/users/oubiwann/followers","following_url":"https://api.github.com/users/oubiwann/following{/other_user}","gists_url":"https://api.github.com/users/oubiwann/gists{/gist_id}","starred_url":"https://api.github.com/users/oubiwann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oubiwann/subscriptions","organizations_url":"https://api.github.com/users/oubiwann/orgs","repos_url":"https://api.github.com/users/oubiwann/repos","events_url":"https://api.github.com/users/oubiwann/events{/privacy}","received_events_url":"https://api.github.com/users/oubiwann/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2016-11-17T15:35:10Z","updated_at":"2016-11-17T20:36:52Z","closed_at":null,"body":"In the past several years, I'ver iterated on several different forms of a version function in LFE -- sometimes just a string, sometimes a data structure. Most recent work with LFE Docker images has made this even more desirable -- but not at a third-party library level, rather something that really should be part of LFE. It would be nice for developers who have started up an LFE VM to call a `version` function and get a data structure that could easily be used to 1) get all the information they want about versions, and 2) extract just the bits that they are interested in.\r\n\r\nMy long-standing needs of this sort of function are for programmatic uses (determining what's available for a given version, conditionals that make decisions based on this, etc.). However, this feature might be even more used from LFE REPLs.\r\n\r\nI have a version of just such a function that I will port to Erlang and submit a PR for.\r\n\r\nDesired features:\r\n * [x] contains versions for not only LFE but other major parts of OTP, if present\r\n * [x] is easily extensible -- something that community libraries could use, adding their own version numbers to\r\n * [x] is usable by all supported versions of Erlang\r\n * [x] is accessible from LFE apps by just calling `(version)`\r\n * [x] is accessible from the LFE REPL by just calling `(version)`\r\n * [x] optionally takes a key argument to return only one part of the version data structure, e.g., `(version 'lfe)`\r\n * [x] memoize top-level function so that expensive `os:cmd` calls aren't repeated\r\n * [x] update help/usage output\r\n * [x] add example usage in `examples` directory\r\n * [x] update shell docs\r\n * [x] update lfe_guide docs"},"comment":{"url":"https://api.github.com/repos/rvirding/lfe/issues/comments/261362211","html_url":"https://github.com/rvirding/lfe/issues/297#issuecomment-261362211","issue_url":"https://api.github.com/repos/rvirding/lfe/issues/297","id":261362211,"user":{"login":"oubiwann","id":894251,"avatar_url":"https://avatars.githubusercontent.com/u/894251?v=3","gravatar_id":"","url":"https://api.github.com/users/oubiwann","html_url":"https://github.com/oubiwann","followers_url":"https://api.github.com/users/oubiwann/followers","following_url":"https://api.github.com/users/oubiwann/following{/other_user}","gists_url":"https://api.github.com/users/oubiwann/gists{/gist_id}","starred_url":"https://api.github.com/users/oubiwann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oubiwann/subscriptions","organizations_url":"https://api.github.com/users/oubiwann/orgs","repos_url":"https://api.github.com/users/oubiwann/repos","events_url":"https://api.github.com/users/oubiwann/events{/privacy}","received_events_url":"https://api.github.com/users/oubiwann/received_events","type":"User","site_admin":false},"created_at":"2016-11-17T20:36:52Z","updated_at":"2016-11-17T20:36:52Z","body":"Okay, this is ready for review -- creating PR ..."}}
{"actor":{"display_login":"oubiwann"}}