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

Re: nothing

Thread Previous | Thread Next
March 21, 2005 13:00
Re: nothing
Message ID:
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.


Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About