From: ······@comac.com
Subject: Data Abstraction Question
Date: 
Message-ID: <96mpt9$sng$1@news.netmar.com>
Forgive my ignorance! Can someone help me "think in Lisp" about this?

Imagine a "structure or class" representing a (relational) database Relation
(table if you like), that has Attributes - a "list" of Attribute (column if
you like). (I use the term "list" loosely here to mean some aggregation, the
implementation of which may change.)

I want to abstract the way in which Attributes is implemented (good
programming, able to change later, ...). What is a good Scheme way to deal
with actions comparable to list "map" functions. Is it to implement a "map"
function for Attributes that I pass in functions to get the desired result?
Do I define a method to get-a-list of attributes and then work externally on
that with list functions?

For example I want to build functionality like build-update-stored-procedure,
etc. which could be done by mapping over the Attributes.

Alex


 -----  Posted via NewsOne.Net: Free (anonymous) Usenet News via the Web  -----
  http://newsone.net/ -- Free reading and anonymous posting to 60,000+ groups
   NewsOne.Net prohibits users from posting spam.  If this or other posts
made through NewsOne.Net violate posting guidelines, email ·····@newsone.net
From: Eugene Zaikonnikov
Subject: Re: Data Abstraction Question
Date: 
Message-ID: <6ybss1yn8d.fsf@viking.cit>
* "Alex" == apeake  <······@comac.com> writes:

Alex>  Forgive my ignorance! Can someone help me "think in Lisp" about
Alex>  this?  Imagine a "structure or class" representing a
Alex>  (relational) database Relation (table if you like), that has
Alex>  Attributes - a "list" of Attribute (column if you like). (I use
Alex>  the term "list" loosely here to mean some aggregation, the
Alex>  implementation of which may change.)

Take a look at UncommonSQL, which implement storage classes mapped
onto a database backend. It also illustrates how Meta-Object Protocol
can be employed for practical tasks. In particular, you may want to
start from VIEW-CLASS class and CREATE-VIEW-FROM-CLASS function.

The package can be obtained via cvs:
···············@alpha.onshore.com:/cvs uncommonsql
pasword: anoncvs

Alex>  What is a good Scheme way to deal with actions comparable to
Alex>  list "map" functions.

Not sure if the above concept can be easily translated to Scheme, due
to lack of MOP (and object system, after all).
People at comp.lang.scheme may give you better advises.

-- 
  Eugene