summaryrefslogtreecommitdiff
path: root/examples/l-system-example.lisp
diff options
context:
space:
mode:
authorBruno Cichon <ebrasca.ebrasca@openmailbox.org>2016-11-04 21:01:02 +0100
committerBruno Cichon <ebrasca.ebrasca@openmailbox.org>2016-11-04 21:01:02 +0100
commite28171df2caa910eb194750f70bdfe9272f85f6d (patch)
tree6ff0921591176bd55eef45b4b158c86199c4c711 /examples/l-system-example.lisp
parente14766f4732beb281f3393ab3e2b7f56422f1cb2 (diff)
Fix some of semantics mistakes.
Diffstat (limited to 'examples/l-system-example.lisp')
-rw-r--r--examples/l-system-example.lisp18
1 files changed, 18 insertions, 0 deletions
diff --git a/examples/l-system-example.lisp b/examples/l-system-example.lisp
new file mode 100644
index 0000000..4d8a53a
--- /dev/null
+++ b/examples/l-system-example.lisp
@@ -0,0 +1,18 @@
+(in-package #:l-system-examples)
+
+;;;Parametric grammars
+(-> f ()
+ (f 1)
+ (j 1)
+ (f 1))
+
+(-> j (x)
+ (j (* 3 x)))
+
+(l-system #'parametric-grammar '((f 1.0)) 2)
+
+;;;Context sensitive grammars
+(-> (f j f) (x)
+ (j (* 2 x)))
+
+(l-system #'context-sensitive-grammar '((f 1.0)) 2)