[pypy-svn] r40817 - pypy/dist/pypy/doc

afayolle at codespeak.net afayolle at codespeak.net
Tue Mar 20 11:16:32 CET 2007


Author: afayolle
Date: Tue Mar 20 11:16:31 2007
New Revision: 40817

Modified:
   pypy/dist/pypy/doc/getting-started.txt
Log:
getting started on aspect oriented programming

Modified: pypy/dist/pypy/doc/getting-started.txt
==============================================================================
--- pypy/dist/pypy/doc/getting-started.txt	(original)
+++ pypy/dist/pypy/doc/getting-started.txt	Tue Mar 20 11:16:31 2007
@@ -324,6 +324,31 @@
 .. _`Logic Object space features`: howto-logicobjspace-0.9.html
 
 
+Aspect Oriented Programming
++++++++++++++++++++++++++++
+
+PyPy provides some `Aspect Oriented Programming` facilities. 
+
+Try it out::
+
+ cd pypy
+ python bin/py.py
+
+ >>>> from aop import Aspect, before, PointCut
+ >>>> class DemoAspect:
+ ....     __metaclass__ = Aspect
+ ....     @before(PointCut(func="^open$").call())
+ ....     def before_open(self, joinpoint):
+ ....         print "opening", joinpoint.arguments()
+ .... 
+ >>>> aspect = DemoAspect()
+ >>>> f = open("/tmp/toto.txt", 'w')
+
+To read more about this, try the `aop module documentation`_.
+
+.. _`Aspect Oriented Programming`: http://aosd.net
+.. _`aop module documentation`: aspect_oriented_programming.html
+
 Running the tests
 +++++++++++++++++
 



More information about the Pypy-commit mailing list