Subject: [clisp-list] Problems in this closure

From: Sunil Mishra <[email-masked]>
Date: Mon, 18 Jun 2001 23:17:16 -0700

Hi,

I think I have uncovered a little bug in clisp. Although I have 
not tried this in any other implementation, everything I know 
about lisp tells me it is a genuine bug. The bad news is, I'm 
not sure how to go about debugging the beast. I'm open to ideas, 
and I will think about it a little myself.

This is what's happening. I have a closure that is constructed 
in the course of running a program. The closure calls another 
function, LOCATION-OPEN-P. I trace this function, but clisp 
doesn't report it called. The closure simply returns nil. Here's 
the sequence of interactions:

DESIM[83]> (trace location-open-p)
;; Tracing function LOCATION-OPEN-P.
(LOCATION-OPEN-P)
DESIM[84]> closure
#<CLOSURE :LAMBDA (THIS-EVENT EVENT TUNNEL)
   (DECLARE (IGNORE THIS-EVENT EVENT) (LOCATION-OPEN-P TUNNEL ROW 
COLUMN))>
DESIM[85]> (funcall closure nil nil *the-tunnel*)
NIL

I just downloaded and installed the newest version of clisp.

Any ideas?

Sunil

---

From: Bruce <[email-masked]>
Date: Tue, 19 Jun 2001 16:20:21 +0800

> Hi,
[...]
>   (DECLARE (IGNORE THIS-EVENT EVENT) (LOCATION-OPEN-P TUNNEL ROW COLUMN))>

Probably you've misplaced the right parenthesis after declare ignore.
The following transcript may be helpful. If it does not help, show us
your definiton of the closure.

[2]> (defun my-double (x y) (declare (ignore y)) (+ x x))
MY-DOUBLE
[11]> my-double
*** - EVAL: variable MY-DOUBLE has no value
1. Break [12]> 
[13]> (symbol-function 'my-double)
#<CLOSURE MY-DOUBLE (X Y) (DECLARE (SYSTEM::IN-DEFUN MY-DOUBLE) (IGNORE Y)) (BLOCK MY-DOUBLE (+ X X))>
[14]> (my-double 12 'x)
24
[15]> 

--
The Least Perceptive Literary Critic
	The most important critic in our field of study is Lord Halifax.  A most
individual judge of poetry, he once invited Alexander Pope round to give
a public reading of his latest poem.
	Pope, the leading poet of his day, was greatly surprised when Lord
Halifax stopped him four or five times and said, "I beg your pardon, Mr.
Pope, but there is something in that passage that does not quite please me."
	Pope was rendered speechless, as this fine critic suggested sizeable and
unwise emendations to his latest masterpiece.  "Be so good as to mark
the place and consider at your leisure.  I'm sure you can give it a
better turn."
	After the reading, a good friend of Lord Halifax, a certain Dr.
Garth, took the stunned Pope to one side.  "There is no need to touch
the lines," he said.  "All you need do is leave them just as they are,
call on Lord Halifax two or three months hence, thank him for his kind
observation on those passages, and then read them to him as altered.  I
have known him much longer than you have, and will be answerable for the
event."
	Pope took his advice, called on Lord Halifax and read the poem
exactly as it was before.  His unique critical faculties had lost none
of their edge.  "Ay", he commented, "now they are perfectly right.
Nothing can be better."
		-- Stephen Pile, "The Book of Heroic Failures"

---

From: Sunil Mishra <[email-masked]>
Date: Wed, 31 Dec 1969 16:19:32 -0800

Duh... I think I'll go hide in a corner now...

Thanks for spotting that.

Sunil

On Tuesday, June 19, 2001, at 01:20 AM, Bruce wrote:
> _______________________________________________
> clisp-list mailing list
> [email-masked]
> http://lists.sourceforge.net/lists/listinfo/clisp-list
>