Я пытаюсь запустить этот код Lisp на rextester.com :
;gnu clisp 2.49
(defun sentence () (append (Noun-phrase) (Verb-phrase)))
(defun Noun-phrase () (append (Article) (Noun)))
(defun Verb-phrase () (append (Verb) (Noun-phrase)))
(defun Article() (one-of '(the a)))
(defun Noun () (one-of '(man ball)))
(defun Verb () (one-of '(run hit took saw)))
(defun one-of (set)
"Pick one element of set, and make a list of it"
(list (random-elt set)))
(defun random-elt (choices)
"Choose an element at a list at random"
(elt choices (random (length choices))))
(sentence)
Он выполняется, но ничего не печатает.
См. Также оригинал учебник .