Fork me on GitHub
#clojure
<
2022-08-06
>
didibus05:08:45

Anyone know of one or more lib(s) that add back more traditional imperative/mutable constructs to Clojure? Sometimes I want to freshen up on leetcode and stuff to keep my interviewing game on, and would still rather do it in Clojure, but I also want to solve them with the imperative mutable solutions. So, I guess I'm thinking traditional for-loop, while-loop, do-while, mutable local vars, etc. I can use Java data-structures so that part is fine.

didibus06:08:40

I also just realized this doc: > Symbols beginning or ending with ':' are reserved by Clojure. A symbol can contain one or more non-repeating ':'s. > Why does Clojure reserve symbols that end with : ? I don't think there's any use of that right now correct?

dpsutton06:08:50

In order to add more features to the language sometimes it is necessary to reserve behavior as disallowed even if it doesn’t currently do anything. if :bob: was a legal keyword now, they could never make it a different construct in the future without breaking existing behavior

didibus17:08:46

True, I think it just made me curious, they didn't reserve much, but specifically colon at the end, like they already had an idea for it 😉 I always thought it be nice if the syntax for keywords allowed for the colon at the front or at the end.

{name: "John"}
(= :name name:) ;=> true
So it got me curious if this was why they reserved it

pinkfrog09:08:34

I am writing a macro for a library. What’s the metadata to add to the macro so as to customize the indentations of macro arguments?

pinkfrog13:08:11

Yes. I am aware of this, but that somehow get ignored by caval (and cljfmt).

didibus17:08:00

Don't think there's a universal standard across all tooling.

pinkfrog00:08:37

I want something working with calva/cljfmt only as this is what our team members are using.

Joshua Suskalo00:08:28

cljfmt doesn't work with meta and provides no way to distribute indentation specs.

🧂 1