But, Louis, isn't abstract syntax tree a way of safely modify elixir code? For example I could quote all the mix.exs file, find dependencies tuple, modify it and unquote it back.
On Wednesday, July 19, 2017 at 12:37:57 AM UTC+3, Louis Pilfold wrote: > > Hey Vitaly > > The dependency file for mix is an Elixir program rather than just a simple > JSON file. There's no way reliably and safely programatically modify the > mix.exs file as a result. > > Cheers, > Louis > > On Tue, 18 Jul 2017 at 22:17 Vitaly Shvedchenko <vitaly.sh...@gmail.com > <javascript:>> wrote: > >> Hi guys, >> >> I'd like to suggest a feature and may be implement it. I've found >> somebody proposed this feature earlier, but it was a long time ago and >> there was not a single reply to it. So I'd try one more time for that poor >> guy and for me. >> >> When you develop elixir project and adding new dependencies to the >> project, you always have to find needed package onlline, find out it's >> latest version number and put it in your mix.exs dependencies for yourself. >> What could be helpful is some equivalent of a >> npm install --save >> command from nodejs world. It would be like >> mix deps.install package_name >> What this command has to do is just >> 1. check if hex is installed, propose to install it if it is not, >> 2. get the hex package info, parse its version, >> 3. put it in mix.exs file (with some conventional semantic versioning >> pattern like "~> x.y") >> 4. and call mix deps.get—thats it! >> It probably would not put the dependency in OTP applications to start >> list, but still it is much easier way of installing dependencies. >> >> I guess there is some conventional reasons to not implement such way of >> installing new dependencies, but it's not obvious for me and many other >> people why there is no such option. >> >> Thanks! Will be glad to have some feedback. >> >> -- >> You received this message because you are subscribed to the Google Groups >> "elixir-lang-core" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to elixir-lang-co...@googlegroups.com <javascript:>. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/elixir-lang-core/9daf03ef-a9a6-44d2-b7d5-68c345b42d76%40googlegroups.com >> >> <https://groups.google.com/d/msgid/elixir-lang-core/9daf03ef-a9a6-44d2-b7d5-68c345b42d76%40googlegroups.com?utm_medium=email&utm_source=footer> >> . >> For more options, visit https://groups.google.com/d/optout. >> > -- You received this message because you are subscribed to the Google Groups "elixir-lang-core" group. To unsubscribe from this group and stop receiving emails from it, send an email to elixir-lang-core+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/adcb4ac0-aea5-472e-ba07-481c6e9aeb2a%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.