Changeset 7191

Show
Ignore:
Timestamp:
09/28/05 23:11:18 (3 years ago)
Author:
fglock
Message:

* perl5/Junction - fixed boolean junctions such as ?(1|0)

Location:
perl5
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • perl5/PIL-Run/lib/PIL/Run/PrimP5.pm

    r7179 r7191  
    193193MULTI SUB lcfirst ($xx) { p6_from_s( lcfirst(p6_to_s($xx)) ) }; 
    194194MULTI SUB uc ($xx)      { p6_from_s( uc(p6_to_s($xx)) )  }; 
    195 MULTI SUB ucfirst ($xx) {  p6_from_s( ucfirst(p6_to_s($xx)) ) }; 
     195MULTI SUB ucfirst ($xx) { p6_from_s( ucfirst(p6_to_s($xx)) ) }; 
    196196MULTI SUB capitalize ($xx) { 
    197197    my $string = $xx->unboxed; 
  • perl5/Perl6-Value/lib/Perl6/Code.pm

    r7189 r7191  
    224224                my ($self, @arguments) = @_; 
    225225                #warn "DO @arguments\n"; 
    226  
    227226                # is there a junction in the arg list? 
    228227                for my $i ( 0 .. $#arguments ) { 
    229228                    my $arg = $arguments[$i]; 
    230                     if ( $arg =~ /Junction/ ) { 
     229                    if ( $arg->isa( 'Junction' ) ) { 
    231230                        #warn "HAS JUNCTION ", $arg->str->unboxed; 
    232231                        my @items = @{$arg->things}; 
    233                         #warn "ITEMS @items"; 
    234  
     232                        #warn "ITEMS @items = @{[ map { Perl6::Value::stringify($_) } @items ]}"; 
    235233                        my @r; 
    236234                        for my $element ( @items ) { 
     
    239237                            push @r, $self->do( @a ); 
    240238                        } 
     239                        #warn "RETURNING @r = @{[ map { Perl6::Value::stringify($_) } @items ]}"; 
    241240                        my $j = Junction->new; 
    242241                        $j->type( $arg->type );   
  • perl5/Perl6-Value/lib/Perl6/Junction.pm

    r7186 r7191  
    4141                } 
    4242                @res = sort { Perl6::Value::identify($a) cmp Perl6::Value::identify($b) } @res; 
    43                 my $last_id = ''; 
     43                my $last_id = rand(); 
    4444                #warn "SORTED @res"; 
    4545                @res = grep {  
    4646                        my $id = Perl6::Value::identify( $_ ); 
     47                        #warn "ID $id"; 
    4748                        $id eq $last_id ? 0 : ( $last_id = $id, 1 ) 
    4849                    } @res;