[Bese-devel] Got in troubles again

Marco Baringer mb at bese.it
Tue Aug 16 08:52:07 UTC 2005


Friedrich Dominicus <frido at q-software-solutions.de> writes:

> I though about it quite some time now what about a thing like the
> following. As I understand a integer-field just can have one value,
> the initarg name is unimporant then, because he value should end in
> lisp-value. Shouldn't it be possible to write something along this
> lines then?
>
> (defclass t1 ()
>   ((lisp-value :accessor lisp-value)))
>
> (defmethod shared-initialize :after ((obj t1) slot-names &rest
>                                      initargs &key &allow-other-keys)
>   (setf (lisp-value obj) (cadr initargs))
>   obj)

sorry, why do you use &rest + #'cadr instead of &key?

> (defvar *t1-obj* nil)
> (setf *t1-obj* (make-instance 't1 :num 10))
>
> I guess one better check that initargs really consist of one element,
> but I hope I could state the "base idea". 

the base idea is correct, but there are situations where the
lisp-value and the client-value will be different (though this is
admittedly rare for an integer field), for example select input fields
may want an initial client-value of "---" to correspond to some
default lisp value.

> However, I'm sure I'm missing something even in this context and
> definitly in the UCW context.

no, i don't think so. i think it's just, as it currently stands, ugly.


-- 
-Marco
Ring the bells that still can ring.
Forget the perfect offering.
There is a crack in everything.
That's how the light gets in.
	-Leonard Cohen



More information about the bese-devel mailing list