[Bese-devel] I'm simply not getting it:

Marco Baringer mb at bese.it
Wed Jun 22 14:50:19 UTC 2005


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

> (defaction print-info ((g get-address))

i don't think print-info is the best name for this action. the fact
that it only gets used to 'print' the address doesn't mean this action
actually prints the address. i'm going to call it OK, my logic being:

the generic OK action is usually used whenever the component has done
whatever it was supposed to do. for a component called get-address its
job is to get (and therefor return) an address, which is exactly what
that action does.

though if that's my reasoning maybe this would be better:

(defaction submit ((g get-address))
  (if (and (name (address g))  (string/= "" (name (address g)))
           (email (address g)) (string/= "" (email (address g))))
      (ok g)
      (setf (message g) "Sorry, you must supply both a name and an email.")))

(defaction ok ((g get-address))
  (answer (make-instance 'address
                         :name (name (address g))
                         :email (email (address g)))))

and call submit, and not ok, from the form. decisions, decisions,
decisions.

> IMHO this would be a good candidate to be included into the examples. 

ok.

-- 
-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