Re: [julia-users] A question of Style: Iterators into regular Arrays

2015-10-27 Thread DNF
I think that the point of the idea was to get rid of the Abstract prefix. It can be a bit confusing that some, but not all, abstract types have the Abstract prefix, and as seen in this thread it has led to some misunderstandings. On Tuesday, October 27, 2015 at 8:29:21 AM UTC+1, Tomas Lycken

Re: [julia-users] A question of Style: Iterators into regular Arrays

2015-10-27 Thread Tomas Lycken
Better yet, since we already have both AbstractVector, AbstractMatrix, AbstractArray, AbstractString, AbstractFloat and a couple of others (try typing Abstract in the REPL…) it might be time to rename Integer to AbstractInteger. I have a hard time thinking the confusion between Int and

Re: [julia-users] A question of Style: Iterators into regular Arrays

2015-10-26 Thread Scott Jones
>One possible naming scheme could be to follow the example of Int and Integer and have Vec, Mat, Arr be the concrete types and Vector, Matrix and Array be the abstract types. I'm really not sure this would be worth the trouble at this point or if we really want the AbstractArray names to be

Re: [julia-users] A question of Style: Iterators into regular Arrays

2015-10-25 Thread Stefan Karpinski
This is still an option but I'm yet to be convinced that we want to have that many things exported: linrange, LinRange, and linspace which just does collect on linrange? Seems like one too many. On Sunday, October 25, 2015, Gabriel Gellner wrote: > > > On Sunday, 25

Re: [julia-users] A question of Style: Iterators into regular Arrays

2015-10-25 Thread Gabriel Gellner
On Sunday, 25 October 2015 11:06:14 UTC-7, Stefan Karpinski wrote: > > This is still an option but I'm yet to be convinced that we want to have > that many things exported: linrange, LinRange, and linspace which just does > collect on linrange? Seems like one too many. Personally I think

Re: [julia-users] A question of Style: Iterators into regular Arrays

2015-10-21 Thread Jonathan Malmaud
> On Oct 21, 2015, at 3:19 PM, Gabriel Gellner wrote: > > Continuing to think about all the ideas presented in this thread. It seems > that the general advice is that almost all functions should at first pass be > of "Abstract" or untyped (duck typed) versions. If

Re: [julia-users] A question of Style: Iterators into regular Arrays

2015-10-21 Thread Stefan Karpinski
The types Vector, Matrix and Tensor were abstract originally . The Array type was the concrete implementation of Tensor. Later on we introduced

Re: [julia-users] A question of Style: Iterators into regular Arrays

2015-10-21 Thread DNF
I tried to find this previously, but failed until now: https://github.com/JuliaLang/julia/pull/8872 That's the pull request for the String -> AbstractString renaming. Even though I may not completely agree, this explains a lot about the thinking behind the renaming. On Wednesday, October 21,

Re: [julia-users] A question of Style: Iterators into regular Arrays

2015-10-21 Thread DNF
I was thinking specifically of AbstractString, not AbstractArray. I just don't quite get why it had to be made consistent with Array/AbstractArray, when String was a nice general name, and it would be consistent with the IO/IOStream/IOBuffer example that you mention. On Wednesday, October 21,

Re: [julia-users] A question of Style: Iterators into regular Arrays

2015-10-21 Thread Jonathan Malmaud
Well, those need the ‘Abstract’ prefix to distinguish them from their concrete counterpart. There was already “Array” in the language, so what are you gong to call the type that is array-like but not literally an array? But take another common - there is the abstract type “IO", who subtypes

Re: [julia-users] A question of Style: Iterators into regular Arrays

2015-10-21 Thread Jonathan Malmaud
It was motivated by consistency with strings. Initially there was Array <: AbstractArray, but ASCIIString <: String. So to be consistent between those, you have the choice of renaming things to get either 1) ConcreteArray <: Array and ASCIIString <: String or 2) Array <: AbstractArray and

[julia-users] A question of Style: Iterators into regular Arrays

2015-10-21 Thread Gabriel Gellner
I find the way that you need to use `linspace` and `range` objects a bit jarring for when you want to write vectorized code, or when I want to pass an array to a function that requires an Array. I get how nice the iterators are when writing loops and that you can use `collect(iter)` to get a

Re: [julia-users] A question of Style: Iterators into regular Arrays

2015-10-21 Thread Mauro
I'd argue that this should work: julia> rand(4,4)*(1:4) ERROR: MethodError: `A_mul_B!` has no method matching A_mul_B!(::Array{Float64,1}, ::Array{Float64,2}, ::UnitRange{Int64}) i.e. ranges should be equivalent to column vectors. But others more knowledgeable on the linear algebra code may