On Thu, Aug 17, 2006 at 01:11:00PM -0700, jerry gay wrote:
> On 8/17/06, Chip Salzenberg <[EMAIL PROTECTED]> wrote:
> >     $S0 = default hsh['key'], ''
> >[...]
> >     $P0 = new .Undef
> >     $P1 = default hsh['key1'], $P0
> >     $P1 = default hsh['key2'], $P0
> >     ...
> >
> >It would work without the lookups too:
> >
> >     $S0 = default $S0, ''    # if $S0 is null, assign it ''
> >
> >what say?
> >
> 
> default is ugly. err is sexy.
> 
> ## if $S0 is null, assign it ''
> #pasm
> err $S0, ''
> err $S1, $S2, ''
> 
> #pir
> $S0 //= ''
> $S0 = err ''
> $S0 = err $S1, ''

There might be a cognitive dissonance here with "err", since
C<err> in pasm/pir is testing for null, while  C<err> in
perl6 tests for definedness.  While it doesn't much matter
for strings in the examples above, it might make a difference for

    $S0 = err hsh['key1'], 'foo'

Pm

Reply via email to