From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andy Wingo Newsgroups: gmane.lisp.guile.bugs Subject: Re: Weak Vectors Patch Date: Sun, 18 Apr 2010 13:48:48 +0200 Message-ID: References: <87mxxnrt0c.fsf@rvannith.home.unknownlamer.org> <87k4sln86s.fsf@inria.fr> <874ojarkoe.fsf@rvannith.home.unknownlamer.org> <87d3xx6c0n.fsf@gnu.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1271591234 31217 80.91.229.12 (18 Apr 2010 11:47:14 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 18 Apr 2010 11:47:14 +0000 (UTC) Cc: Clinton Ebadi , bug-guile@gnu.org To: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Original-X-From: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Sun Apr 18 13:47:08 2010 connect(): No such file or directory Return-path: Envelope-to: guile-bugs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1O3Sxs-00067X-Jz for guile-bugs@m.gmane.org; Sun, 18 Apr 2010 13:47:04 +0200 Original-Received: from localhost ([127.0.0.1]:38144 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O3Sxr-0001YH-VD for guile-bugs@m.gmane.org; Sun, 18 Apr 2010 07:47:04 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1O3Sxk-0001Vy-V4 for bug-guile@gnu.org; Sun, 18 Apr 2010 07:46:56 -0400 Original-Received: from [140.186.70.92] (port=60025 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O3Sxj-0001Ub-P5 for bug-guile@gnu.org; Sun, 18 Apr 2010 07:46:56 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1O3Sxh-0008DP-QT for bug-guile@gnu.org; Sun, 18 Apr 2010 07:46:55 -0400 Original-Received: from a-pb-sasl-quonix.pobox.com ([208.72.237.25]:48036 helo=sasl.smtp.pobox.com) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O3Sxh-0008DK-OY; Sun, 18 Apr 2010 07:46:53 -0400 Original-Received: from sasl.smtp.pobox.com (unknown [127.0.0.1]) by a-pb-sasl-quonix.pobox.com (Postfix) with ESMTP id 58F12AB7EE; Sun, 18 Apr 2010 07:46:53 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type:content-transfer-encoding; s=sasl; bh=YzMtjIFx0Nyf bNvESTxrztNI384=; b=Cw9Z03KYFIwA8ONZmafV+xZWPqF+vxADGH8pHuKQRXcU CzpEQOdWMwvuR5RpIwGNEG9iOYmhNsB2JT4nY9IW7YT/gmTOPypLaG3BUoV2BqIX JzuDrbOcu6jpwgGcqkSDSIa+ySsCdsbosP6OYqDGsBCkuDxAzeKnatWFnMsgk6I= DomainKey-Signature: a=rsa-sha1; c=nofws; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type:content-transfer-encoding; q=dns; s=sasl; b=v9xi3q nGIGCNrEOGZgvTgfBFViAJ/KwTTUk4hnCNAO5uiBHdHhTdFOdggFy1Y3V2Ws0JBm i7UBJQf7pSGhtsVkvzk/3NYeUxjMSDlPOPQRbGa7Oyjka7mqJMEfMJ+2xORSVGKM rl60biVWMeRy2EREEt4/Qg6ivUv/V9lgeIrP0= Original-Received: from a-pb-sasl-quonix. (unknown [127.0.0.1]) by a-pb-sasl-quonix.pobox.com (Postfix) with ESMTP id 34C10AB7EC; Sun, 18 Apr 2010 07:46:51 -0400 (EDT) Original-Received: from unquote (unknown [83.202.100.241]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by a-pb-sasl-quonix.pobox.com (Postfix) with ESMTPSA id 853ADAB7E9; Sun, 18 Apr 2010 07:46:48 -0400 (EDT) In-Reply-To: <87d3xx6c0n.fsf@gnu.org> ("Ludovic =?utf-8?Q?Court=C3=A8s=22'?= =?utf-8?Q?s?= message of "Sat, 17 Apr 2010 22:48:40 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.92 (gnu/linux) X-Pobox-Relay-ID: 13ED1D94-4AE0-11DF-A523-D033EE7EF46B-02397024!a-pb-sasl-quonix.pobox.com X-detected-operating-system: by eggs.gnu.org: Solaris 10 (beta) X-BeenThere: bug-guile@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GUILE, GNU's Ubiquitous Extension Language" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Errors-To: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.bugs:4582 Archived-At: Hi, On Sat 17 Apr 2010 22:48, ludo@gnu.org (Ludovic Court=C3=A8s) writes: > Clinton Ebadi writes: > >> I talked to wingo, and he suggested that (equal? WEAK-VECTOR VECTOR) =3D> >> #f; > > Hmm what=E2=80=99s the motivation? It seems more intuitive to me to have= , e.g., > > (equal? (make-vector 3 4) (make-weak-vector 3 4)) > =3D> #t Because these have different tc7's, but they were arrays, this comparison happened via the array handle mechanism; but the array handle implementation wasn't quite right. So perhaps the proper fix is to keep weak vectors as being arrays, so they can be equal? to vectors, but fix up their implementation, to something like this: static SCM weak_vector_handle_ref (scm_t_array_handle *h, size_t idx) { return scm_c_vector_ref (h->array, idx); } static void weak_vector_handle_set (scm_t_array_handle *h, size_t idx, SCM val) { scm_c_vector_set_x (h->array, idx, val); } static void weak_vector_get_handle (SCM v, scm_t_array_handle *h) { h->array =3D v; h->ndims =3D 1; h->dims =3D &h->dim0; h->dim0.lbnd =3D 0; h->dim0.ubnd =3D scm_c_vector_length (v) - 1; h->dim0.inc =3D 1; h->element_type =3D SCM_ARRAY_ELEMENT_TYPE_SCM; h->elements =3D h->writable_elements =3D NULL; /* disallow direct access = */ } SCM_ARRAY_IMPLEMENTATION (scm_tc7_wvect, 0x7f, weak_vector_handle_ref, weak_vector_handle_set, weak_vector_get_handle) Clinton can you try this one? Andy --=20 http://wingolog.org/