This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-09-01
Channels
- # aleph (2)
- # announcements (3)
- # architecture (9)
- # babashka (56)
- # beginners (18)
- # calva (7)
- # catalyst (16)
- # cider (18)
- # cljfx (3)
- # cljs-dev (23)
- # clojure-europe (11)
- # clojure-hungary (1)
- # clojure-nl (2)
- # clojure-norway (24)
- # clojure-sweden (2)
- # clojurescript (37)
- # code-reviews (47)
- # datalog (3)
- # datomic (8)
- # emacs (11)
- # events (2)
- # graalvm (7)
- # gratitude (1)
- # hyperfiddle (12)
- # java (1)
- # jvm (46)
- # kaocha (3)
- # lsp (3)
- # malli (4)
- # matcher-combinators (1)
- # music (1)
- # nbb (1)
- # nrepl (4)
- # releases (1)
- # sci (15)
- # shadow-cljs (21)
- # slack-help (21)
- # tools-deps (17)
@alexmiller @fogus I’m curious if there any known edge cases w/ top-level closures? there seems to some interest in supporting this better
if you're asking about clojure, i'm not aware of any reason why top level closures would cause issues, this seems like a specific bug in the cljs emission
and it's a perfectly valid pattern to use. admittedly using letfn
to do a "let over lambda" is not as common as using let
, but they both should be supported IMO (and they do work as one'd expect in clojure)
@U050B88UR I'm not aware of edge cases off the top of my head. I'll look to see if there are any that I just don't know about.
@U060FKQPN is not really bug, it’s not been supported because the compilation model
generating top level closures used to interact extremely badly with advanced compilation
@U050B88UR – to be more specific, is it fair to assume that it's only letfn
s support for forward declarations/mutual recursion that causes these compilation issues, while top-level closures with a plain let
don't?
I've since moved to using top-level (let [f (fn ...)])
instead because I rarely need letfn
s forward declaration support and in the cases where I do, I can still define regular private top-level functions and declare
to achieve this (might go against my personal code style preferences in this case, but it's rare enough that it's fine).
So if it turns out that properly supporting top-level letfn
in ClojureScript is a huge amount of effort or cannot be done without breaking advanced compilation at this time, I'd personally settle for a (hopefully temporary) compiler warning and a note in the ClojureScript documentation. The biggest problem here is really that the expectations-defying scope-breaking behaviour is silent.
@alexmiller also I see you ran the release thing 2 weeks ago successfully, was that just a test?
I ran it with deployment it off I think
yes, it was a test, and it did not actually make a public release
but if you ran it now, it would :)
@alexmiller ok thanks
it appeared to work, but I don't see the release out there
well, I do see it in Maven Central UI and I can download it (v 1.11.121) so I guess it's ok
ah, just lexically sorted in the repo directory so I missed it