Juerd wrote:
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
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
Juerd wrote:
Rod Adams skribis 2005-03-21 14:25 (-0600):
if $expr {
nothing;
}
is harder to get confused over, IMO
Except writing something when you mean nothing is kind of weird. It
makes sense in rules because it doesn't usually make sense to match
nothingness, but for blocks, I'd ha
Rod Adams skribis 2005-03-21 14:25 (-0600):
> if $expr {
> nothing;
> }
> is harder to get confused over, IMO
Except writing something when you mean nothing is kind of weird. It
makes sense in rules because it doesn't usually make sense to match
nothingness, but for blocks, I'd hate to see
Larry Wall wrote:
On Sun, Mar 20, 2005 at 09:08:08PM -0600, Rod Adams wrote:
: I propose creating a no-op function "nothing" that can be used
: here or anywhere else you specifically wish to do nothing at all.
:
: given $this {
:when Even { nothing };
:when Prime { ... };
:default
On Sun, Mar 20, 2005 at 09:08:08PM -0600, Rod Adams wrote:
: Does Perl need a no-op function?
:
: With the addition of "no bare literals", it makes constructs like
:
: 1 while some_func();
:
: an error.
Well, it's not a bareword--it's just potentially a useless use of
the value in a void contex