Subject: Re: [ANN] Ltk - The Lisp Toolkit
From: rpw3@rpw3.org (Rob Warnock)
Date: Sun, 13 Jun 2004 04:23:15 -0500
Newsgroups: comp.lang.lisp
Message-ID: <2-qdnSAQfvOegFHdRVn-vw@speakeasy.net>
Peter Herth  <herth@netcologne.de> wrote:
+---------------
| Rob Warnock wrote:
| > A few small suggestions:
| > - The interaction between DO-EXECUTE, START-W, *W*, the callers of
| >   START-W, and the users of *W* seems a bit awkward. ...
| 
| Yes that was a little bit cluttered. I have cleaned it up following
| your suggestions. Yet I think it may be useful to declare wish-pathname
| and wish-args as special variables, so that it can be overridden
| for special purposes without changing the Ltk source.
+---------------

Sounds fine [though in that case they should be named *WISH-PATHNAME*
and *WISH-ARGS*, of course].

+---------------
| > (defmacro with-ltk (&rest body)
| > `(progn
| > (setf *w* (do-execute +wish-pathname+ +wish-args+))
| > ,@body
| > (mainloop)))
| 
| I have retained (though cleaned up) start-w, so that especially
| for playing with Ltk from the REPL you can initialize it without
| exposing details to the user.
+---------------

Well, o.k., but the issue I had with START-W was precisely that
it did a "hidden" SETF of *W*, a single global, rather than (say)
being dynamically bound by WITH-LTK. If it's dynamically bound,
then different parts of the program [OR DIFFERENT THREADS!] can
use different copies of a "wish" child process, and you still
get the simplicity of an implied global. That's why I suggested
removing START-W entirely... though perhaps I should have been
a little more proactive in proposing an alternative to the SETF
in WITH-LTK, perhaps something like this:

    (defmacro with-ltk (&rest body)
      `(let ((*w* (do-execute *wish-pathname* *wish-args*)))
        ,@body
        (mainloop)))

Just make sure that in a threaded version of WITH-LTK the new binding
is made in the new thread...


-Rob

-----
Rob Warnock			<rpw3@rpw3.org>
627 26th Avenue			<URL:http://rpw3.org/>
San Mateo, CA 94403		(650)572-2607