pyLisp-NG

The Next Tiny Lisp in Python
Download

pyLisp-NG Ranking & Summary

Advertisement

  • Rating:
  • License:
  • LGPL
  • Price:
  • FREE
  • Publisher Name:
  • William S. Annis, Duncan McGreggor
  • Publisher web site:
  • https://launchpad.net/~oubiwann

pyLisp-NG Tags


pyLisp-NG Description

The Next Tiny Lisp in Python The pyLisp-NG project is an immediate descendant of PyLisp, which had its accidental birth as a result of William Annis' desire to build a CLIPS-like syntax for a simple expert system intended for the monitoring tool. As a result of Lisp interest on the Python news group, William released the software and announced it to the group.Several years later, the Evolver and txEvolver projects needed a functional programming language implementation in Python, as inspecting Python's AST was too much of a hassle. The author wanted to distribute, process, and manage evolutionary algorithms/programs across multiple remote Twisted servers, and manipulating permutations of partial programs was much easier to integrate with Twisted if the programs themselves could be evaluated and introspected easily with Python.pyLisp-NG inherits PyLisp's idiosyncratic charaateristics. For example, the booleans are true and false and it doesn't follow the convention that everything that isn't false is true (common to many Lisps). In fact, all booleans in pyLisp-NG are based on fuzzy logic, so you can do trickier things. Macros are, quite strangely, first class objects in PyLisp which maybe novel to Lisps:lisp> (setq foo 22)22lisp> ((macro (x) `(setq ,x (+ ,x 1))) foo)23pyLisp-NG, like its predecessor, has no intent of becomming a full-fledged, robust Lisp implementation. All progress is governed solely by the interest of contributing developers; right now, that's strictly for use as a genetic programming tool.Installation:pyLisp-NG is setuptools-friendly; you can install it with the following: $ easy_install pyLisp-NGYou can also get the full source code from Launchpad: $ bzr lp:pylisp-ngThe latter option greatly encouraged for interested users, as the repository contains extra files that are not included in the ditribution tarballs (such as the test runner and test utils).Usage:To use the interpretter from a full checkout, do this: $ cd < branch directory > $ ./bin/pylisp-ngIf you've installed with easy_install, and your Python scripts directory is in your PATH, all you'll need to do is this: $ pylisp-ngAt this point, you'll be able to enter Lisp expressions:lisp> ((lambda (x) (* x x)) 2)4lisp>You can use the s-expression code from Python:>>> from pylispng import lisp>>> l = lisp.SExpression('((lambda (x) (* x x)) 2)')>>> str(l)'((lambda (x) (* x x)) 2)'>>> l.eval()4Building an expression one symbol at a time or by adding chunks at a time:>>> l = lisp.SExpression()>>> l.append('+')>>> l.append('3')>>> l.append('5')>>> l.append('(* 3 3)')>>> str(l)'(+ 3 5 (* 3 3))'You can examine various properties of the s-expression:>>> l.eval()17>>> l.getDepth()2>>> len(l)4>>> l.getSize()2 Here are some key features of "pyLisp-NG": · A tiny Lisp dialect, easy to integrate into other Python projects. · Includes an interactive Lisp interpreter. · Expression introspection specifically designed for use in genetic programming. Requirements: · Python What's New in This Release: · Added introspection code that's useful for genetic programming. · A couple small bug fixes and some code cleanup.


pyLisp-NG Related Software