Re: How to implement Varient/Tagged Unions/Pattern Matching in Python?

2009-12-12 Thread Kay Schluehr
BTW, Please don't ask Why do you want to do like this No, I don't ask although it would be the interesting aspect for me ;) -- http://mail.python.org/mailman/listinfo/python-list

Re: How to implement Varient/Tagged Unions/Pattern Matching in Python?

2009-12-11 Thread Aahz
In article 358b227c-d836-4243-b79a-57258590a...@a10g2000pre.googlegroups.com, metal metal...@gmail.com wrote: I want to get pattern matching like OCaml in python(ref:http:// en.wikipedia.org/wiki/Tagged_union) I consider the syntax: def decl(): def Plus(expr, expr): pass def

How to implement Varient/Tagged Unions/Pattern Matching in Python?

2009-12-02 Thread metal
I want to get pattern matching like OCaml in python(ref:http:// en.wikipedia.org/wiki/Tagged_union) I consider the syntax: def decl(): def Plus(expr, expr): pass def Minus(expr, expr): pass def Times(expr, expr): pass def Divide(expr, expr): pass def