Yes, this one will be changed in the future (1.0-DEV below):
julia> A .+ I
┌ Warning: broadcast will default to iterating over its arguments in the future. Wrap arguments of
│ type `x::UniformScaling{Bool}` with `Ref(x)` to ensure they broadcast as "scalar" elements.
│ caller = ip:0x0
└ @ Core :-1
2×2 Array{Float64,2}:
2.0 2.0
2.0 2.0
Excellent to know that! I was thinking to submit v0.7 to openSUSE and wait sometimes so that the users can have the opportunity to fix everything. Now, I am really comfortable to do this
Don’t get me wrong, I get the design (very much like R’s seq) which I like. I just find, and in the early discussion of this thought 1.0 would have the stop default, that the linspace like behavior is the most common.
Just feels so crazy verbose using the stop version. Heck julia smashes every possible word together for fear of a adding 1-3 _ this feels far worse for such a common operation.
Still I get the decisions, I just don’t want to change all my code to use the stop version, and then remove it all for 1.1.
personal taste. I really dislike making my own private Julia idioms … as I feel it makes all my code examples a hassle to share with others in my lab (they need to use the GabioVerse for all the things I want different if they are building on my examples etc.) and it makes a barrier for future connections with standard tutorials, stack exchange etc. It is the same reason I really dislike the .juliarc solutions, and wrapper packages to make julia look like other languages … reminds me of the old pain of using peoples Maple code with all the private imports, aliases, etc. I really like having a more python style of “one obvious way to do things” versus the, what I understand to be, the Lisp way of many private / custom languages.
I will come around, I just hoped I could move to 1.0 sooner. I just have too much Julia code at this point a good problem I guess, but I find it is making me more conservative these days. I am really excited for 1.0’s hopefully slowing down of major language changes!
It is pretty easy to personalize things this way. I do sympathize with the previous post, though, and I may not actually use this function much. It’s just to make sure old code doesn’t break.
TBH, this is one of the worst decisions Julia has made recently. In my opinion, there was no need at all for this, look at the following verbose, “ugly” constructs and their straightforward replacements, I hoped they had just replaced the word linspace with range.
I thought all of these still work in 1.0, or at least they do for now… Of course, with floating points this is a little trickier since 1.0:0.6:2.0 returns something like 1.0:0.6:1.6, but that seems the right.
I don’t think @Seif_Shebl was arguing that the 1:5:100 wouldn’t work, but that the new range functionalities were not necessary since you could already build ranges in that way.
Personally putting all these functionalities in a single function and customising its behaviour via keywords arguments doesn’t strike me as very elegant, but maybe that’s the best we can do.
I’ll certainly have linspace and logspace defined in my loading script, since I’m using them all over the place (more than 500 occurences on my local codebase).
Bonus question, is there a way to do that: linspace(extrema(x)...,100)
OK, that might have been a misunderstanding. But the fact is that you cannot replace many range calls with simple a:b:c syntax; most obviously the ones that use the stop keyword, but range also does a lot of work to get numerical accuracy right, which a:b:c can skip right over.
I actually think that collecting the functionality in a single function is very elegant, but I also think it’s not very user-friendly in an interactive context.
There is an InteractiveUtils library now, which exports functions that are useful when using the REPL. Maybe there could be something similar for other productivity tools? Or maybe Plots.jl could export a linspace method?
My comment was not as negative as some people got it, I meant that Julia is sometimes too brave when adding or removing functionality. One great example that I liked so much was allowing atan to accept 2 arguments and dropping the well-known atan2 used by many older languages, that was an improvement and pretty natural. But in our case, they removed linspace without introducing a nice replacement. For interactive work, these kinds of functions are of utmost importance, one should think a million times before removing them. When people are constantly adding something to startup.jl, that’s a clear sign that Julia missed some obvious default.