From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David Kastrup Newsgroups: gmane.lisp.guile.devel Subject: Re: Growable arrays? Date: Mon, 11 Jun 2012 14:28:08 +0200 Organization: Organization?!? Message-ID: <871ulmqbhj.fsf@fencepost.gnu.org> References: <87hauku0mb.fsf@fencepost.gnu.org> <873962sbu0.fsf@fencepost.gnu.org> <87y5nuqpii.fsf@fencepost.gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: dough.gmane.org 1339417715 24977 80.91.229.3 (11 Jun 2012 12:28:35 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 11 Jun 2012 12:28:35 +0000 (UTC) To: guile-devel@gnu.org Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Mon Jun 11 14:28:34 2012 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Se3jV-000767-AW for guile-devel@m.gmane.org; Mon, 11 Jun 2012 14:28:33 +0200 Original-Received: from localhost ([::1]:45911 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Se3jV-00006i-6R for guile-devel@m.gmane.org; Mon, 11 Jun 2012 08:28:33 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:53775) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Se3jO-00005v-B4 for guile-devel@gnu.org; Mon, 11 Jun 2012 08:28:32 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Se3jM-0004nA-Js for guile-devel@gnu.org; Mon, 11 Jun 2012 08:28:25 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:35989) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Se3jM-0004mo-CF for guile-devel@gnu.org; Mon, 11 Jun 2012 08:28:24 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1Se3jH-0006do-4h for guile-devel@gnu.org; Mon, 11 Jun 2012 14:28:19 +0200 Original-Received: from p508eb788.dip.t-dialin.net ([80.142.183.136]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 11 Jun 2012 14:28:19 +0200 Original-Received: from dak by p508eb788.dip.t-dialin.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 11 Jun 2012 14:28:19 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 37 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: p508eb788.dip.t-dialin.net X-Face: 2FEFf>]>q>2iw=B6, xrUubRI>pR&Ml9=ao@P@i)L:\urd*t9M~y1^:+Y]'C0~{mAl`oQuAl \!3KEIp?*w`|bL5qr,H)LFO6Q=qx~iH4DN; i"; /yuIsqbLLCh/!U#X[S~(5eZ41to5f%E@'ELIi$t^ Vc\LWP@J5p^rst0+('>Er0=^1{]M9!p?&:\z]|;&=NP3AhB!B_bi^]Pfkw User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1.50 (gnu/linux) Cancel-Lock: sha1:ECLEf8SjE7BRLKmAe6F5dmkF6yI= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:14597 Archived-At: Noah Lavine writes: >>> vlist is a data type introduced around guile 2.0.  You will find it >>> documented in the Guile Reference under Compound Data Types. >>> >>> They are growable and provide vector-like access performances and >>> memory locality. >> >> Ah, too bad.  This needs to run under 1.8 as well. > > If you need to support older versions of Guile, then you can't use any > data structures we add now anyway, correct? So it seems like you will > have to implement growable vectors yourself no matter what. > > If you want to, though, you could look at the implementation of vlists > in Guile 2.0, which I think is all in Scheme. See > module/ice-9/vlist.scm. > > Even if we can't fix it, it is still nice to hear about data > structures you wish Guile had, so that in a few more versions this > might not be a problem for you. I don't think I need yet another data structure deficient in some respects. We have vectors that can't grow, hashtables that can grow but only index through a hash function, vlists that can grow but have immutable content... Where is the point in thinking up yet another restriction that will make for a new data structure "complementing" the others? Why not just have a superset without arbitrary restriction and implement the other structures based on that? Then each one just needs to enforce its personal restrictions in its accessor functions, and otherwise just use what is there in the general mechanism. -- David Kastrup