develooper Front page | perl.perl5.porters | Postings from September 2009

Re: when ( foo() ) { ... }

Thread Previous | Thread Next
From:
Joshua ben Jore
Date:
September 23, 2009 20:55
Subject:
Re: when ( foo() ) { ... }
Message ID:
dc5c751d0909232055g60591ae3n67ad8eb4e664c11@mail.gmail.com
On Wed, Sep 23, 2009 at 3:52 PM, Yuval Kogman <nothingmuch@woobling.org> wrote:
> op.c's looks_like_bool has a comment:
>
>    /* Does this look like a boolean operation? For these purposes
>       a boolean operation is:
>         - a subroutine call [*]
> ...
>       [*] possibly surprising
>    */

Considering this code harder, I'm not sure it should ever admit the
concept of a boolean expression in when(). Perhaps if a person wants
to write a boolean, they should write:

  when ( ... )
  elsif ( ... )

Josh

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