Fork me on GitHub
#clojurescript
<
2016-01-30
>
chrisn00:01:02

Yes, thanks

amonks02:01:13

Sanity check: I want to do client-side routing with not just paths but subdomains. Is extending Secretary the best approach?

amonks02:01:49

ie point http://alice.example.com and http://bob.example.com to the same s3 bucket with the same cljs SPA

spinningarrow06:01:16

Are cursors an om-specific concept or a general computer science thing? The only general reference I can find is to database cursors - is that the same thing?

cjmurphy06:01:30

I think it is a functional programming thing and that cursors and lenses (and zippers - I just googled) are all in the same area.

asolovyov11:01:02

I wonder if it's possible for a macro to know if it compiles for clojure or for clojurescript? I want to write a macro which results in slightly different code for different environments.

jaen11:01:17

But these are reader conditionals, I don't think you can emit them from a macro.

jaen11:01:21

(might be wrong tho)

seriousbug11:01:45

Still, couldn't you emit different code from the macro based on the reader conditional? I haven't used them tbh, I'm not sure as well

jaen11:01:35

Clojurescript macros are run in Clojure (unless bootstrapped) so at best you could differentiate between JVM Clojurescript and bootstrapped Clojurescript that way.

jaen11:01:11

Not 100% sure but I don't think there are any reader conditional variants to differentiate Clojurescript from Clojurescript macro execution.

jaen11:01:33

Maybe there's something in the &env to tell though or something.

jaen11:01:06

Is that like an official feature or just happen to be that way and can change in the future?

juhoteperi12:01:48

Hmh, not official. Not sure if &env is documented somewhere. Anyway, it's already used by lots of code so stuff will anyway break if it is changed.

solicode12:01:22

Yeah, it feels more like a "trick" to me. It works, and it's not uncommon to come across it in CLJC libraries in the wild. I've had to use it in one of my projects too.

asolovyov12:01:31

@juhoteperi: cool, thanks, will try that simple_smile

asolovyov12:01:27

it works, woohoo! simple_smile

asolovyov14:01:39

how do I find analogues of cljs protocol in clojure? Like IPrintWithWriter or IHash, for example?

jethroksy14:01:59

The underlying implementation of clojurescript and clojure are different

jethroksy14:01:12

clojurescript is more protocol-based loosely speaking

Alex Miller (Clojure team)14:01:18

@asolovyov: you might be interested in this ticket

Alex Miller (Clojure team)14:01:44

we've debated this a bit, particularly about whether this is even a thing that we should provide. still unresolved.

asolovyov14:01:11

I am interested! It work with &env right now, of course, but official way would be really nice to have.

mfikes14:01:29

@asolovyov: FWIW, Nicolás Berger explores a common approach relying on &env, specifically if-cljs, near the bottom of this post http://blog.nberger.com.ar/blog/2015/09/18/more-portable-complex-macro-musing

dnolen16:01:08

@spinningarrow: they were inspired by the thinking behind zippers & lenses

mateusz-fiolka21:01:46

Hi, anyone here using cljs with node? I'm not sure I understand the dev workflow. Do you use cljs compiler watching and rebuilding and nodemon to autorestart the server or just cljs node repl somehow?

dnolen21:01:25

@mateusz-fiolka: I suspect most people use just use the node REPL

jaen21:01:49

@mateusz-fiolka: some time ago someone was wondering the exact same thing. They came up with a template - https://github.com/crocket/cljs-npm-template (here's a project using it - https://github.com/crocket/to-utf8-unix).

jaen21:01:08

Can't vouch for how nice it is to use though, since I don't do node.