My point is it's just notation. `M[:,2]` is notation for `getindex(M, :, 2)`,
which returns a copy. `slice(M, :, 2)` returns a view. In julia 0.5, `M[:,2]`
will effectively become notation for `slice(M, :, 2)`.
So we're talking about a difference of 6 characters. I know syntax is
important, and
On this note, is there a good summary somewhere of the pros/cons between
using `sub` vs `slice` vs `ArrayViews.view`?
On Fri, Oct 23, 2015 at 11:57 AM, Steven G. Johnson
wrote:
> On Friday, October 23, 2015 at 11:49:21 AM UTC-4, Neal Becker wrote:
>>
>> To be more precise, I'm coming from python
On Friday, October 23, 2015 at 12:24:59 PM UTC-4, Tom Breloff wrote:
>
> On this note, is there a good summary somewhere of the pros/cons between
> using `sub` vs `slice` vs `ArrayViews.view`?
>
As I understand it, slice tries to squeeze the dimensions (producing
lower-dimensional arrays if po
If I write into a view, does it change the original array?
Christoph
Yes, that's the whole premise of a view.
On Fri, Oct 23, 2015 at 3:04 PM, Christoph Ortner <
christophortn...@gmail.com> wrote:
>
> If I write into a view, does it change the original array?
>
> Christoph
>
Apparently yes. For me it is very counterintuitive that this would be the
default behaviour. But presumably there was a lot of discussion that this
is desirable.
(a) What are reasons, other than performance?
(b) Is this still under discussion or pretty much settled?
(c) if I want to write cod
On Friday, October 23, 2015 at 9:08:55 PM UTC+2, Christoph Ortner wrote:
>
>
> Apparently yes. For me it is very counterintuitive that this would be the
> default behaviour. But presumably there was a lot of discussion that this
> is desirable.
>
> (a) What are reasons, other than performance?
Fabian - Many thanks for your comments. This was very helpful.
(c) if I want to write code now that shouldn't break with 0.5, what should
> I do?
>
I think when you need a copy, just surround your getindex with a copy
function. (e.g. copy(x[:,10]) instead of x[:,10]).
But this would lead me t
On Monday, 26 October 2015 11:17:58 UTC-7, Christoph Ortner wrote:
>
> Fabian - Many thanks for your comments. This was very helpful.
>
> (c) if I want to write code now that shouldn't break with 0.5, what should
>> I do?
>>
>
> I think when you need a copy, just surround your getindex with a co
On Mon, Oct 26, 2015 at 2:17 PM, Christoph Ortner <
christophortn...@gmail.com> wrote:
> Fabian - Many thanks for your comments. This was very helpful.
>
> (c) if I want to write code now that shouldn't break with 0.5, what should
>> I do?
>>
>
> I think when you need a copy, just surround your ge
Hi Stefan,
Many thanks for the clarifications.
Just for the record: I've often complained about the changes to Julia
since 0.2, but this is one that I am more on the fence about.
Christoph
@googlegroups.com [mailto:julia-users@googlegroups.com] On
Behalf Of Stefan Karpinski
Sent: Monday, October 26, 2015 12:05 PM
To: Julia Users
Subject: Re: [julia-users] Re: Re: are array slices views in 0.4?
On Mon, Oct 26, 2015 at 2:17 PM, Christoph Ortner mailto:christophortn...@gmail.com> >
vior of slicing with [] will
> change drastically, with essentially no indicator where in my code I might
> run into trouble, right?
>
>
>
> *From:* julia-users@googlegroups.com [mailto:julia-users@googlegroups.com]
> *On Behalf Of *Stefan Karpinski
> *Sent:* Monday, Octo
: julia-users@googlegroups.com [mailto:julia-users@googlegroups.com] On
Behalf Of Stefan Karpinski
Sent: Tuesday, October 27, 2015 7:43 AM
To: Julia Users
Subject: Re: [julia-users] Re: Re: are array slices views in 0.4?
Yes, I'm concerned about this as well. I'm sure we'll come up
> *From:* julia...@googlegroups.com [mailto:
> julia...@googlegroups.com ] *On Behalf Of *Stefan Karpinski
> *Sent:* Tuesday, October 27, 2015 7:43 AM
> *To:* Julia Users >
> *Subject:* Re: [julia-users] Re: Re: are array slices views in 0.4?
>
>
>
> Yes, I'm concerned about th
tefan Karpinski
Sent: Tuesday, October 27, 2015 7:43 AM
To: Julia Users >
Subject: Re: [julia-users] Re: Re: are array slices views in 0.4?
Yes, I'm concerned about this as well. I'm sure we'll come up with something.
Maybe allow using the old behavior during a transitiona
.
>
>
>
> *From:* julia...@googlegroups.com [mailto:
> julia...@googlegroups.com ] *On Behalf Of *Cedric St-Jean
> *Sent:* Monday, November 2, 2015 12:00 PM
> *To:* julia-users >
> *Subject:* Re: [julia-users] Re: Re: are array slices views in 0.4?
>
>
>
>
I’m not sure what you refer to by “Compatability module”.
From: julia-users@googlegroups.com [mailto:julia-users@googlegroups.com] On
Behalf Of Christoph Ortner
Sent: Monday, November 2, 2015 1:09 PM
To: julia-users
Subject: Re: [julia-users] Re: Re: are array slices views in 0.4?
How is
Hi David,
I'm not an expert, i.e. I've never used it, but your idea "using OldArrays"
sounds exactly like the purpose of Compat.jl, which I believe is the
compatibility module referred to.
Have a look and good luck:
https://github.com/JuliaLang/Compat.jl
-
> From: julia-users@googlegroups.com [mailto:julia-
> us...@googlegroups.com] On Behalf Of Eric Forgy
> Sent: Monday, November 2, 2015 3:30 PM
> To: julia-users
> Subject: RE: [julia-users] Re: Re: are array slices views in 0.4?
>
> Hi David,
>
> I'm not an expert
15 3:30 PM
> > To: julia-users >
> > Subject: RE: [julia-users] Re: Re: are array slices views in 0.4?
> >
> > Hi David,
> >
> > I'm not an expert, i.e. I've never used it, but your idea "using
> OldArrays"
> > sounds exactly
gt;> you have to opt-in to the NEW syntax.
>>
>> > -Original Message-
>> > From: julia...@googlegroups.com [mailto:julia-
>> > us...@googlegroups.com] On Behalf Of Eric Forgy
>> > Sent: Monday, November 2, 2015 3:30 PM
>> > To: julia-user
> > -Original Message-----
>>> > From: julia...@googlegroups.com [mailto:julia-
>>> > us...@googlegroups.com] On Behalf Of Eric Forgy
>>> > Sent: Monday, November 2, 2015 3:30 PM
>>> > To: julia-users
>>> > Subject: RE: [julia-
at in julia 0.5 if you just use
>>>> `[]` for slicing without anything else, you generate a warning, and then
>>>> you have to opt-in to the NEW syntax.
>>>>
>>>> > -Original Message-
>>>> > From: julia...@googlegroups.com
ay, November 3, 2015 at 7:41:17 AM UTC+1, Christoph Ortner wrote:
>>>
>>> Why not do this via Compat.jl ?
>>>> C
>>>>
>>>> On Tuesday, 3 November 2015 04:28:44 UTC, David Anthoff wrote:
>>>>>
>>>>> No, Compat generall po
25 matches
Mail list logo