Re: Storing data and code in a Db with LISP-like interface
Date: 3 Apr 2006 18:40:15 -0700
Message-ID: <1144114814.968102.87730_at_u72g2000cwu.googlegroups.com>
> > ... if two functions contain the same expression
> > [ie (select john like *)] that expression is normalized (automatically
> > by db engine) as are it's sub elements down to the level of symbols.
> >
>
> Should be interesting to see how you deal with lexical scopes. :-)
If the db contains like as an emotion and like as a comparator, the user would need to use an appropriate expression that specifies like an emotion, like a comparator, or both or the first one entered in the db. Below I show how to do each (which assumes appropriate data has been entered beforehand).
// Select john like (an emotion) something. (select john
(and (select emotion instance *) (select * name (select * symbol 'car'))) *)
// Select john like (a comparator) something. (select john
(and (select comparator instance *) (select * name (select * symbol 'car'))) *)
// Select john like (emotion or comparator) something. (select john
(select * name (select * symbol 'car')) *)
// Select john like (first like entered in db) something. (select john like *)
Note that, as described in earlier posts expression element "like" is translated by parser into following (firstNode (select * name (firstNode (select * symbol (select 'c' 'a' 'r'))))) which roughly means select the first thing whose name's first symbol string is 'car'. Received on Tue Apr 04 2006 - 03:40:15 CEST