beginners

2025-07-21T09:39:33.528139Z

Quick question... how do you pronounce the ? at the end of a predicate?

agile_geek 2025-07-21T09:40:51.938359Z

Question mark

genmeblog 2025-07-21T09:41:19.422209Z

intonation? 🙂

p-himik 2025-07-21T09:41:23.605679Z

The same as Âż, just upside down. Jokes aside, if precision is needed, then for e.g. isa? it would be "is, a, question mark". If you're just discussing something with no need for utter precision, then just "is, a".

2025-07-21T09:43:16.598899Z

That opens up how do you pronounce isa... my lazy annunciation would make one word of it "issuh".

Ed 2025-07-21T09:43:20.422979Z

I've heard some people say huh ... but I think when spoken it's unusual to need disambiguation

2025-07-21T10:11:51.538239Z

Does anyone say p (not really wanting to spell that one out) from LISP habit?

2025-07-21T12:16:07.896949Z

I watched a lecture where professor insisted it’s a long time lisp tradition to say huh?

p-himik 2025-07-21T12:22:51.315259Z

In a decade of Clojure, I don't think I have ever heard anyone say it. :)

2025-07-21T14:14:35.327779Z

i like saying huh

2025-07-21T14:14:50.355409Z

Huh?

2025-07-21T18:00:09.579209Z

I tend to do:

(let [is-dog? (dog? dog)]
 ...)
So I think I say "is dog". When I want to be specific I refer to the predicate result. Or "dog? pred" when I refer to the predicate dog? function. And just "dog" for dog.

VardriPoise 2025-07-21T10:30:17.443969Z

For lazy sequences, which one is faster? (drop-while (comp not some? #{x}) some-sequence) or (drop-while (comp not (partial = x)) some-sequence)?

p-himik 2025-07-21T10:39:26.096519Z

Impossible to tell because, looking at this code, you don't know what hash computations and equality checks will actually be doing. All depends on the actual data. But also, it's something you should not really care about. If you use lazy sequences, this part of code is unlikely to be inside some bottleneck. If it is, it should probably be of a different shape entirely. I would worry much more about the usage of comp here. There's just no need for it, same with partial. I'd write the predicate as #(not= % x).

VardriPoise 2025-07-21T10:43:06.525219Z

I see, thanks for the answer! (also ty for the style tip I did not know of not=)

p-himik 2025-07-21T10:58:22.393439Z

Oh, one more thing - those different forms behave differently. The second one can handle x being nil.

VardriPoise 2025-07-21T11:07:37.757069Z

ah right, noted ty!

2025-07-22T00:29:43.961469Z

(With the usual caveats that you can never be quite sure what you've learned from it) a very convenient tool for timing this kind of Clojure thing yourself is Criterium. Just remember to put a (doall...) around any lazy-sequence work!!

VardriPoise 2025-07-22T03:38:12.102199Z

i've just ran a couple of benchmarks with criterium, very cool stuff ty!

VardriPoise 2025-07-22T03:38:40.684929Z

turns out the difference in negligible

2025-07-21T03:19:38.142009Z

Hi, eveyone! Having done some ruby and rails, I got quite fond of rails' ORM. Just started a web project in Clojure and have found writing quite a lot of basic select/insert/delete sql for every entity in db over and over again. Feeling an urge to abstract it away somehow. What is the Clojure way though?

practicalli-johnny 2025-07-21T09:04:59.514549Z

Not an ORM but a Clojure alternative to raw SQL https://cljdoc.org/d/com.github.seancorfield/honeysql/2.7.1310/doc/getting-started

2025-07-21T09:06:27.895219Z

that I am using for sure

seancorfield 2025-07-21T12:37:57.922749Z

next.jdbc provides a namespace with basic CRUD operations https://cljdoc.org/d/com.github.seancorfield/next.jdbc/1.3.1048/api/next.jdbc.sql so you can avoid SQL for simple stuff.

👍 1
🙌 1
2025-07-21T13:01:23.018939Z

Just what I need, thank you!

2025-07-21T04:45:01.506279Z

I like https://github.com/camsaul/toucan2. In most cases, I just define a model and use Toucan functions as the “repository layer.” The documentation isn’t complete yet, so sometimes you have to look into the source code. But it saves a lot of time and lets you manage many things — column transformations, before/after hooks, multiple databases, and more.

đź‘€ 2
2025-07-21T04:56:38.286359Z

This is one is nice. Thank you!