Fork me on GitHub
#clojure
<
2022-02-27
>
craftybones17:02:18

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
craftybones18:02:40

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

lread21:02:09

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

respatialized18:02:01

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?

respatialized18:02:43

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

dpsutton18:02:22

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 💜