off-topic

Shantanu Kumar 2026-04-24T07:03:19.351259Z

Don't you love it when one of the panel discussion members starts playing with their feet? https://youtu.be/DrF4dCC0daE?t=1451

💜 2
🤣 1
2026-04-24T12:40:21.056179Z

haha this is me every time i have to sit still

dgb23 2026-04-24T08:12:36.578629Z

Here is one of those questions where being self-taught is a disadvantage, but I'm sure many of you can help me to give this a name or point me into the right direction: Say I have a tree, and the nodes can be resolved/expanded by a multimethod or similar. However, nodes could be arbitrarily expanded until they have their final shape and further expansion is a no-op. I implemented this but it seems brutish: My base case is literally (= expanded resolved) I don't have the right language for what I'm doing here I think and I might be complecting things on top of it all.

borkdude 2026-04-24T08:36:22.441229Z

Another variation of this is macro expansion and the base case looks very similar to this

💯 3
🙏 1
dgb23 2026-04-24T09:03:01.188629Z

I will have a look at how it works and whether I'm doing something that's off. Is there some kind of general name for this approach?

borkdude 2026-04-24T09:03:59.222009Z

computing a transitive closure is also like this. but not sure if there is a general name. maybe "expansion"?

borkdude 2026-04-24T09:04:43.647929Z

I asked AI and it says: fixed-point iteration

🙏 1
dgb23 2026-04-24T09:04:46.695199Z

The thing that irks me is that i do an extra expansion step and check if something changed.

borkdude 2026-04-24T09:05:02.741729Z

where the fixed point is:

(defn fixed-point [f x]
  (let [x' (f x)]
    (if (= x x') x (recur f x'))))

dgb23 2026-04-24T09:05:17.499009Z

oh...

dgb23 2026-04-24T09:05:41.351089Z

where did I encounter "fixed point" before? i need to check

borkdude 2026-04-24T09:06:34.996539Z

maybe the fixed point combinator? http://en.wikipedia.org/wiki/Fixed-point_combinator

➕ 2
🙏 1
dgb23 2026-04-24T09:06:55.588299Z

Yes! thank you

dgb23 2026-04-24T09:08:56.881949Z

OK, now that I have a name for it I feel much better. Thank you

p-himik 2026-04-24T09:15:09.174299Z

The thing that irks me is that i do an extra expansion step and check if something changed.It does feel like that, yeah. But it's not something you can circumvent unless each expansion step knows everything about all other expansion steps and can guarantee that its result will not be expandable by them. In that case, the result can be marked in some way, via metadata or some wrapper.

🙏 1
respatialized 2026-04-24T12:10:03.819889Z

https://github.com/metosin/malli/#recursive-schemas if you need a more robust validation than just an equality predicate, depending on the shape of your data, you could define a malli schema that's an :or with your base case and an expansion step applied to itself via a :ref.