Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python.announce > #939 > unrolled thread

MacroPy 0.1.2: Macros for Pythoon. Quasiquotes, Case Classes, Pattern Matching, LINQ and more!

Started byHaoyi Li <haoyi.sg@gmail.com>
First post2013-05-08 14:32 -0700
Last post2013-05-08 14:32 -0700
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python.announce


Contents

  MacroPy 0.1.2: Macros for Pythoon. Quasiquotes, Case Classes, Pattern Matching, LINQ and more! Haoyi Li <haoyi.sg@gmail.com> - 2013-05-08 14:32 -0700

#939 — MacroPy 0.1.2: Macros for Pythoon. Quasiquotes, Case Classes, Pattern Matching, LINQ and more!

FromHaoyi Li <haoyi.sg@gmail.com>
Date2013-05-08 14:32 -0700
SubjectMacroPy 0.1.2: Macros for Pythoon. Quasiquotes, Case Classes, Pattern Matching, LINQ and more!
Message-ID<mailman.1502.1368126543.3114.python-announce-list@python.org>
Hey All,

MacroPy is an implementation of Macros in the Python Programming, providing a mechanism for user-defined functions (macros) to perform transformations on the abstract syntax tree(AST) of Python code at module import time. This is an easy way to modify the semantics of a python program in ways which are otherwise impossible, for example providing an extremely concise way of declaring classes:

@case
class Point(x, y)

p = Point(1, 2)
print p.x   # 1
print p     # Point(1, 2)

Apart from this, we've used MacroPy's macros to implement a pretty impressive list of features:

- Quasiquotes
- String Interpolation
- Pyxl, integrating XML markup into a Python program
- Tracing and Smart Asserts
- Case Classes, easy Algebraic Data Types from Scala
- Pattern Matching from the Functional Programming world
- LINQ to SQL from C#
- Quick Lambdas from Scala and Groovy,
- Parser Combinators, inspired by Scala's.

The full documentation is over on github (https://github.com/lihaoyi/macropy) if anyone wants to check it out. It runs fine on both CPython 2.7 and PyPy 1.9, and I've just pushed the last up-to-date version of MacroPy to PyPI: 

https://pypi.python.org/pypi/MacroPy 

Hope someone finds this useful! 

Thanks! 
-Haoyi

[toc] | [standalone]


Back to top | Article view | comp.lang.python.announce


csiph-web