<?xml version="1.0" encoding="UTF-8" ?>
<rdf:RDF xmlns="http://usefulinc.com/ns/doap#" xmlns:foaf="http://xmlns.com/foaf/0.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"><Project><name>PEAK-Rules</name>
<shortdesc>Generic functions and business rules support systems</shortdesc>
<description>PEAK-Rules is a highly-extensible framework for creating and using generic
functions, from the very simple to the very complex.  Out of the box, it
supports multiple-dispatch on positional arguments using tuples of types,
full predicate dispatch using strings containing Python expressions, and
CLOS-like method combining.  (But the framework allows you to mix and match
dispatch engines and custom method combinations, if you need or want to.)

Basic usage::

    &gt;&gt;&gt; from peak.rules import abstract, when, around, before, after

    &gt;&gt;&gt; @abstract()
    ... def pprint(ob):
    ...     """A pretty-printing generic function"""

    &gt;&gt;&gt; @when(pprint, (list,))
    ... def pprint_list(ob):
    ...     print "pretty-printing a list"

    &gt;&gt;&gt; @when(pprint, "isinstance(ob,list) and len(ob)&gt;50")
    ... def pprint_long_list(ob):
    ...     print "pretty-printing a long list"

    &gt;&gt;&gt; pprint([1,2,3])
    pretty-printing a list

    &gt;&gt;&gt; pprint([42]*1000)
    pretty-printing a long list

    &gt;&gt;&gt; pprint(42)
    Traceback (most recent call last):
      ...
    NoApplicableMethods: ...

PEAK-Rules works with Python 2.3 and up -- just omit the ``@`` signs if your
code needs to run under 2.3.  Also, note that with PEAK-Rules, *any* function
can be generic: you don't have to predeclare a function as generic.  (The
``abstract`` decorator is used to declare a function with no *default* method.)

PEAK-Rules is still under development; it lacks much in the way of error
checking, so if you mess up your rules, it may not be obvious where or how you
did.  User documentation is also lacking, although there are extensive doctests
describing most of its internals.

Source distribution snapshots are generated daily, but you can also update
directly from the `development version`_ in SVN.

.. _development version: svn://svn.eby-sarna.com/svnroot/PEAK-Rules#egg=PEAK_Rules-dev
.. _toc:</description>
<download-page>http://peak.telecommunity.com/snapshots/</download-page>
<homepage rdf:resource="http://pypi.python.org/pypi/PEAK-Rules" />
<maintainer><foaf:Person><foaf:name>Phillip J. Eby</foaf:name>
<foaf:mbox_sha1sum>74e889834c9780ae22d7c8e13126b991295f6b66</foaf:mbox_sha1sum></foaf:Person></maintainer>
<release><Version><revision>0.5a1.dev</revision></Version></release>
</Project></rdf:RDF>