From: "Linus Björnstam" <linus.internet@fastmail.se>
To: "Christopher Lemmer Webber" <cwebber@dustycloud.org>,
guile-user <guile-user@gnu.org>
Subject: Re: Functional hashtables
Date: Tue, 05 May 2020 21:45:52 +0200 [thread overview]
Message-ID: <3d7c4c18-94ec-4a11-ac66-2448f017dcf0@www.fastmail.com> (raw)
In-Reply-To: <87r1vyqml1.fsf@dustycloud.org>
I made a module out of Andy's dash (and added some comfort functions over fash-fold): https://hg.sr.ht/~bjoli/guile-fash/browse/fash.scm?rev=default
What it lacks is a proper way to remove elements..I had a couple of stabs at it, but I fear I was too dumb.
--
Linus Björnstam
On Tue, 5 May 2020, at 20:10, Christopher Lemmer Webber wrote:
> Hello hello,
>
> I'm working on porting a library I've written from Racket to Guile.
> Some interesting news on that soon.
>
> In the meanwhile, I'm trying to figure out what to do about my need for
> functional hashmaps in Guile. Right now Guile ships with vlist and
> vhash. Andy also wrote fash.scm, which is what I've generally preferred
> and used previously.
>
> The reason I don't want to use vhashes is specifically this part of
> vhashes in the Guile manual:
>
> > • It is _not_ thread-safe. Although operations on vlists are all
> > “referentially transparent” (i.e., purely functional), adding
> > elements to a vlist with ‘vlist-cons’ mutates part of its internal
> > structure, which makes it non-thread-safe. This could be fixed,
> > but it would slow down ‘vlist-cons’.
>
> Oop! That's a no-go for me. But maybe there are other reasons to
> prefer fash.scm too?
>
> 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.
>
> 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 you
> later just because it "looks prettier").
>
> Anyway, thoughts?
>
> Nice to be back in Guile land!
> - Chris
>
>
next prev parent reply other threads:[~2020-05-05 19:45 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-05 18:10 Functional hashtables Christopher Lemmer Webber
2020-05-05 19:45 ` Linus Björnstam [this message]
2020-05-06 11:23 ` Christopher Lemmer Webber
2020-05-06 11:24 ` Christopher Lemmer Webber
2020-05-06 13:32 ` Linus Björnstam
2020-05-06 18:29 ` ArneBab
2020-05-08 18:11 ` Christopher Lemmer Webber
2020-05-16 20:42 ` Ludovic Courtès
2020-05-17 7:31 ` Catonano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/guile/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3d7c4c18-94ec-4a11-ac66-2448f017dcf0@www.fastmail.com \
--to=linus.internet@fastmail.se \
--cc=cwebber@dustycloud.org \
--cc=guile-user@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).