From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Daniel Hartwig Newsgroups: gmane.lisp.guile.devel Subject: Re: Growable arrays? Date: Thu, 14 Jun 2012 23:23:59 +0800 Message-ID: References: <87hauku0mb.fsf@fencepost.gnu.org> <87sjdyyncv.fsf@netris.org> <87vciuuf12.fsf@fencepost.gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1339687458 10889 80.91.229.3 (14 Jun 2012 15:24:18 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 14 Jun 2012 15:24:18 +0000 (UTC) To: guile-devel@gnu.org Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Thu Jun 14 17:24:17 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 1SfBuB-0001Rl-0O for guile-devel@m.gmane.org; Thu, 14 Jun 2012 17:24:15 +0200 Original-Received: from localhost ([::1]:35632 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SfBuA-0005bX-T5 for guile-devel@m.gmane.org; Thu, 14 Jun 2012 11:24:14 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:53837) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SfBu5-0005b1-NO for guile-devel@gnu.org; Thu, 14 Jun 2012 11:24:14 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SfBty-0003hl-NJ for guile-devel@gnu.org; Thu, 14 Jun 2012 11:24:09 -0400 Original-Received: from mail-yx0-f169.google.com ([209.85.213.169]:63739) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SfBty-0003hP-GU for guile-devel@gnu.org; Thu, 14 Jun 2012 11:24:02 -0400 Original-Received: by yenr5 with SMTP id r5so1180930yen.0 for ; Thu, 14 Jun 2012 08:23:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; bh=fRulhIzjVBH3fagRZPGAO3gu+Scb2ZvV+s72JybRr9w=; b=cXhWNnW4J5dAvoFKuXg8itE8bUMxar7pdClXO5vdtuyTiWv7ioaKxBtssH7gkae++V H2Oq4VQ0j4hcY6TsWFLZNriUxE6XGs9ZY4LxsEqmY4NhoEEoxgN2W/RcEkgFdcsfT5Fe asrdVq1ISngI+dhDhIaxW5ll4c0F5LuwlGDMjoi4k0GN71qmyg/beV++l8x1ROv0cwZl 2IEHmnkbPpCjH/DJ85bqmXCkFu8HQceqByXaMmga1TX7OzUE+h2xQTfg7C9kDDhbatlu MK0deQjWOh1VwJcRZZOH3cY9xVBz3JmKu1/3+A7558vd8KeUo4jONynTOTZJPW8zAkC0 8fFg== Original-Received: by 10.50.11.202 with SMTP id s10mr1136775igb.4.1339687439493; Thu, 14 Jun 2012 08:23:59 -0700 (PDT) Original-Received: by 10.231.206.198 with HTTP; Thu, 14 Jun 2012 08:23:59 -0700 (PDT) In-Reply-To: <87vciuuf12.fsf@fencepost.gnu.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.85.213.169 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:14621 Archived-At: On 14 June 2012 22:47, David Kastrup wrote: > Mark H Weaver writes: > >> David Kastrup writes: >>> Scheme/Guile vectors are fixed size. =C2=A0[...] =C2=A0It is a bit of a= nuisance >>> that one can grow a hashtable efficiently and on-demand, but not so an >>> array. >> >> Although Scheme vectors should remain fixed-size for reasons I have >> given elsewhere in this thread, Guile also includes a more complex >> 'array' type that includes features such as arbitrary rank (i.e. number >> of dimensions), arbitrary lower bounds (not just 0), and shared views on >> the same underlying array with arbitrary affine mappings of indices. >> >> Guile 'arrays' cannot currently be resized, but I see no good reason for >> this limitation. =C2=A0They are already quite complex, and already requi= re a >> second level of pointer indirection. >> >> What do other people think? Perhaps drop a basic resizable type in the guile-lib? Any implementation is going to be less-than-ideal in some situations. The guile core provides already a solid set of fundamental types which are very easy to compose to produce *exactly* the type required for any particular situation. > > Another complex type, this time with quite more serious memory and > performance impact, that can't be implemented on top of a simple > resizable common primitive and has an almost, but not quite, overlapping > underlying feature set? > > It's almost as if you _like_ not being able to reuse code. > I don't see how either hash table or multi-dimensional array type could benefit from a shared, resizable primitive =E2=80=93 they are quite different algorithms, and both different again to the basic resizable vector already discussed. It is moot that hash table internally manages a vector and allocates a /new/ vector when needed. This is not a simple resizing operation. Are there any data types in the guile core which would benefit from sharing a resizable vector primitive?