[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: text processing as *the* problem
At 11:39 AM 12/3/2001 -0800, KELLEHER,KEVIN (Non-HP-Roseville,ex1) wrote:
>it would be so handy if C/C++ had something like this:
>
> switch (myVariable) {
> case "who":
> ...
> break;
>
> case "what":
> ...
> break;
> ...
> }
Yep. One of the nice bits I hope will go into perl 6 (I'm certainly making
allowances for it) is quantum-mechanics-like eigenstate stuff in the switch
statement (amongst other places), along with arbitrary comparisons, so your
case could be /\w+/ which'll be true if either any or all (depending on the
type of the switch) of the values in the switch list had one or more word
characters in it.
Dan
--------------------------------------"it's like this"-------------------
Dan Sugalski even samurai
dan@sidhe.org have teddy bears and even
teddy bears get drunk