Author: Maciej Fijalkowski <[email protected]> Branch: Changeset: r370:b52283fb3bc9 Date: 2013-07-08 10:31 +0200 http://bitbucket.org/pypy/stmgc/changeset/b52283fb3bc9/
Log: Another example (that unfortunately segfaults) diff --git a/duhton/demo/trees2.duh b/duhton/demo/trees2.duh new file mode 100644 --- /dev/null +++ b/duhton/demo/trees2.duh @@ -0,0 +1,19 @@ + +(defun create-tree (n) + (if (< n 1) (list 1) (list (create-tree (/ n 2)) (create-tree (/ n 2)))) +) + +(defun walk-tree (tree) + (if (== (len tree) 1) (get tree 0) + (+ (walk-tree (get tree 0)) (walk-tree (get tree 1))) + ) +) + +(defun lookup-tree () + (walk-tree (create-tree 1024)) +) + +(setq n 0) +(while (< n 1000) + (transaction lookup-tree) + (setq n (+ n 1))) _______________________________________________ pypy-commit mailing list [email protected] http://mail.python.org/mailman/listinfo/pypy-commit
