gary <firstname.lastname@example.org> wrote:
| ...dialog boxes for data entry. I have over 90 data screens...
| (defvar *example-pane*
| <.... about 40 lines of layout instructions ....> ))
| I feel queasy having so many special variables around.
You should feel queasy. What about defining a single alist or
hash table that contains all your examples? E.g. [untested]:
(defvar *capi-examples* (make-hash-table))
; then lots of these:
(setf (gethash 'example-pane *capi-examples*)
<...layout instructions...> ))
...additional SETFs as needed...
; abstract the lookup (and error check)
(defun get-capi-example (name)
(let ((example (gethash 'example-pane *capi-examples*)))
(error "get-capi-example: example screen not found:" name))
Then when you need the "example-pane" again, it's easily found:
(let ((pane (get-capi-example 'example-pane)))
...do something with pane...)
p.s. Note: I originally wrote the above with keywords (":example-pane")
instead of symbols in the current package, but there have been comments
here on the list about not polluting the KEYWORD packages with such stuff.
You can do it either way. Or even make a single separate "CAPI-EXAMPLES"
package with the global hash table name and the hash keys in it, whatever.
Just be warned that I'm not an experienced enough CL programmer to be
giving advice on matters of style at that level... ;-}
Rob Warnock, 30-3-510 <email@example.com>
SGI Network Engineering <http://www.rpw3.org/>
1600 Amphitheatre Pkwy. Phone: 650-933-1673
Mountain View, CA 94043 PP-ASEL-IA
[Note: firstname.lastname@example.org and email@example.com aren't for humans ]