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 16:19:45 +0200 Organization: Organization?!? Message-ID: <87oboqorr2.fsf@fencepost.gnu.org> References: <87hauku0mb.fsf@fencepost.gnu.org> <87fwa2dxmh.fsf@pobox.com> <87mx4aqijf.fsf@fencepost.gnu.org> <87zk8accoq.fsf@pobox.com> <87ehpmqcs7.fsf@fencepost.gnu.org> <87aa0aqc6y.fsf@fencepost.gnu.org> <8762ayqbus.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 1339424419 16416 80.91.229.3 (11 Jun 2012 14:20:19 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 11 Jun 2012 14:20:19 +0000 (UTC) To: guile-devel@gnu.org Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Mon Jun 11 16:20:19 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 1Se5Te-0001gt-W4 for guile-devel@m.gmane.org; Mon, 11 Jun 2012 16:20:19 +0200 Original-Received: from localhost ([::1]:59296 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Se5Te-0006GL-Nl for guile-devel@m.gmane.org; Mon, 11 Jun 2012 10:20:18 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:58469) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Se5TW-0006Ee-10 for guile-devel@gnu.org; Mon, 11 Jun 2012 10:20:16 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Se5TM-0000KH-DM for guile-devel@gnu.org; Mon, 11 Jun 2012 10:20:09 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:55759) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Se5TM-0000Jo-6e for guile-devel@gnu.org; Mon, 11 Jun 2012 10:20:00 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1Se5TJ-0000uu-8J for guile-devel@gnu.org; Mon, 11 Jun 2012 16:19:57 +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 16:19:57 +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 16:19:57 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 54 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:B9DCDa+BmPfK9kBQc+8JA4Gu2RU= 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:14601 Archived-At: Daniel Hartwig writes: > On 11 June 2012 20:20, David Kastrup wrote: >>> P.S.: I still need to look at vlists.  They might already address this >>>       issue, though I can't use them in Guile 1.8. >> >> No, the "immutable" angle would make them unsuitable again. > > Note that vlists are only immutable in the sense that you can not > modify the value of a slot already allocated. Which makes it useless here. >> Scheme/Guile vectors are fixed size. Now I have a situation where I >> have a basic type lattice with records stored in vectors, and this type >> lattice may be extended dynamically (which typically happens at the >> start of a whole file, for potentially multi-file runs). > > From this I gather that your use case only appends to the lattice, if > so, vlist is suitable for that task. Wrong. My use case only _allocates_ at the end of the existing type lattice, but the records are not read-only. >> Cough, cough. Standard vectors are not growable. Which is the >> original problem of this thread, never mind Lua. > > True, but a growable vector is a tiny step away from the standard > vector. A tiny step if you are modifying the C code. A not so tiny step if you are working with Scheme. >> hashtables have additional indirection >> through hash buckets and coalescing lists > > This is fairly standard for a hash table. I would be quite surprised > if the hash table part of a Lua table did not also use buckets. But it is not standard for a growable vector that it only comes with buckets and chains. >> Except that this one isn't. > > Why not? > > You take a vector and a hash table, store your values in them, and > grow either as needed. This is not a complicated type. Except that vectors don't grow. Are you even reading what you are replying to? -- David Kastrup