Re: RFC 262 (v1) Index Attribute

2000-09-28 Thread David L. Nicol
Webmaster wrote: (I have attached a prototype of what I had in mind) From: "David L. Nicol" [EMAIL PROTECTED] Yes, that is exactly what is being suggested, but the "indexof" function is implicit in the attribute. Your code becomes print "Found It at position ${_:n}!\n" if /$seek/

Re: RFC 262 (v1) Index Attribute

2000-09-28 Thread John Porter
David L. Nicol wrote: print "Found It at position ${_:n}!\n" if /$seek/ foreach @items If we are going to be throwing around attributes like that, why don't we switch to using the ubiquitously recognizable dot instead of colon? for my $iter ( @things ) { print

Re: RFC 262 (v1) Index Attribute

2000-09-28 Thread David L. Nicol
John Porter wrote: David L. Nicol wrote: print "Found It at position ${_:n}!\n" if /$seek/ foreach @items If we are going to be throwing around attributes like that, why don't we switch to using the ubiquitously recognizable dot instead of colon? for my $iter (

Re: RFC 262 (v1) Index Attribute

2000-09-27 Thread David L. Nicol
Webmaster wrote: What would really be nice here is an Cindex function, similar to the scalar version, that returns the index of the matching entry in a list. For instance: my $n=0; foreach (@items){ print "Found It at position $n!\n" if /$seek/; $n++; } Could be replaced by:

Re: RFC 262 (v1) Index Attribute

2000-09-20 Thread Webmaster
David Nicol Wrote in RFC 262: foreach $item (@items){ #print "$item was at location ",$item:n,"\n"; print "$item was at location ${item:n}\n"; }; What would really be nice here is an Cindex function, similar to the scalar version, that returns the index of the matching entry in a list. For

Re: RFC 262 (v1) Index Attribute

2000-09-20 Thread Graham Barr
On Wed, Sep 20, 2000 at 08:05:20AM -0400, Webmaster wrote: David Nicol Wrote in RFC 262: foreach $item (@items){ #print "$item was at location ",$item:n,"\n"; print "$item was at location ${item:n}\n"; }; What would really be nice here is an Cindex function, similar to the scalar

Re: RFC 262 (v1) Index Attribute

2000-09-20 Thread Webmaster
Graham Barr Wrote: Well if there ever is a way to shortcut grep this could be genera;ized to my $index = grep { break if $_ eq $seek; 1 } @items; Wouldn't this also assume that grep return the number of times the block was NOT true, rather than it's current implementation of the number of

Re: RFC 262 (v1) Index Attribute

2000-09-20 Thread Graham Barr
On Wed, Sep 20, 2000 at 09:03:39AM -0400, Webmaster wrote: Graham Barr Wrote: Well if there ever is a way to shortcut grep this could be genera;ized to my $index = grep { break if $_ eq $seek; 1 } @items; Wouldn't this also assume that grep return the number of times the block was NOT

RFC 262 (v1) Index Attribute

2000-09-19 Thread Perl6 RFC Librarian
This and other RFCs are available on the web at http://dev.perl.org/rfc/ =head1 TITLE Index Attribute =head1 VERSION Maintainer: David Nicol [EMAIL PROTECTED] Date: 19 Sep 2000 Mailing List: [EMAIL PROTECTED] Number: 262 Version: 1 Status: Developing =head1 ABSTRACT An