Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> comp.databases.theory -> Re: Storing data and code in a Db with LISP-like interface

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

From: Nick Malik [Microsoft] <nickmalik_at_hotmail.nospam.com>
Date: Sat, 22 Apr 2006 12:29:41 -0700
Message-ID: <D6qdnX2y2JCWHtfZRVn-sQ@comcast.com>


"Neo" <neo55592_at_hotmail.com> wrote in message news:1144986888.222283.143660_at_z34g2000cwc.googlegroups.com...

> Below is a simple example that stores a person named John who likes
> Mary and then finds who John likes. Could you or someone familiar with
> Prolog show how to do this. Later I would like to extend the example to
> distill Prolog's fundamental forte (and possible weakness in
> representing things).

Get ready for a really long program!

    likes(john, mary).

That's it.

The query looks like this:

    ?- likes(john, Who)

the response is:

    Who = mary

Not much to it really.
I guess it is only interesting in the fact that your language takes about 30 lines to do what Prolog does in, what, one?

-- 
--- Nick Malik [Microsoft]
    MCSD, CFPS, Certified Scrummaster
    http://blogs.msdn.com/nickmalik

Disclaimer: Opinions expressed in this forum are my own, and not 
representative of my employer.
   I do not answer questions on behalf of my employer.  I'm just a 
programmer helping programmers.
-- 
Received on Sat Apr 22 2006 - 14:29:41 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US