unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
* Problem with (eq? ...) and Serveez
@ 2004-01-28  0:30 Roland Besserer
  2004-01-28  3:14 ` Stephen Compall
  0 siblings, 1 reply; 5+ messages in thread
From: Roland Besserer @ 2004-01-28  0:30 UTC (permalink / raw)



Hi,

I'm at a loss why the code below fails running in serveez
with guile (1.6.x and 1.4.x):

I have a serveez server implemented in guile. Serveez uses a 'sock'
object as an argument to certain callback functions. In one such
callback function I add the 'sock' argument to a list:

(define bcs '())

....

(define (callback-fn1 server sock)
        ...
        (set! bcs (cons sock bcs))
        ...
)

later, in another callback function, I want to remove the 'sock' object:

(define (callback-fn2 sock req len)
        ...
        (set! bcs (remove-if (lambda (x) (eq? x sock)) bcs))
        ...
)

remove-if fails because eq? always returns #f for the comparison case.
I tested eq? against a number of cases and got the following results:

(set! bcs sock)
(eq? bcs sock)  -->  #t
(display sock)  -->  #<svc-socket f1808>
(display bcs)   -->  #<svc-socket f1808>

(define bcs '())
(set! bcs (cons sock bcs))
(eq? sock (car bcs))       --> #f
(display sock)             --> #<svc-socket f1808>
(display (car bcs))        --> #<svc-socket f1808>


Why does eq? fail in the second case?
Any pointers would be welcome.

Regards

roland


_______________________________________________
Guile-user mailing list
Guile-user@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-user


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2004-01-28 18:58 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-01-28  0:30 Problem with (eq? ...) and Serveez Roland Besserer
2004-01-28  3:14 ` Stephen Compall
2004-01-28 17:59   ` Roland Besserer
2004-01-28 18:48     ` Stephen Compall
2004-01-28 18:58       ` Stephen Compall

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).