Contents    Page-10    Prev    Next    Page+10    Index   

Notes on Database Grammar

It is good to write grammar rules that cover multiple sentences, using:

My solution for the restaurant assignment only has 5 rules for the top-level nonterminal s.

Multiple actions can be combined using do:


(do (retrieve 'streetno) (retrieve 'street))

Questions such as how many or what is the best require post-processing. The result of the query (restrictions and retrievals) is available as the variable $$:


(postpr '(length (quote $$)))
In this case, postpr specifies post-processing, and length is the function that is called; this would answer how many.