Re: Packed arrays and assignment vs binding

2010-11-14 Thread Jon Lang
On Sun, Nov 14, 2010 at 2:54 AM, Moritz Lenz wrote: > On IRC, Jonathan said that 1 is basically an Int, which is something > like a boxed int. So whatever operation works removes the box, and puts > the result in the variable. > > However I wonder how well that's going to work, since Int can store

Re: Packed arrays and assignment vs binding

2010-11-14 Thread Moritz Lenz
On 11/14/2010 03:46 AM, Mason Kramer wrote: > I understand everything you've written except the following: > > On Nov 13, 2010, at 12:09 PM, Jonathan Worthington wrote: > >> Hi, >> ... >> >> my Int @x; >> >> Where we get an array of scalar containers, each of which is only allowed to >> conta

Re: Packed arrays and assignment vs binding

2010-11-13 Thread Mason Kramer
I understand everything you've written except the following: On Nov 13, 2010, at 12:09 PM, Jonathan Worthington wrote: > Hi, > ... > > my Int @x; > > Where we get an array of scalar containers, each of which is only allowed to > contain an Int (strictly, something that Int.ACCEPTS(...) hands

Re: Packed arrays and assignment vs binding

2010-11-13 Thread Jon Lang
Jonathan Worthington wrote: > In the latter case, it's fairly clear how these differ: > > @x[0] = 1; > @x[0] := 1; > > In the first, we look up the container in slot 0 or the array and assign a 1 > into it. In the second, we bind a 1 directly into the slot. There's no > container any more (so any f

Re: Packed arrays and assignment vs binding

2010-11-13 Thread Moritz Lenz
On 11/13/2010 06:09 PM, Jonathan Worthington wrote: > With packed arrays, however, I'm less clear what they mean. Since the > point of a packed array is compact storage, there's no chance to > actually have containers. Thus does assignment to a slot in a compact > array ever make sense? There's

Re: Packed arrays and assignment vs binding

2010-11-13 Thread Stefan O'Rear
On Sat, Nov 13, 2010 at 06:09:00PM +0100, Jonathan Worthington wrote: ... > With packed arrays, however, I'm less clear what they mean. Since > the point of a packed array is compact storage, there's no chance to > actually have containers. Thus does assignment to a slot in a > compact array ever m

Re: Packed arrays and assignment vs binding

2010-11-13 Thread Carl Mäsak
Jonathan (>): > Per S09, we can write in Perl 6: > > my int @x; > > And the idea is that we get a packed array - conceptually, a single lump of > memory allocated and and storing a bunch of ints contiguously. Contrast this > to: > > my Int @x; > > Where we get an array of scalar containers, each of

Packed arrays and assignment vs binding

2010-11-13 Thread Jonathan Worthington
Hi, Per S09, we can write in Perl 6: my int @x; And the idea is that we get a packed array - conceptually, a single lump of memory allocated and and storing a bunch of ints contiguously. Contrast this to: my Int @x; Where we get an array of scalar containers, each of which is only allowed