This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-11-10
Channels
- # aleph (4)
- # aws (2)
- # bangalore-clj (2)
- # beginners (84)
- # boot (25)
- # cider (3)
- # cljsrn (3)
- # clojure (57)
- # clojure-italy (5)
- # clojure-losangeles (3)
- # clojure-russia (7)
- # clojure-spec (18)
- # clojure-uk (29)
- # clojurescript (90)
- # cursive (11)
- # data-science (68)
- # datascript (2)
- # datomic (25)
- # duct (3)
- # fulcro (13)
- # graphql (7)
- # immutant (1)
- # jobs (1)
- # leiningen (12)
- # lumo (1)
- # off-topic (51)
- # om (43)
- # onyx (15)
- # parinfer (10)
- # pedestal (4)
- # re-frame (7)
- # reagent (42)
- # ring-swagger (42)
- # rum (1)
- # shadow-cljs (172)
- # spacemacs (10)
- # specter (4)
- # sql (4)
- # test-check (19)
- # unrepl (54)
- # yada (3)
I guess it's synonymous with recur
, which I quite like. You're not allowed to use it in the wrong place.
continue
is overloaded though and it's more things you'll have to think about / support in whatever tooling exists. Like tern etc. They could've potentially used a different keyword in place of they can't because arrow functions. I am, once again, reminded how much I love s-expressions and macros.return
too, I guess.
Ah, didn't spot that. The problem is then you can't warn on "you're not returning in the tail position", because you don't know what return is your base case or a recursion.
If you have explicit recur
or return continue
then you can say "I know what you want, but I can't do that here".
It's one thing I like about the Clojure recursion when compared to something like Scheme, even though it's a workaround. I like the explicitness 🙂
Yup, continue is for for/while loops AFAIK. Although I don't see it much. I think some ClojureScript stuff compiles to it though.
cljs.user=> (defn add [a b]
#_=> (if (zero? b)
#_=> a
#_=> (recur (inc a) (dec b))))
function cljs$user$add(a,b){\nwhile(true){\nif((b === (0))){\nreturn a;\n} else {\nvar G__22 = (a + (1));\nvar G__23 = (b - (1));\na = G__22;\nb = G__23;\ncontinue;\n}\nbreak;\n}\n}
I'd like to think that I'm pretty language-agnostic and flexible as a programmer, but I've moved between 8 different languages in 8 different projects in the last two days for my company and I'm starting to write clojure in python files, swift in ruby, c in java, etc. I need a new gig.
nothing against you, but the context switch to write code that looks pythony right after java, right after clojure, right after .... would be tough
definitely not pythonic (having written pythonic code and used python primarily in the past)
yeah python is pretty opinionated in how it usually looks to someone who does python all day
and reading clojure code from someone who usually writes c would probably be quite jarring
but the issue is that my team is mostly gone and these projects weren't originally intended to be "functional python"
I've actually long held that python with something like clojure.core as an addon library would be an almost perfect dynamic language for rapid prototyping
I would prefer clojure syntax, but python is close enough and has the right libraries for NLP/ML/Numerical work
Some companies really advocate for their polyglot system, I've always thought that must be so difficult.
After 2 years, I'm still learning things about Clojure's intricacies. I can't imagine doing that divided across even 4 other languages.
I guess it’s not realistic to master all features of each language but it’s possible to learn to be really effective with a subset of features. Usually there’s quite big intersection between different languages and if you aim polyglot you should probably invest in being brilliant with the stuff you can use in each of them.
Anything goes in #off-topic but note there’s also #other-languages if you want to discuss, well, you know.
anyone know of good places to network with clojure devs in Latin America? I spend some time there fairly often so looking to network with devs from there