core-async

2026-06-21T03:04:16.445859Z

Is there a particular reason channels don't support metadata? Or just it was never done?

2026-06-21T11:38:19.852019Z

I think it's related to the fact that metadata makes more sense as something you "pair with" immutable data, rather than something like a channel which isn't immutable. Like, calling with-meta on a map returns a "new" map with that metadata, but if calling with-meta on a channel returned a new channel would be pretty awkward, and likely not what you want. It could be done the way atoms do it, e.g. with another arg to chan, but my guess is it was decided the juice wasn't worth the squeeze for that by the time core async came along

Steven Lombardi 2026-06-21T15:25:22.466979Z

There have been a handful of times where I was reaching for metadata when, in reality, my actual data model just needed to change. Anytime I've needed to associate data with a channel, I've just put the channel inside a map at that point.

Steven Lombardi 2026-06-21T15:25:52.033149Z

If you've hit a use case where that won't suffice, I'd be very curious to hear more about it.

2026-06-21T16:58:52.562499Z

@jjttjj Atom and other reference type support meta as well using reset-meta and alter-meta