Hi Mateusz,

> there is a +Key prefix class for unique index for a relation. As far as I 
> understand it, it only works for single attribute of object.

Yes, but this attribute doesn't have to be atomic.

> Is there a reasonably straightforward way to have an index that requires 
> uniqueness of tuple/list of two or more attributes?

So you might define a relation

   (rel nrs (+Key +List +Number))

and store a list of numbers there, or

   (rel sts (+Key +List +String))

for a list of strings.

You might also use something like

   (rel bg (+Key +Bag)
      ((+Date))            # Valid from
      ((+Number) 2)        # Percent
      ((+Symbol)) )        # Type

for a list of different items, or simply

   (rel xx (+Key +Any))

for any arbitrary Lisp data structure. This is not further checked at
runtime than, and you have to take care to build the right structure by
yourself (the +List and +Bag relations handle that for you to a certain
degree).

Cheers,
- Alex
-- 
UNSUBSCRIBE: mailto:picol...@software-lab.de?subject=unsubscribe

Reply via email to