[Pyrex] C-switch in Pyrex?

Robert Bradshaw robertwb at math.washington.edu
Wed Oct 31 18:48:08 CET 2007


There have been a couple of times when I would've really liked a  
switch statement too, but there are a couple issues. Would switch  
statements fall through (as in C)? Would we require the cases to be  
ints? What about

http://www.python.org/dev/peps/pep-3103/

or some future Python proposal? Is it just for optimization reasons  
that you don't want to do a if-elif chain?

  -Robert


On Oct 31, 2007, at 10:02 AM, Alexander Belchenko wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hi,
>
> Is there any way to use switch construct in Pyrex, or to force it's  
> generation in C-output?
> I dreaming about construct in Pyrex like:
>
> switch c_int_var:
>     case 1:
> 	do_something()
>     case 2:
> 	do_another_thing()
>     default:
> 	default_action()
>
> (I apologize if this is the stupid question or it was discussed  
> before.)
>
> Alexander
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.6 (MingW32)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>
> iD8DBQFHKLUezYr338mxwCURAkCUAJ9uuJQ5sxE0r4+kCpn5dfrvk3jWyACdFhQO
> rTSv+zjcDd6IoT//qjXCLew=
> =5n0N
> -----END PGP SIGNATURE-----
>
>
> _______________________________________________
> Pyrex mailing list
> Pyrex at lists.copyleft.no
> http://lists.copyleft.no/mailman/listinfo/pyrex

-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 186 bytes
Desc: This is a digitally signed message part
Url : http://lists.copyleft.no/pipermail/pyrex/attachments/20071031/28dd852e/attachment-0001.bin 


More information about the Pyrex mailing list