Changeset 22005

Show
Ignore:
Timestamp:
08/22/08 11:08:07 (3 months ago)
Author:
lwall
Message:

[STD] remove p5ish usages of exists/delete
[gimme5] translate .:exists and .:delete forms to p5
[S29] remove "is export" from exists/delete methods

Files:
3 modified

Legend:

Unmodified
Added
Removed
  • docs/Perl6/Spec/Functions.pod

    r21375 r22005  
    1313                Mark Stosberg <mark@summersault.com> 
    1414 Date:          12 Mar 2005 
    15  Last Modified: 18 Jul 2008 
    16  Version:       23 
     15 Last Modified: 22 Aug 2008 
     16 Version:       24 
    1717 
    1818This document attempts to document the list of builtin functions in Perl 6. 
     
    560560=item delete 
    561561 
    562  our List multi method delete (@array : *@indices ) is export 
     562 our List method delete (@array : *@indices ) is export 
    563563 
    564564Sets elements specified by C<@indices> in the invocant to a 
     
    577577=item exists 
    578578 
    579  our Bool multi method exists (@array : Int *@indices ) is export 
     579 our Bool method exists (@array : Int *@indices ) 
    580580 
    581581True if the specified Array element has been assigned to. This 
     
    585585an error. 
    586586 
    587 An unary form is expected. See C<Hash::delete>. 
     587A unary form is expected. See C<Hash::delete>. 
    588588 
    589589 
  • src/perl6/STD.pm

    r22002 r22005  
    154154    say print open close printf sprintf slurp unlink link symlink 
    155155    elems grep map first reduce sort push reverse take splice 
    156     exists delete 
    157156 
    158157    zip each roundrobin caller 
     
    180179push @routinenames, "HOW", "fail", "temp", "let"; 
    181180 
    182 # if True ref False unless length bless delete exists 
     181# please don't add: ref length bless delete exists 
    183182 
    184183my %routinenames; 
     
    458457 
    459458token ws { 
    460     # XXX exists is a p5ism 
    461     :my @stub = return self if exists self.<_>[self.pos]<ws>; 
     459    :my @stub = return self if self.<_>[self.pos].:exists<ws>; 
    462460    :my $startpos = self.pos; 
    463461 
     
    33133311# hopefully we can include these tokens in any outer LTM matcher 
    33143312regex stdstopper { 
    3315     :my @stub = return self if exists self.<_>[self.pos]<endstmt>; 
     3313    :my @stub = return self if self.<_>[self.pos].:exists<endstmt>; 
    33163314    [ 
    33173315    | <?terminator> 
     
    39753973token in (Str $stop, Str $insides, Str $name = $insides) { 
    39763974    :my $GOAL is context = $stop; 
    3977     <x=$insides> $stop {{ $/.{$insides} = $<x>; delete $<x> }} || <.panic: "Unable to parse $name; couldn't find final '$stop'"> 
     3975    <x=$insides> $stop {{ $/.{$insides} = $<x>; $/.:delete<x> }} || <.panic: "Unable to parse $name; couldn't find final '$stop'"> 
    39783976} 
    39793977 
  • src/perl6/gimme5

    r21975 r22005  
    8080    $f =~ s/\\x([0-9a-fA-F]{3,4})/\\x{$1}/g; 
    8181    $f =~ s!\$([0-9]+)!\$\$C{$1}!g; 
     82    $f =~ s/(\S+\.):(exists|delete)/$2 $1/g if $f =~ /\.:(exists|delete)/; 
    8283    while ($f ne "") { 
    8384        #print "$f\n" if $trace;