[Bese-devel] questions

Jan Rychter jan at rychter.com
Fri Sep 23 14:30:51 UTC 2005


Marco wrote:
> Jan Rychter <jan at rychter.com> writes:
> > Two questions, again any guidance is very much appreciated.
> >
> > 1. Is there a good way to initialize form elements? At present, if I
> >    create a form component containing a number of form elements, I can't
> >    just use initargs to pass values to the elements when creating the
> >    component -- obviously, since the form elements are classes
> >    themselves.
> >
> >    Basically, I'm looking for a way to do 
> >       (call 'settings-dialog :first-name "blah" :last-name "blah")
> >    where first-name and last-name are initargs for :component slots in
> >    the form component settings-dialog.
> >
> >    This is probably something that falls into "think of a good way to do
> >    it and implement it yourself" category -- right?
> 
> no, it falls into the "think of a good way and help marco implement
> it". i'd really really like to see ucw have a nice form api
> (validation, marshalling and java script alerting are good starting
> points), i just can't seem to come up with it. this would be as good a
> time as any to start stealing ideas from other libs.

Could you please explain how you understand "marshaling" in this
context?

> in the mean time we could setup an initialize-instance method
> which passed initargs to slots which were know to be form elements. or
> even better we could create a form-class (a subclass of
> standard-component-class) and all the bells and whistles we want. we'd
> just need to come up with a short list of what a form class sholud
> look like and rework the form components (i'd be more than happy to
> put time into this).

I'm working on this, so expect a barrage of questions soon. I've
already tried some approaches, so at least I know what isn't useful.

[...]

> > BTW, debugging UCW apps is a *real* pain. I can't seem to read anything
> > out of the backtraces that I get, so it's really mostly guesswork...
> 
> i consider this to be a _huge_ issue (unless you're on clisp in which
> case you're just fucked). are you using slime? are the html backtraces
> not inspectable? is the javascript in the backtraces causing problems?
> how can things be improved?

I'm using SBCL and SLIME. The backtraces work fine, but the problem is
that they are huge and convoluted to the untrained eye. Combine this
with CLOS debugging, which even on a normal day isn't that obvious and
you quickly get into real trouble.

An example of a problem which took me a while to understand: I had a
form-component class with a "my-field :component (integer-field)
:initarg :my-field" slot. I then tried to (call 'my-form :my-field 1222)
and wondered why it wouldn't work.

BTW, the error message you get is:
  There is no applicable method for the generic function
  #<STANDARD-GENERIC-FUNCTION (SETF COMPONENT.PLACE) (1)> when called with
  arguments (#<IT.BESE.UCW::PLACE (SLOT-VALUE IT.BESE.UCW::COMP
  IT.BESE.UCW::SLOT-NAME) {BEB5089}> 1222).

... which is perfectly obvious after you've realized what the problem
was. But it doesn't help that the backtrace is 22 levels deep, of which
only one is potentially useful in resolving the problem and even then
it doesn't really give many hints.

I'm not sure what (if anything) can be done about this. Math is hard, as
Barbie says, right?

--J.



More information about the bese-devel mailing list