[cells-devel] Re: [cello-devel] Constructor syntax
Thomas F. Burdick
tfb at OCF.Berkeley.EDU
Mon May 10 23:35:35 UTC 2004
Kenny Tilton writes:
> Thomas F. Burdick wrote:
>
> >Okay, how are these for a start?
> >
> > (defmacro cv (&optional (value +unbound+))
> > `(cells::make-c-variable :value ,value))
> >
> > (defmacro c-formula ((&rest keys &key lazy cyclic-p cyclic-value) &body forms)
> > (declare (ignore lazy cyclic-p cyclic-value))
> > `(cells::make-c-dependent :code ',forms :rule (c-lambda , at forms)
> > , at keys))
> >
> > (defmacro c-variable ((&rest keys &key cyclic-p) &optional (value nil valuep))
> > (declare (ignore cyclic-p))
> > `(cells::make-c-variable :value ,(if valuep value '+unbound+) , at keys))
>
> looks ok. but...
>
> 1. Is there a definition for +unbound+ missing?
>
> 2. Maybe if I stare at it long enough it will come to me, but why not do
> on c-variable what is proposed for cv, viz.,:
>
> &optional (value '+unbound+)
Hmm, maybe I should have edited these on their way out of my utils
file. +unbound+ is from (defconstant +unbound+ '+unbound+), from my
unbound-cells hack from before. As for (2), yeah, that would be
simpler. It was a mental-cut-and-paste error, from having written a
bunch of macros right before that, that needed the supplied-p value.
More information about the cello-devel
mailing list