Re: RFC 204 (v2) Arrays: Use list reference for multidimensional array access

2000-09-26 Thread Bart Lateur
On Mon, 25 Sep 2000 19:26:38 -0700, Nathan Wiger wrote: >> I agree with both of you. It would be nice if @$ precedence worked as Bart >> specified, but I still think that arrays should be arrays. > >The problem is that > > $name = "myarray"; > @$name = (1,2,3); > print @$name[0,1]; # 1,2 >

Re: RFC 204 (v2) Arrays: Use list reference for multidimensional array access

2000-09-25 Thread Bart Lateur
On Fri, 22 Sep 2000 08:58:10 +1100, Jeremy Howard wrote: >Bart Lateur wrote: >> Hmm... the problem is, I think, that array references and ordinary >> scalars are both scalars. >> >That's true, but they're scalars with different interfaces. In particular, >

Re: RFC 204 (v2) Arrays: Use list reference for multidimensional array access

2000-09-21 Thread Bart Lateur
On 20 Sep 2000 04:06:02 -, Perl6 RFC Librarian wrote: >Ilya Zakharevich brought up the issue of a potential problem with >objects which use blessed list references as their internal structure, >and their use as indices. Given a Bignum class, which stores its >(external) value internally as a

Re: RFC 206 (v2) Arrays: @#arr for getting the dimensions of an array

2000-09-20 Thread Bart Lateur
On 20 Sep 2000 04:07:27 -, Perl6 RFC Librarian wrote: >Where an array is declared without ':bounds', @# returns the largest >bounds of each dimension that has been accessed: Wouldn't that be slow? -- Bart.

Re: RFC 237 (v1) hashes should interpolate in double-quoted strings

2000-09-18 Thread Bart Lateur
On 17 Sep 2000 23:54:05 -0400, Chaim Frenkel wrote: >What about formating the output as a value that can be used by eval? > > %hash = (a => 1, b => 'the world'); > print "%{hash}\n"; > >('a' => 1, 'b'=> 'the world') So, what about arrays? Or scalars? We have Data::Dumper for that.

Re: RFC 237 (v1) hashes should interpolate in double-quoted strings

2000-09-18 Thread Bart Lateur
On Sun, 17 Sep 2000 21:59:47 -0700, Nathan Wiger wrote: >Yeah, I for one think %hashes should be interpolated exactly like >@arrays. It's simple and consistent. Simple and consistent would be behaviour like "@{[%hash]}" However, convenient it is not, getting all key/value pairs in one

Re: RFC 201 (v1) hash slicing

2000-09-09 Thread Bart Lateur
On 8 Sep 2000 04:57:46 -, Perl6 RFC Librarian wrote: >Instead of > > %subhash = map { f($_) ? ($_, $hash{$_}) : () } keys %hash; # lengthy > >one may now write > > %subhash = %hash{f($_)};# code block f($_) will be evaluated for Truth >over all the keys I almost like

Re: RFC 196 (v1) More direct syntax for hashes

2000-09-08 Thread Bart Lateur
On Thu, 7 Sep 2000 20:56:47 -0400, Michael G Schwern wrote: >> C should reset the hash iterator, instead of calling >> C or C as is currently the case. > >Sounds good, except the name. reset() already does something. >Currently, reset() is for clearing large swaths of global variables (a >dubiou

Re: RFC 196 (v1) More direct syntax for hashes

2000-09-08 Thread Bart Lateur
On Wed, 6 Sep 2000 22:58:05 -0400, John Porter wrote: > keys %hash = @things; > >is defined as being equivalent to > > @hash{ @things } = (); Two more details to think about: %hash = ( b => 'beta', d => 'delta' ); keys %hash = qw(a b c); What happens to the values t

Re: RFC 196 (v1) More direct syntax for hashes

2000-09-07 Thread Bart Lateur
On Wed, 6 Sep 2000 22:58:05 -0400, John Porter wrote: > keys %hash = @things; > >is defined as being equivalent to > > @hash{ @things } = (); > >This is to support hash-based set operations in a more >natural way, i.e. > > keys %hash = grep { exists $a{$_} } keys %b; I have dou

Re: Proposed RFC for matrix indexing and slicing

2000-08-31 Thread Bart Lateur
On Thu, 31 Aug 2000 11:20:25 +1100, Jeremy Howard wrote: >My hope is that we can have a single set of frozen RFCs in a month's time, >with incompatible or redundant RFCs withdrawn. >In the end, I trust Larry to make good in-or-out decisions if we give him >good input. Personally, I would like

Re: RFC 90 (v2) Builtins: merge() and demerge()

2000-08-30 Thread Bart Lateur
On 30 Aug 2000 01:22:40 -, Perl6 RFC Librarian wrote: >Builtins: merge() and demerge() ??? >It is proposed that two new functions, C, and C, be added >to Perl. C would return a list that >interleaved its arguments. C would reverse >this operation. Ah, now I understand. I did read the previ