Fork me on GitHub
#clojurescript
<
2015-10-17
>
bensu00:10:28

the relevant bits are under library/src/doo/runner.clj and library/src/doo/runner.cljs

bensu00:10:38

feel free to ping me if you have any questions, or even better create a issue there if you think your use-case could be covered in doo but is not

richiardiandrea00:10:24

Is the following working in your cljs repl guys?

(do (in-ns 'my.namespace) (def a 3) (in-ns 'cljs.user) my.namespace/a)

richiardiandrea00:10:40

if I split, not in the do, it returns correctly 3

richiardiandrea00:10:01

works in the normal clojure repl

mfikes00:10:38

There are two differences from Clojure:

mfikes00:10:14

In ClojureScript, in-ns is a REPL special, not a function, so you can’t call it like that. It has to be the first symbol.

mfikes00:10:36

And, in ClojureScript, analysis of an entire do form is done in the namespace you start off in.

richiardiandrea00:10:54

ok, good, very good to know

richiardiandrea00:10:21

that is why splitting the form works

mfikes00:10:36

To see a consequence of that 2nd point, try (do (ns foo.bar) (def a 3)) in both a Clojure and ClojureScript REPL and you will see a big difference in the result. simple_smile

richiardiandrea00:10:18

yes I saw already there were warnings of not found vars

mfikes00:10:05

In ClojureScript, (do (ns foo.bar) (def a 3)) the def form is not done in foo.bar but in the starting namespace.

mfikes01:10:10

(Thats because ClojureScript has this model where a form is analyzed (in a namespace), and then compiled.

richiardiandrea01:10:17

yes I see`a` is interned in the origin namespace

mfikes01:10:39

Yep. Another way to look at it is that namespaces are not reified at runtime.

mfikes01:10:01

(ns foo.bar) has no direct effect, in other words, until after the do finishes completely.

mfikes01:10:39

Anyway, no need to dwell on it… but ClojureScript is definitely different than Clojure for this, and for how you can mix macros and fns, etc.

richiardiandrea01:10:44

so actually the creation of the namespace is not visible until the do has finished

richiardiandrea01:10:39

tnx again, very useful

cfleming02:10:38

@dnolen: Awesome! Let me know how it goes, I’m curious to know.

dnolen02:10:12

@cfleming: hoping this will eliminate most environment issues … we’ll see

thheller10:10:41

@cfleming Cursive does not seem to like the clojurescript project sources. Always get Too many IDE fatal errors. Monitoring stopped. after a while.

thheller10:10:44

did "Report to Cursive" a couple of times .. StackOverflowError: null not sure how many other details you get

bbss13:10:05

That happens to me too. The new intellij is not stable.

practicalli-johnny13:10:04

Any Clojurescript tutorial for beginners, preferably with reagent ?

bensu14:10:51

@jr0cket: did you read the QuickStart?

jonas14:10:55

I don’t know of any beginner material for Clojurescript. Perhaps start with learning Clojure and then try to move over to Cljs when the basics are covered?

jonas14:10:51

@bensu: I wouldn’t consider the QuickStart a tutorial for learning the language

bensu14:10:23

No, me either but I'm trying to see where @jr0cket is at

jonas14:10:11

Nice! I totally forgot about that one.

practicalli-johnny14:10:46

@bensu: thanks, its a great reference. we are trying om-next quick start as we wanted something that steps us through building something specific https://github.com/omcljs/om/wiki/Quick-Start-(om.next)

practicalli-johnny14:10:22

we did the clojurescript quickstart this morning, that worked great

practicalli-johnny14:10:47

well, we had a few issues with windows machines.... but everyone else's worked fine

clojer14:10:51

I have Reagent form component - https://gist.github.com/anonymous/1f0ee193577c8ec7d09d - but Chrome Dev Tools shows no network activity when I submit the form. Teseting with http --form POST localhost:3000/register first_name='John' ..... etc. works and adds an entry to the database. Any ideas?

bbss14:10:29

Heh, cljs devtools is trending today: https://github.com/trending

jaen14:10:08

Hm, curious why

bensu14:10:30

@bbss @bbss it made HN a couple days ago?

bensu14:10:49

there is probably a strong correlation between /trending and HN

jaen14:10:26

HN's that Arc website?

bhagany14:10:05

@jaen: hahahahaha yes. that's the first time I've heard of it put that way. awesome.

bensu14:10:23

hahahhahahaha yes! @bhagany my thoughts exactly

jaen15:10:50

Hue, I was being slightly facetious - I know what HN is, I was taking a jab at it, since it kinda baffles me that such a website can have this noticeable effect. P ;

bbss15:10:54

I would love if there was an option to expand the datastructures by default, now it is often better to pprint for me.

jaen15:10:24

Anyways, it's deserved - I can't imagine living without devtools now

bhagany15:10:00

@jaen: I'm with you there

bhagany15:10:19

(re: HN's effect)

jfntn15:10:47

Has anyone ever looked into running cljs on Postgres plv8? I’ve been doing some preliminary research and I don’t see any showstoppers so far… Now I just need someone to talk me out of it 😛

tavistock17:10:48

is there a function that takes a string like “(println ‘hello’)” and return a list of the tokens

bensu18:10:40

@tavistock: is that string going to be clojure source code?

tavistock18:10:15

@bensu: yea its going to be clojure

mfikes19:10:47

@tavistock: One idea to consider is cljs.tools.reader, depending on what you want to do.

bensu19:10:45

@tavistock: use the built in reader or follow @mfikes advice. In any case remember that Clojure is a lisp and that it's both trivial to parse and manipulate after parsing: (first (read-string (pr-str '(println "hello")))) returns println

mfikes19:10:10

Yeah, avoid cljs.tools.reader if you don’t need stuff like support for reader conditional, etc.

tavistock19:10:22

I knew that there was a function like that and i just couldnt get the right words to google it

bensu19:10:58

right, lisp's traditionally call "reading" what other languages call "parsing"

edvorg20:10:30

Reposting from #C03S1KBA2 >> Hi, guys, I wrote a demo project which might help newcomers understand, what’s going on in clojure web applications. >> It’s simple multiplayer starcraft clone using reagent, http-kit, core.async, chord, compojure and secretary. >> Check it out http://github.com/edvorg/yet-another-craft

cfleming21:10:22

@thheller: Thanks, I’ll take a look. I’m pretty sure it should work there since dnolen uses it. One thing you could try is File->Invalidate caches and restart, sometimes indexes get funky and have to be rebuilt.

cfleming21:10:07

Ok, can you mail me a log?

thheller21:10:18

it might be related to me having 2 intellij windows open. one for clojurescript, one for my project

cfleming21:10:37

Help->Show log in Finder/Explorer, send to <mailto:[email protected]|[email protected]>

thheller21:10:31

will do when it happens again

cfleming21:10:51

Perfect, thanks - I’ll take a look at the traces you sent too

mfikes22:10:59

Hah! Dan Motzenbecker has updated Natal so you can now launch ClojureScript / React Native and establish a REPL to the iOS simulator without launching the Xcode IDE simple_smile