combining dc and dp

Eduardo Cavazos <[email protected]> Wed, 14 Mar 2007 23:08:23 -0600
Newsgroups gmane.comp.lang.goo.general
Message-ID <[email protected]>
Hello,

It would be nice to have a short-hand notation for defining a class and it's 
associated properties. For example:

(dc <foo> (<any>))

(dp a (<foo> => <int>))
(dp b (<foo> => <int>))
(dp c (<foo> => <int>))

Would be this instead:

(dcp <foo> (<any>) (a|<int> b|<int> c|<int>))

Here's what I hacked up:

(ds dcp (,name ,parents ,properties)
  
  (let ((property-definitions
         (map (fun (x)
                `(dp ,[x 0] (,name => ,[x 1])))
              properties)))

    `(seq
       (dc ,name ,parents)
       ,@property-definitions)))

Ed

_______________________________________________
Googoogaga mailing list
[email protected]
https://lists.csail.mit.edu/mailman/listinfo/googoogaga