Re: Binding of array elements

2005-08-29 Thread Yuval Kogman
On Mon, Aug 29, 2005 at 15:12:44 +0200, TSa wrote: > HaloO, > > Yuval Kogman wrote: > >On Mon, Aug 29, 2005 at 13:12:37 +0200, TSa wrote: > >>Sorry, I believe everything is an operator---or actually operators > >>are Code subtypes with syntactic sugar. But some operators are usually > >>not dispat

Re: Binding of array elements

2005-08-29 Thread TSa
HaloO, Yuval Kogman wrote: On Mon, Aug 29, 2005 at 13:12:37 +0200, TSa wrote: Sorry, I believe everything is an operator---or actually operators are Code subtypes with syntactic sugar. But some operators are usually not dispatched because the type system manages to produce the same effect as

Re: Binding of array elements

2005-08-29 Thread Yuval Kogman
On Mon, Aug 29, 2005 at 13:12:37 +0200, TSa wrote: > Sorry, I believe everything is an operator---or actually operators > are Code subtypes with syntactic sugar. But some operators are usually > not dispatched because the type system manages to produce the same > effect as a real dispatch. But tha

Re: Binding of array elements

2005-08-29 Thread TSa
HaloO, Yuval Kogman wrote: IMHO definately autovivify * @foo[$idx] := $var; my @bar = @foo; $var= $new_var; # @foo[$idx] and $var are now $new_var, but @bar is unchanged, right? Yes, I agree. But we do need a way in the middle. Right now we have: @bar := @foo; # arr

Re: Binding of array elements

2005-08-27 Thread Ingo Blechschmidt
Hi, Yuval Kogman wrote: > On Sat, Aug 27, 2005 at 14:29:29 +0200, Ingo Blechschmidt wrote: >> * @foo[$idx] := $var; >> my @bar = @foo; >> $var= $new_var; >> # @foo[$idx] and $var are now $new_var, but @bar is unchanged, >> # right? > > Yes, I agree. But we do need a way in the

Re: Binding of array elements

2005-08-27 Thread Yuval Kogman
On Thu, Aug 25, 2005 at 23:29:03 +0200, Ingo Blechschmidt wrote: > * What happens if @array gets spliced? ... > @array.delete($some_index); @array[$some_index] = $some_value; > # or > @array[$some_index] = $some_value; the name 'splice' implies that things are removed, replaced, and t

Re: Binding of array elements

2005-08-27 Thread Yuval Kogman
On Sat, Aug 27, 2005 at 14:29:29 +0200, Ingo Blechschmidt wrote: > Ingo Blechschmidt wrote: > * @array[$out_of_bounds_index] := $var; > # Fatal error ("Can't rebind non-existant container")? > # Or autovivify @array[$out_of_bounds_index]? IMHO definately autovivify > > * @foo[$idx] := $var;

Re: Binding of array elements

2005-08-27 Thread Ingo Blechschmidt
Ingo Blechschmidt wrote: > Then we wondered what should happen to array elements which are bound > to other variables if some things happen to the array. (Of course, the > same thoughts apply to hashes as well). Two more questions: * @array[$out_of_bounds_index] := $var; # Fatal error ("Can't r

Binding of array elements

2005-08-25 Thread Ingo Blechschmidt
Hi, with PIL-Run (Perl 6 to Perl 5 compiler) progressing rapidly, the topic "binding" came up on #perl6. "Binding is a simple symbol table manipulation, right?" "No, consider @array[$idx] := $var or more generally $sub(@args) := $var." Then we wondered what should happen to array elements