combining dc and dp

View: New views
1 Messages — Rating Filter:   Alert me  

combining dc and dp

by Eduardo Cavazos :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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
Googoogaga@...
https://lists.csail.mit.edu/mailman/listinfo/googoogaga
LightInTheBox - Buy quality products at wholesale price