Re: Storing data and code in a Db with LISP-like interface

From: Neo <neo55592_at_hotmail.com>
Date: 26 Apr 2006 20:57:44 -0700
Message-ID: <1146110264.135794.143190_at_u72g2000cwu.googlegroups.com>


Below is a comparision between Prolog and dbd's expressions to perform various queries. (Sure would have liked to seen RM and LISP's)

> vegetables that john likes:
Prolog: ?- findall(Veg, likes(john,vegetable,Veg), Vegs). dbd: (and (select john like *) (select vegetable instance *))

> fruits that john likes:

Prolog: ?- findall(Fruit, likes(john,fruit,Fruit), Fruits). dbd: (and (select john like *) (select fruit instance *))

> foods that john likes:
Prolog: ?- findall(Food, likes(john,_,Food), Foods). dbd: (and (select john like *) (select food instance *))

Why are there variables with and without 's' at the end, ie Food/Foods? Why is the syntax for the last Prolog query different than the prior ones?

(Note original example classifies food entries as entry not food, but that is OK) Received on Thu Apr 27 2006 - 05:57:44 CEST

Original text of this message