4 ms·
> (; x, y) = newS > Now x has the value 4 and y has the value 5. I believe this is supposed to be a and b here (matching the names of the fields of the st
by sundarurfriend 5y ago
> (; x, y) = newS
> Now x has the value 4 and y has the value 5.
I believe this is supposed to be a and b here (matching the names of the fields of the struct). That's what the NEWS.md [1] implies, and that's what intuitively makes sense given the ; syntax.
> Install package?
│ (@v1.7) pkg> add Example
└ (y/n) [y]:
Surprised it defaults to [y] option, especially since packages can be pretty heavy with artifacts and lots of dependencies to precompile. One accidental extra Return and you might be sitting there for five minutes.
> keepat!(v, i)
Not a fan of the name. The ! indicates the mutation as the article points out, but keeponlyat! would have been much clearer and immediately obvious, enough to more than justify its length IMO.
Lots of nice quality of life improvements in this version. One that the article doesn't mention is `julia --project=@myenv` [1] - being able to specify a shared environment as the starting environment for the REPL.
[1] https://github.com/JuliaLang/julia/blob/v1.7.0-rc1/NEWS.md https://github.com/JuliaLang/julia/blob/v1.7.0-rc1/NEWS.md
- leephillips 5y ago> I believe this is supposed to be a and b here You’re right! It’s a typo. I changed the struct to use a and b instead of x and y, but didn't replace the following paragraph. Thanks for noticing that. It’ll get fixed.
- adgjlsfhk1 5y agoHaving used the automatic package install feature for a few months already, I'm pretty sure we made the right decision. If you type `using x`, chances are you actually want to use it. Also, since 1.6 has added parallel precompilation, there aren't many packages that take that long. For reference DifferentialEquations currently adds in about 2 minutes.
- sundarurfriend 5y ago> If you type `using x`, chances are you actually want to use it. In my case, at least half of the time, the issue is that I forgot to switch to the right environment. (So it's nice that the output also shows the current environment that we'll be adding to.) I'm also just used to the convention of 'n' being the the default, for eg. with Linux package managers.
- eigenspace 5y ago> Surprised it defaults to [y] option, especially since packages can be pretty heavy with artifacts and lots of dependencies to precompile. One accidental extra Return and you might be sitting there for five minutes. You can interrupt it with Ctrl-C.
- sundarurfriend 5y agoIs that guaranteed to not leave the package environment in some messed up state?
- adgjlsfhk1 5y agoJulia's package management is stateless, so it won't mess it up badly at the very least.