From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: =?UTF-8?Q?Linus_Bj=C3=B6rnstam?= Newsgroups: gmane.lisp.guile.user Subject: Re: Functional hashtables Date: Tue, 05 May 2020 21:45:52 +0200 Message-ID: <3d7c4c18-94ec-4a11-ac66-2448f017dcf0@www.fastmail.com> References: <87r1vyqml1.fsf@dustycloud.org> Mime-Version: 1.0 Content-Type: text/plain;charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="104322"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Cyrus-JMAP/3.3.0-dev0-351-g9981f4f-fmstable-20200421v1 To: "Christopher Lemmer Webber" , guile-user Original-X-From: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Tue May 05 21:46:58 2020 Return-path: Envelope-to: guile-user@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jW3Wr-000Qzu-TF for guile-user@m.gmane-mx.org; Tue, 05 May 2020 21:46:58 +0200 Original-Received: from localhost ([::1]:44348 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jW3Wq-0007Km-V1 for guile-user@m.gmane-mx.org; Tue, 05 May 2020 15:46:56 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:38742) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jW3Wg-0007Kg-GJ for guile-user@gnu.org; Tue, 05 May 2020 15:46:46 -0400 Original-Received: from out5-smtp.messagingengine.com ([66.111.4.29]:34511) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jW3We-0000zh-7q for guile-user@gnu.org; Tue, 05 May 2020 15:46:46 -0400 Original-Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 2BD3F5C00A6; Tue, 5 May 2020 15:46:14 -0400 (EDT) Original-Received: from imap1 ([10.202.2.51]) by compute4.internal (MEProxy); Tue, 05 May 2020 15:46:14 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.se; h= mime-version:message-id:in-reply-to:references:date:from:to :subject:content-type:content-transfer-encoding; s=fm3; bh=BOdC3 wXZRb830YJ1PqbQsXWjqwy6yHR6/iT6J8HldRM=; b=G0/H0Zgd4oAnln9xBWAZx GEWZSjjDZDtxfJkSsEmRWQGzy9NrurZTPDeFqiYHDcKC+aGEnWg9zVv+QNUKvzmd uz9PluNNKLq+9ut6YLznFETF5/BVw6r9FFUJOJQdXLTDFAfQFrLfbzduFpJajwrz t73Wyh4SQSanJVHUoIjmT64V29bHtA1VJ9cVmQawp3SZKLVjzZ5L59R3uqt57fsU rg8nCifktV34Io9ojjAialMm3Xdvtr7reWK3f4RpLFruI1FYwrNt4MClb1y9XhrF LkPo3GWJZI+kgNkRefSAD9O2/pxsqXjes0q2fC2A0aU/kQ+ZzaIhfXGi2X/nzdCx Q== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; bh=BOdC3wXZRb830YJ1PqbQsXWjqwy6yHR6/iT6J8Hld RM=; b=Ytd3IOe5shJmUiXO3q8qC2B/ZXYzf7YWeR93sIo7f6TAQ4+2kIF6IrBWT Za/ojoYWAzLRy9mJk1ZjDUe0V8mPYZCti7BvGeg+s0igo0AOopVBm5NMWxYwSUmX FRW45UsbZqcGHNPF5VWauAlxxB7lxAp+B+zFbJtcAcatbs11uWd67/nF1m2vrAUu O4A+btJsAGPP5BRBEfiJZHi+UzzXrJ01qaYOXqaB7qLpLQ/cpTkqjcBtYNHzI2Bf twf7s4qyZ9on3Q6etr5HgymN+O7lEzdjYJ77Ad/J8JMp+kMWb2EinVcWmjk5F04j wCooO5hcHx203+jNkfy4sGBVkpxDw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduhedrjeejgddthecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefofgggkfgjfhffhffvufgtgfesthhqredtreerjeenucfhrhhomhepnfhinhhu shgpuehjnphrnhhsthgrmhcuoehlihhnuhhsrdhinhhtvghrnhgvthesfhgrshhtmhgrih hlrdhsvgeqnecuggftrfgrthhtvghrnhepieekkeeguddvheejtdeuleeutdekfefgveeh tdefjeekieehhfffteefudeiiefgnecuffhomhgrihhnpehsrhdrhhhtnecuvehluhhsth gvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheplhhinhhushdrihhnthgv rhhnvghtsehfrghsthhmrghilhdrshgv X-ME-Proxy: Original-Received: by mailuser.nyi.internal (Postfix, from userid 501) id D3408C200A4; Tue, 5 May 2020 15:46:13 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface In-Reply-To: <87r1vyqml1.fsf@dustycloud.org> Received-SPF: pass client-ip=66.111.4.29; envelope-from=linus.internet@fastmail.se; helo=out5-smtp.messagingengine.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/05 15:46:14 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Original-Sender: "guile-user" Xref: news.gmane.io gmane.lisp.guile.user:16429 Archived-At: I made a module out of Andy's dash (and added some comfort functions ove= r fash-fold): https://hg.sr.ht/~bjoli/guile-fash/browse/fash.scm?rev=3Dd= efault=20 What it lacks is a proper way to remove elements..I had a couple of stab= s at it, but I fear I was too dumb. --=20 Linus Bj=C3=B6rnstam On Tue, 5 May 2020, at 20:10, Christopher Lemmer Webber wrote: > Hello hello, >=20 > I'm working on porting a library I've written from Racket to Guile. > Some interesting news on that soon. >=20 > In the meanwhile, I'm trying to figure out what to do about my need fo= r > functional hashmaps in Guile. Right now Guile ships with vlist and > vhash. Andy also wrote fash.scm, which is what I've generally preferr= ed > and used previously. >=20 > The reason I don't want to use vhashes is specifically this part of > vhashes in the Guile manual: >=20 > > =E2=80=A2 It is _not_ thread-safe. Although operations on vlists = are all > > =E2=80=9Creferentially transparent=E2=80=9D (i.e., purely functi= onal), adding > > elements to a vlist with =E2=80=98vlist-cons=E2=80=99 mutates pa= rt of its internal > > structure, which makes it non-thread-safe. This could be fixed,= > > but it would slow down =E2=80=98vlist-cons=E2=80=99. >=20 > Oop! That's a no-go for me. But maybe there are other reasons to > prefer fash.scm too? >=20 > There's no separate package of guile-fash available anywhere, but it > would be easy enough to do if we're just using it with Guix. It's > desirable to not have to keep copy-pasta'ing fash.scm around at least.= >=20 > My time in Racket has convinced me that it's an extremely good idea to= > have a well supported functional hashmap type in the language... extra= > points if it's "first class" in syntax (my code has improved > considerably because of it; no more using alists where they'll bite yo= u > later just because it "looks prettier"). >=20 > Anyway, thoughts? >=20 > Nice to be back in Guile land! > - Chris >=20 >