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

From: Neo <neo55592_at_hotmail.com>
Date: 31 Mar 2006 17:32:07 -0800
Message-ID: <1143855127.077501.147660_at_j33g2000cwa.googlegroups.com>


> ... Not only should the function work for data entered
> prior to writing the function but also for new data
> entered after the function is written.

Below script provides a further example of the above. Suppose we now add a new person who doesn't have a name but his color is purple. And we make him an employe of ishmael. Will the original db, schema and user-defined function still work? See below:

// Create a new person with no name but his color is purple // and make him an employe of ishmael.
(create type instance (new))
(create (it) name (findElseAdd name instance 'color'))

(create person instance (new))
(create (it) color (findElseAdd color instance 'purple'))

(create (it) boss ishmael)
(create ishmael employe (it))

// Get root boss of the person whose color is purple. // Displays ishmael !!!
(msgbox (getRoot boss

                 (and (select person instance *)
                      (select * color purple)
                 )
        )

)

Notice above, the second parameter to the getRoot function, which in prior examples has been a simple parameter such as adam, eve, abraham .... has been substituted by a sub-expression which resolves to the purple-colored person without a name. Received on Sat Apr 01 2006 - 03:32:07 CEST

Original text of this message