guile-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Problem with (eq? ...) and Serveez


From: Stephen Compall
Subject: Re: Problem with (eq? ...) and Serveez
Date: 28 Jan 2004 12:48:34 -0600
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2

Roland Besserer<address@hidden> writes:

> Understood and I appreciate the details on the Serveez callback
> allocation but ... I had already traversed the equal?, eqv?, eq?
> path - identical results.
> 
> It appears that neither comparing for actual object equivalence
> (which I incorrectly assumed would be the case) nor content
> equivalence via equal? returns true. I probably should've been
> clearer in my original post.

eqv? is useless and confusing IMHO.

equal? does not know how to compare every object.  In the case of
smobs, the smob creator must define an equalp C function and register
it with scm_set_smob_equalp.  The only smob in Serveez for which this
is done is "svz-binary".

You could add this somewhere in guile-server.c (wildly untested):

SCM
guile_socket_equalp (SCM self_scm, SCM other_scm)
{
  return SCM_SMOB_DATA (self_scm) == SCM_SMOB_DATA (other_scm);
}

Then add

scm_set_smob_equalp (svz_socket_tag, (SCM (*)(SCM, SCM)) guile_socket_equalp);

to guile_server_init.  This is one solution, that really tests eq?ness
of the underlying svz_socket_t, which should work.  You could also
have guile-server.c cache its socket smobs, rather than re-make them
each time, so you don't get a new one each time.  That might work
better.

--
Stephen Compall or s11 or sirian

-- Scintillate, scintillate, asteroid minikin.
-- Members of an avian species of identical plumage congregate.
-- Surveillance should precede saltation.
-- Pulchritude possesses solely cutaneous profundity.
-- It is fruitless to become lachrymose over precipitately departed
        lacteal fluid.
-- Freedom from incrustations of grime is contiguous to rectitude.
-- It is fruitless to attempt to indoctrinate a superannuated
        canine with innovative maneuvers.
-- Eschew the implement of correction and vitiate the scion.
-- The temperature of the aqueous content of an unremittingly
        galled saucepan does not reach 212 degrees Farenheit.

ANC SP4 sweep propaganda Montenegro fissionable IRA TWA M-14 White
House Ft. Bragg Glock enemy of the state Perl-RSA DES




reply via email to

[Prev in Thread] Current Thread [Next in Thread]