Discussion:
combining dc and dp
Eduardo Cavazos
2007-03-15 05:08:23 UTC
Permalink
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

Loading...