Porting a piece of Lisp code to Clojure (PAIP)
Posted
by
Robert Brown
on Stack Overflow
See other posts from Stack Overflow
or by Robert Brown
Published on 2010-12-31T22:48:42Z
Indexed on
2010/12/31
22:53 UTC
Read the original article
Hit count: 473
I'm reading Paradigms of Artificial Intelligence Programming (PAIP) by Peter Norvig and I'm trying to write all the code in Clojure rather than common Lisp. However I'm stuck on this piece of code on page 39:
(defparameter *simple-grammar*
'((sentence -> (noun-phrase verb-phrase))
(noun-phrase -> (Article Noun))
(verb-phrase -> (Verb noun-phrase))
(Article -> the a)
(Noun -> man ball woman table)
(Verb -> hit took saw liked))
"A grammar for a trivial subset of English.")
(defvar *grammar* *simple-grammar*)
How can I translate this into Clojure? Thanks.
© Stack Overflow or respective owner