Fork me on GitHub
#clojurescript
<
2016-04-23
>
wei01:04:30

how do you properly read a bigdecimal from transit in javascript? #object[Object [TaggedValue: f, 50]] isn’t so easy to work with.

leontalbot02:04:40

@dpsutton interesting, could you give an example

dpsutton02:04:57

@leontalbot: i was thinking something like this:

dpsutton02:04:22

and then just map turn-on-if-necessary across your data structure

leontalbot02:04:25

cool! When You have a lot, might be useful simple_smile

dpsutton02:04:05

the syntax is way off. i'm new to destructuring so i'm looking into it

dpsutton03:04:47

i'm being dumb with the get-in

tel04:04:10

I’ve got an early OSS project, a component system a la Elm built atop Quiescent. I’m not yet ready to think of it as post alpha in a number of ways, but I’d love feedback: https://github.com/tel/oak

ajchemist07:04:02

It seems clojurescript doesn’t populate proper arglists. In clojure: (defn a {:arglists '([x])} [& xs]) -> (meta #’a) arglists is ([x])

ajchemist07:04:38

but in clojurescript, is ([& xs])

alpheus16:04:03

Is it possible to create a namespace in a macro in clojurescript?

mfikes16:04:24

@alpheus: I think deviating from using plain ns forms at the top of namespace-dedicated source files is likely to result in various challenges owing to expectations of other parts of the system (as well as tooling).

alpheus16:04:36

I'm pretty sure you're correct. I wonder if there's something in cljs.analyzer.api that might make it possible though.

alpheus17:04:34

At compile time, my program gets information about functions we need to create via an rpc call to another system.

alpheus17:04:56

I know how to create those functions in a macro, but unfortunately they'd be in the namespace of the file that uses the macro.

alpheus17:04:28

So I have to create a file for each namespace I expect to create, and put a single macro invocation in that file. Kind of tedious.

alpheus17:04:25

I mean, the only reason for those files is to create a namespace. I don't know any other way to create a namespace, and realize it may not even be possible or desirable in Clojurescript.

mfikes17:04:03

@alpheus: Interestingly, if you try an experiment where you introduce a new ns form in the middle of a file, things appear to work. (You get analysis warnings in JVM ClojureScript if you attempt to use symbols from that namespace, but the behavior is correct. OTOH, things work cleanly in bootstrap ClojureScript for some reason—no warnings are issued.)

alpheus17:04:43

I've noticed that. I can also use the ns form to create namespaces in the cljs REPL

rnandan27317:04:57

Any pointer to using local storage for offline file uploads in reagent

alpheus17:04:02

Introducing new ns forms in a file was my fallback approach.

mfikes17:04:26

@alpheus: I think you are right in that the issue appears to be related to the analyzer. Beyond simple experiments here and there, I don’t know what the issues and pitfalls are.

alpheus17:04:29

It's probably more trouble than it's worth, but now I hate to give up without understanding it.

mfikes18:04:58

@alpheus: A couple of clarifications on your SO: 1. (special-symbol? ’ns) yields true in ClojureScript, but false in Clojure. In other words, since the ns form is special in ClojureScript and a macro in Clojure, with respect to syntax-quote your macro would need to be written

`(do (~’ns …
in order to expand properly in Clojure. You are right about ns being treated specially at compile time. It is not because it being in a top level form at the top of a file, but because it is a special form in ClojureScript. 2. Even with that, single-pass analysis of a do form hosting an ns form and a def form will result in the def form being applied to the namespace you evaluate the do form in, rather than the namespace you want things to be in. (This is a difference between ClojureScript and Clojure).

bwstearns18:04:04

Sorry to repeat a question here from #C0E1SN0NM, but there are a ton more people here. Is a ~30 minute init time for cljsrn normal? The log says Relax, this takes a while... and the ...s are making me wonder what order of magnitude a while is supposed to indicate.

mfikes18:04:33

@bwstearns: approximately 5 minutes is normal

bwstearns18:04:09

@mfikes: I have a case where it's now running up against an hour. Anyone have any suggestions for something useful to do with this state before I kill it and retry?

alpheus18:04:56

@mfikes thanks for the clarification. I'll confess that I was using the term special rather casually, and I didn't even know special-symbol? existed.

mfikes18:04:58

@bwstearns: Perhaps to a ps to see what’s up.

mfikes18:04:49

@alpheus: As you can see, one real challenge is the fact that a macro returns a single value, and the need to use a do, ns, defn pattern. 😞

alpheus18:04:35

I didn't get that at the first reading, but I do now. Thanks again.

bwstearns18:04:21

Hm. ok npm's been running for an hour.

mfikes18:04:00

@bwstearns: I’d smite it and start over. simple_smile

bwstearns18:04:23

@mfikes: thanks lol. I was equally cautious of killing it right before it was done and sitting around like a dope for another hour lol.

mfikes18:04:23

@bwstearns: Right. Yeah. 5 minutes is normal. If you try again and reach the 10-minute point, I’d look into making sure you have the needed version of Node, etc.

bwstearns18:04:10

I have 4.1.1, not sure what the current version is but 4.1.1 is within the stated requirements

bwstearns18:04:18

Ah, but I think I found the culprit. My network in this building is atrocious. It probably killed the connection at a place that didn't have a way to fail or retry so it just ended up waiting.

bwstearns18:04:49

And after 5 more tries I don't think I actually have a stable enough connection to init a CLJSRN project. It's comcastic!

bwstearns19:04:23

@mfikes: it was a compound issue of a path issue with npm and the network issue just made it easy to overlook since it failed randomly.

john.carnell19:04:03

hey anyone see this before. I am trying to start a new clojurescript project based on chestnut. I run lein new chestnut sinewave and I get the following error: Could not find artifact com.github.plexus:clj-jgit:jar:v0.8.9-preview in central (https://repo1.maven.org/maven2/)

plexus20:04:57

@john.carnell: would you mind opening an issue on the chestnut github? I can't look into it right now...

alpheus21:04:47

How did I not know about Planck?

mfikes21:04:41

@alpheus: Hah! There’s a lot of stuff out there. I’ve added it here: https://github.com/clojure/clojurescript/wiki#learning-tools

alpheus21:04:32

Bye bye #!/bin/bash, it was nice knowing you.