Charlemagne is a genetic programming tool that is written in both Python and Lisp [via gavin]. The uneasy truce between the two languages seems to have come about when clisp was embedded in Python.
From the manual:
Posted by jjwiseman at December 09, 2004 02:49 PMHere is an example of an interactive session defining a complex deviance calculating function:
>>> lsp.interactive() CLISP> (defvar SPEED 0.05) SPEED CLISP> (defvar TURNS 50.0) TURNS CLISP> (defun simulator-helper (p turns x y) ...> (if (eq turns 0) ...> (sqrt (+ (* x x) (* y y))) ...> (progn ...> (setq INPUT1 x) ...> (setq INPUT2 y) ...> (let ((theta (degrees-to-radians (eval p)))) ...> (simulator-helper ...> p ...> (- turns 1) ...> (+ x (* SPEED (cos theta))) ...> (+ y (* SPEED (sin theta)))))))) 'SYRUP-DEVIANCE-HELPER' CLISP> (defun simulator (p) ...> (/ (deviance-helper TURNS 50 INPUT1 INPUT2) TURNS)) 'SYRUP-DEVIANCE' CLISP> exit >>> cfg.configure("deviance-calculation", LISP-FUNCTION=simulator) >>> cfg.configure("input", [[1.0,1.0], [0.5,0.5], [-1.0,-1.0], [-0.5,-0.5], [0.25,-0.25],[-1.0,0.75], [0.25,-0.5], [1.0,-1.0]]) >>> cfg.apply()
Happy 1000th post (kinda, excluding some porting and renumbering issues).
Posted by: Aaron Brady on December 9, 2004 03:26 PMWurghfl...
That is one of the most disturbing things I have ever seen, definite visceral horror factor.
Heh, thanks! I noticed that when I initially posted it, and meant to go back and update it with a mention, but then I got distracted.
Woo!