Subject: Re: Why I'm giving up on Lisp for now
From: rpw3@rpw3.org (Rob Warnock)
Date: Sat, 26 Jun 2004 05:28:13 -0500
Newsgroups: comp.lang.lisp
Message-ID: <EpmdnZzAJtEg0kDdRVn-vw@speakeasy.net>
Peter Herth  <herth@netcologne.de> wrote:
+---------------
| Rob Warnock wrote:
| > Uh... Is there a definition missing for CREATE-RECTANGLE somewhere?
| > I couldn't find it even in the latest snapshot of Ltk...
| 
| Sorry, I was a little bit ahead of the time when I wrote that code :).
| The next release of Ltk (due in a few days) will contain it and other
| improvements. As a sneak preview here the missing function:
| 
| (defun create-rectangle (canvas x0 y0 x1 y1)
|   (send-w (format nil "puts [~a create rectangle ~a ~a ~a ~a]" (path canvas)
| x0 y0 x1 y1))   
|   (read-w))
+---------------

Thanks! A few more comments:

- In the previous article, there was a spurious letter "q" here:

    (defparameter *tests* (test-+))q

- PATH and VALUE are still exported (and conflict with my ~/.cmucl-init).

- SEND-W and READ-W are not exported by Ltk, so CREATE-RECTANGLE
  needs to be this:

    (defun create-rectangle (canvas x0 y0 x1 y1)
      (ltk::send-w (format nil "puts [~a create rectangle ~a ~a ~a ~a]"
			       (path canvas) x0 y0 x1 y1))
      (ltk::read-w))

  [Or maybe needs to be *in* the LTK package? ...and exported? Your pick.]

But given all that and the following, things now work fine:

    > (load "ltk")
    ; Loading #p"/u/rpw3/ltk/ltk.x86f".
    > (shadowing-import 'ltk:path)
    T
    > (shadowing-import 'ltk:value)
    T
    > (setf ltk::*wish-pathname* "wish8.3")	; local necessity
    "wish8.3"
    > (use-package :ltk)
    T
    > (load "foo.lisp")				; test framework code
    ; Loading #p"/u/rpw3/ltk/foo.lisp".
    T
    > (gr-unit)

[...window pops up, tests run when button clicked...]


-Rob

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