Fork me on GitHub
#clojurescript
<
2017-06-28
>
miikka05:06:20

I wonder why the signature for resolve is [[_ sym]]? Naively I'd expect it to be just [sym] or [_ sym] to match Clojure. Can someone explain this? https://github.com/clojure/clojurescript/blob/3438f205b6b692f64af5d3f15b34a0e223363fa4/src/main/clojure/cljs/core.cljc#L3148-L3159

miikka06:06:33

Right, okay, calling it actually works as I expected... (resolve 'cljs.core/first) returns #'cljs.core/first

miikka06:06:34

Although ((resolve 'cljs.core/first) [1 2 3]) fails

thheller10:06:56

'cljs.core/first expands to (quote cljs.core/first) so the [_ sym] just drops the quote since it is a macro. In Clojure you’d get the actual symbol since its a function.

dasibre09:06:49

I'm trying to setup emacs + cider + figwheel for development, having a hard time get cider to start figwheel without having to manually start it up (use 'figwheel-sidecar.repl-api) ...etc..etc, have tried to follow docs on a few blogs and cider docs, but still having trouble. using emacs 25, would appreciate any help

gmercer10:06:24

@dasibre are you talking about invoking cider-jack-in-clojurescript not doing what you expect ?

pradyumna10:06:37

my preferred way is to start the repl from command line using lein repl and then use cider-connect to get the repl inside emacs. It is also ok to use the cider-jackin to have the repl in emacs. Then use the simple command (fig-start) in the repl to start the server. You can use (fig-stop) to stop the server if you wish. To get the cljs repl, there is another command (cljs-repl). These 3 functions are available with the figwheel project template. You can just create a new app lein new figwheel app and then copy the folder dev from it to your project. That will make this functions available in user namespace.

dasibre10:06:15

@gmercer right, I was hoping it would automatically start figwheel without me having to do it manually

dasibre10:06:52

thanks @pradyumna will try that

pradyumna10:06:12

@dasibre just one point, if you copy the dev folder then ensure it is added to the :source-paths in project.clj

gmercer10:06:36

@dasibre it is definitely possible - looking for the incantation now (BTW we could move over to #cider )

dasibre10:06:25

moving to cider

dnolen12:06:03

@miikka that’s just a bug

dnolen12:06:54

(the part about the resulting var not being invokeable)

dnolen12:06:52

fixed now in master

pesterhazy14:06:43

How do I extend IPrintWithWriter to functions? This has the desired effect:

(extend-protocol IPrintWithWriter js/Function (-pr-writer [new-obj writer _] (write-all writer "#function[]")))
but produces the warning "Extending an existing JavaScript type - use a different symbol name instead of js/Function e.g function". On the other hand,
(extend-protocol IPrintWithWriter function (-pr-writer [new-obj writer _] (write-all writer "#function[]")))
doesn't produce the warning, but fails to produce the desired effect (tested with (prn identity))

pesterhazy14:06:06

Using IFn doesn't seem to work either

dnolen14:06:39

@pesterhazy there’s already a case for functions and you can’t override - there’s an issue for this in JIRA

dnolen14:06:01

@pesterhazy yep, someone should just drop a table with before and after perf numbers

Pablo Fernandez16:06:07

I added this to my clean-targets: [:cljsbuild :builds :renderer-test :compiler :output-to] and I'm getting the error: Deleting non-target project paths ["test-app/renderer/renderer.js%s"] is not allowed. How can it be a non-target path? How do I make it a target path?

Pablo Fernandez16:06:53

Where does figwheel take the list of files to compile?

myguidingstar16:06:24

@thheller is it possible to start a repl server during development of a node.js library with shadow-cljs?

thheller17:06:22

myguidingstar: assuming you have shadow-cljs watch your-build running you can shadow-cljs cljs-repl your-build or shadow-cljs clj-repl

thheller17:06:38

or just shadow-cljs node-repl and go from there

lwhorton17:06:52

has anyone been able to get cljs spec with generators to work inside vim-fireplace using evaluators like cpp? I never can seem to get it working

lwhorton17:06:51

And since vim-fireplace with clojurescript has never reported correct error messages, it’s really tough to debug. I have to go over to using a cljs-repl and manually entering my loaded namespace, requiring the spec and generator namespaces, then doing the repl work over there instead of right inline with vim.