Fork me on GitHub

To the authors of clerk What a lovely lovely library. Thank you so very much

🙏 1
Alex Miller (Clojure team)18:02:20

might want to post on #gratitude! and tag @U5H74UNSF

💯 1

Thanks, will do. Didn’t realise there was a #gratitude


There is also, if you are interested, the #nextjournal channel where the authors and users of clerk hang out.


I'm trying to think of a name/idiom for a queue-like thing where the jobs/items are indexed by a unique key; if a job with the same key gets added to the queue it ejects any existing items on the queue with the same key, otherwise it just gets added normally. Should this even be considered a queue? Is there a better data structure / software concept that maps on to what I'm describing?


not quite what I'm thinking of - heaps don't necessarily respect insertion order in determining priority for the queue, but what I'm describing is determined by order of insertion unless the uniqueness constraint is broken


Sounds close to an insertion ordered map. Although I think you might prefer a different behavior when adding a key that already exists

Cora (she/her)19:02:46

LinkedHashSet is close-ish

Alex Miller (Clojure team)19:02:38

doesn't java have some new coll coming for this?

Cora (she/her)19:02:51

ordered-map would work as long as you don't mind doing a remove+add every time you want to add an element

Noah Bogart21:02:08

Why would this be necessary?

Cora (she/her)21:02:44

check out the last two examples of the section I linked

Cora (she/her)21:02:22

if I understand the desired structure well enough it seems like they're going to have to remove and add again to stick it at the end of the ordered map

Noah Bogart01:02:50

Ah okay, I misread the example, thanks.

Cora (she/her)02:02:07

it's easy to do 💜