develooper Front page | perl.perl6.language | Postings from March 2005

Re: nothing

Thread Previous | Thread Next
From:
Juerd
Date:
March 21, 2005 13:00
Subject:
Re: nothing
Message ID:
20050321205954.GL29322@c4.convolution.nl
Austin Hastings skribis 2005-03-21 15:55 (-0500):
> I'd like to see nothing as just an alias for {}.
>  if $expr
>  {
>    do nothing;
>  }
> Possibly the most clear piece of P6 code ever.

Dangerous, though :)

    do nothing if $input =~ /\W/;
    system "rm -- $input"; 

But yes, an alias would be nice. There have been some cases where I
wanted to explicitly state "} else { do nothing }" to make clear that it
was not a design bug.

However, the very same thing can be done with a simple comment:

    } else {
        # do nothing
    }

And that is exactly what I do.


Juerd
-- 
http://convolution.nl/maak_juerd_blij.html
http://convolution.nl/make_juerd_happy.html 
http://convolution.nl/gajigu_juerd_n.html

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About