Le vendredi 20 février 2015 à 05:06 -0800, Sebastian Good a écrit :
> Thanks for the hard work!
>
>
> I got a surprising deprecation when writing an array with one term in
> it. While the expression [1] is valid (creating an Array{Int64,1} with
> one element in it), the expression [1:5] generates the deprecation
> warning, and I now have to write [1:5;]. This seems a little inelegant
> to me. If 1 and 1:5 are both expressions, why does the latter require
> the ';'. (I'm guessing my premise that they're both expressions is
> wrong!)
The difference is that [1:5] will no longer concatenate, so it will
create an Array holding a range object, rather than an Array of Int. You
can use [1:5...] or collect(1:5) instead.
See this discussion for details:
https://github.com/JuliaLang/julia/pull/8599
Regards
> On Thursday, February 19, 2015 at 10:11:12 AM UTC-5, Stefan Karpinski
> wrote:
> The NEWS.md file is a good place to look for changes:
>
>
>
> https://github.com/JuliaLang/julia/blob/master/NEWS.md#language-changes
>
>
>
> The new behavior of [ ] is the first item under language
> changes with links to the relevant issues and pull requests.
>
>
> The type matching change may well be a bug fix since
> Array{Any,1} and Array{Array,1} are incomparable types (i.e.
> neither is a subtype of the other, nor are they the
> equivalent). I'd have to see this spelled out a bit more to
> know what change you're referring to.
>
>
>
>
>
> On Thu, Feb 19, 2015 at 5:49 AM, Robert DJ
> <[email protected]> wrote:
> Hi,
>
>
> I have just updated Julia for the first time in 10
> days and now I face problems with old code:
>
>
> - The error "WARNING: [a] concatenation is deprecated;
> use [a;] instead". Easy to fix, but what is the
> reasoning behind adding the ";"?
>
>
> - Type matching has changed: I have a function that
> takes arguments of the type `Array{Array{T,N},1}`
> (output from `typeof`; in words, it is an array where
> each element is an Array{Any,1} with multiple
> Array{Float,2}).
> As type specification in the function, `Array{Any,1}`
> used to work, but not anymore.
> Specifying the type as `Array{Array{T,N},1}` with N
> being an appropriate number doesn't work either.
> Is there a solution to this?
>
>
> Thanks,
>
>
> Robert
>
>
>
>