develooper Front page | perl.perl5.porters | Postings from August 2012

Re: fixing smartmatch just hard enough (and when, too)

Thread Previous | Thread Next
Jesse Luehrs
August 20, 2012 05:45
Re: fixing smartmatch just hard enough (and when, too)
Message ID:
On Thu, Aug 16, 2012 at 05:58:16PM -0400, Ricardo Signes wrote:
> Also, `when` should be valid inside an auto-topicalizing `while`, providing an
> implicit next, making its behavior more generic so that `when` can be used
> safely everywhere that it makes sense.

One other thing - why do we limit the use of 'when' like this at all? Is
there any reason we can't just say that when always does an implicit
next regardless of where it's used, and so any time you're in a context
where 'next' makes sense (which is really most places), 'when' would
also work? For instance:

  $_ = "foo";
      when (/f/) { ... }
      when (/a/) { ... }

Is there any reason that something like that wouldn't have well-defined


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