-
Notifications
You must be signed in to change notification settings - Fork 136
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
Create a version function #297
Comments
👍 what is the scope of this function? Just LFE? Loaded applications? Modules? I could see utility in any of those. We could potentially do cool stuff conditionally based on versions à la preprocessor macros. |
Current output: lfe> (version)
(#(os
"Linux liberator 4.4.0-31-generic #50-Ubuntu SMP Wed Jul 13 00:07:12 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux")
#(kernel #(4 4 0))
#(otp "18")
#(emulator "7.3")
#(system
"Erlang/OTP 18 [erts-7.3] [source] [64-bit] [smp:4:4] [async-threads:10] [kernel-poll:false]")
#(driver "3.3")
#(nif "2.10")
#(lfe "1.3-dev")
#(rebar "rebar 2.6.0 18 20151024_031110 No VCS info available.")
#(rebar3 "rebar 3.3.2 on Erlang/OTP 18 Erts 7.3")) If |
App key lookup output: lfe> (version 'lfe)
"1.3-dev"
lfe> (version 'otp)
"18" |
Okay, this is ready for review -- creating PR ... |
@yurrriq In answer to your question:
Currently there is no utility function here to extract |
I see. The examples above were very helpful 😄. 👍 to adding other utility functions later. #299 looks good to me. |
Sweet. |
Rebased on latest branches/fixes (some of which are pending review). |
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.My 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.
I have a version of just such a function that I will port to Erlang and submit a PR for.
Desired features:
(version)
(version)
(version 'lfe)
os:cmd
calls aren't repeatedexamples
directoryReview feedback tasks:
lfe-version-info
The text was updated successfully, but these errors were encountered: