[DGD] Switch-Case Variable Scope

Blain blain20 at gmail.com
Thu Apr 18 15:36:05 CEST 2013


Hey, Felix...  I don't suppose you might not be totally averse to
switch-case local variables, wouldya?  The primary reason I prefer them is
for typechecking purposes.  Other reasons amount to aesthetics only, though.

Here's what I would like to do with them in places where I'd like to make
sure I sure I can get an error when I make a mistake with typing.

switch(typeof(arg))
{
case T_ARRAY:
  mixed *ret;

  <code>
  break;
cade T_MAPPING:
  mapping ret;

  <code>
  break;
}

Anyway, just a thought.  I won't cry if you say no.

*grin*
-Blain



More information about the DGD mailing list