Fork me on GitHub
#off-topic
<
2017-11-10
>
Olical10:11:43

I mean, it's not an additional symbol in the syntax, which is nice. Actually it is.

sundarj10:11:23

@olical haha yup 🙂

Olical10:11:23

I guess it's synonymous with recur, which I quite like. You're not allowed to use it in the wrong place.

Olical10:11:55

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 return too, I guess. they can't because arrow functions. I am, once again, reminded how much I love s-expressions and macros.

sundarj10:11:59

sexps are like a superpower

sundarj10:11:53

though i do like the rec function () {} and rec () => {} proposal on that repo

Olical10:11:28

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.

Olical10:11:55

If you have explicit recur or return continue then you can say "I know what you want, but I can't do that here".

sundarj10:11:05

ah right, good point

Olical10:11:45

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 🙂

sundarj10:11:59

yeah it's very nice

sundarj10:11:43

i think return recur foo() and () => recur foo() would be good

sundarj10:11:54

agree with the continue being overloaded thing

Olical10:11:23

Yup, continue is for for/while loops AFAIK. Although I don't see it much. I think some ClojureScript stuff compiles to it though.

sundarj10:11:04

yeah continue is 'break the current iteration, and go to next iteration'

sundarj10:11:01

i guess it is kind of similar to how tail recursion works

bronsa10:11:07

recur in cljs compiles to continue

sundarj10:11:07

@bronsa oh that's neat!

Olical10:11:15

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}

bja16:11:54

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.

dpsutton16:11:25

that sounds rough

dpsutton16:11:55

that also sounds like a recipe for putting non-idiomatic code everywhere

bja16:11:32

yeah, I have python that would probably pass for clojure if you move the parens around

bja16:11:56

as procedural java as you can get (from writing more C lately)

dpsutton16:11:56

nothing against you, but the context switch to write code that looks pythony right after java, right after clojure, right after .... would be tough

bja16:11:18

definitely not pythonic (having written pythonic code and used python primarily in the past)

dpsutton16:11:01

yeah python is pretty opinionated in how it usually looks to someone who does python all day

dpsutton16:11:19

and reading clojure code from someone who usually writes c would probably be quite jarring

bja16:11:36

I can compartmentalize function vs C mostly

bja16:11:43

but python, clojure, and swift are all pretty close

dpsutton16:11:54

i always wished i had worked in c. i would like to experience that for a few months

bja16:11:58

or at least can all be written to flow similarly

bja16:11:28

like, you can do composition and mostly function-based programs in python

bja16:11:55

although factory functions/partials in place of classes isn't exactly pythonic

bja16:11:56

but the issue is that my team is mostly gone and these projects weren't originally intended to be "functional python"

bja16:11:33

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

bja16:11:48

I would prefer clojure syntax, but python is close enough and has the right libraries for NLP/ML/Numerical work

Olical17:11:49

I always liked web dev in Python, I was particularly fond of Django and it's docs.

dominicm17:11:01

Some companies really advocate for their polyglot system, I've always thought that must be so difficult.

dominicm17:11:26

After 2 years, I'm still learning things about Clojure's intricacies. I can't imagine doing that divided across even 4 other languages.

valtteri20:11:54

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.

borkdude21:11:44

Anything goes in #off-topic but note there’s also #other-languages if you want to discuss, well, you know.

Rick 23:11:09

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

dpsutton23:11:24

well, that's a continent. may want to narrow down to an area smaller than double that of europe 🙂

Rick 23:11:15

well I mean because I assume it would be in spanish

dpsutton23:11:25

oh you mean online?

Rick 23:11:28

I guess I mean more any clojure community that talks in spanish

dpsutton23:11:50

haha ok. sorry i thought you meant places there. 🙂

Rick 23:11:05

ah ok 🙂 no I mean online communities, etc