This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-10-19
Channels
- # beginners (37)
- # boot (96)
- # cider (23)
- # clara (2)
- # cljs-dev (40)
- # clojars (1)
- # clojure (149)
- # clojure-conj (1)
- # clojure-dev (2)
- # clojure-dusseldorf (5)
- # clojure-france (82)
- # clojure-italy (1)
- # clojure-nlp (1)
- # clojure-russia (13)
- # clojure-spec (24)
- # clojure-uk (62)
- # clojurescript (131)
- # core-async (13)
- # core-logic (7)
- # data-science (1)
- # datomic (10)
- # defnpodcast (3)
- # docker (4)
- # emacs (3)
- # events (4)
- # hoplon (68)
- # klipse (4)
- # leiningen (1)
- # off-topic (5)
- # om (140)
- # onyx (16)
- # pedestal (24)
- # planck (10)
- # proton (2)
- # re-frame (9)
- # reagent (4)
- # remote-jobs (1)
- # ring-swagger (16)
- # untangled (5)
- # vim (8)
- # yada (30)
why is cljs.core/char?
defined in terms of goog.string.isUnicodeChar
instead of a string of length 1? (char? (char 0x00))
is true in clojure but not in clojurescript. (i can thank test.check for spotting this.) it'd be nice to know the rational behind this because, frankly, i don't understand it.
@noprompt is 0x00 a Unicode character? I know that (char 0x00)
says it is, but is it really?
does anyone know if foreign-libs are supposed to be loaded in the order they are required
@noprompt the answer is simple, char
is host-y there’s no need to replicate stuff like that
I’ve currently added immutable.js and draft.js (which depends on immutable.js) but draft.js always seems to load first
if draft.js
depends on immutable.js
you must express this in the :requires
part of the :foreign-libs
entry
@dnolen that still doesn't answer my original question though. why is defined in terms of that function? what makes that the definition of a char
and not a string of length one. i'm not trying to be contentious; just trying to get a better answer.
@dnolen i think the "it's hosty" answer might suffice as an answer for other topics but i tend to disagree in this case. the null character is a character. the definition of char?
as it applies to javascript is written to say, no, it's not. i'm only asking how this definition was derived. it just seems arbitrary. saying "it's hosty" avoids spelling out the rational.
no your expecation that char
can be used to coerce numbers and for the behavior to match Clojure is just unrealistic
now if you stop obsessing about this stuff and instead asked a simpler question maybe we could make progress 🙂
no, my confusion is with char?
alone. char
matters little in this discussion i could have easily replaced the original example code with (char? (.fromCharCode js/String 0))
. again, my question is why char?
is written in terms of a function that excludes the null character? i really don't care whether or not there is parity with clojure. i found this surprising.
@noprompt there’s no reason - it’s a bug now that I actually understand what your expectations are
but this is problem with how you constructed your example - it just makes it harder to understand what your issue is
@dnolen well, david, that's how the real underlying questions are uncovered. 🙂 you don't just start from the right place from the beginning.
yes - open a JIRA ticket & submit a patch a patch so that char?
can match the null string
@noprompt so it seems a big reason that this slipped under the radar is that there weren’t any tests for char?
which is unfortunate
so a patch should include tests, also the issue is wider than the null string and the tests need to reflect that
@noprompt I’ve introduced a dependency on test.check in the ClojureScript codebase for some test runs in a recent patch, so you have that available to write tests for your patch 🙂
there are no generative tests for cljs.core
yet, though, so this is an excellent opportunity to write some!
@anmonteiro noyce! thanks for the tip.
hello guys, I might need some help as I can’t connect cider to fighwheel and I can’t understand why. I have a cider-repl-set-ns needs a clojurescript repl
I use lein figwheel template
which should be ready
anyone ever had something like that ?
@baptiste-from-paris: maybe this will help? https://github.com/amirrajan/mokepon#running-the-game--dev--emacs
Here is a snippet of project.clj:
:plugins [[lein-figwheel "0.5.0-1"]
[lein-cljsbuild "1.1.3"]]
:source-paths ["src"]
:repl-options {:nrepl-middleware [cemerick.piggieback/wrap-cljs-repl]}
:profiles {:dev {:dependencies [[com.cemerick/piggieback "0.2.1"]
[figwheel-sidecar "0.5.2"]]
:source-paths ["cljs_src" "dev"]}}
ahha @amirrajan thx but I already had that
I just found it now though
for an obscure reason, my emacs does not launch (do (use 'figwheel-sidecar.repl-api) (start-figwheel!) (cljs-repl))
from me init.el
*from my
thx a lot for your time @amirrajan
@noprompt I went ahead and fixed the issue and reverted char?
to the old implementation
I only did unit tests since I want to cut a release now - feel free to add generative tests via an enhancement patch
@dnolen hey, this isn't a clojurescript question but I bet you'd know the answer to it right away (since you've done a lot of core.logic): "is there a way to AND a dynamically generated list of constraints? [Cannot apply all
or run
as they are macros]". Feel free to ignore if you have to think about it.
@dnolen i've been out of the clojurescript loop for a long time. i miss helping with the project when and where i can.
@johanatan yes, you can reduce your goals with bind
@noprompt glad to have any help whatsoever - that said, contributions are coming strong & fast these days 🙂
@johanatan yes the non-macro thing
i've noticed! i was very happy to see the new about solid 1.x.x
releases when the news came out. when my kids were born and i started having less time i decided to use the free time i have had to get better acquainted with computer science and just kind of disappeared into the fog of research.
@johanatan so write a function that invokes bind yourself
would be great if you can remember where. i'm not sure what the target of bind would be: are you saying that my pre-existing constraints should already implement the IBind protocol and thus the bind
method?
@johanatan sorry can’t help you further on this one right now
to answer my own question: yes, existing constraints support the IBind protocol:
slipstream.core=> (clojure.core.logic.protocols/bind (parent :bob :jon) (parent :jane :suzy))
#object[clojure.core.logic$eval1901$fn__1902$_inc__1903 0x7fe16741 "clojure.core.logic$eval1901$fn__1902$_inc__1903@7fe16741"]
slipstream.core=>
ClojureScript 1.9.293 released https://groups.google.com/forum/#!msg/clojurescript/96RnUYnhq8E/b2TmFNeOCwAJ
Hi. I am trying out reagent with figwheel and devcards. What is the best place to put my devcards? In the same file and namespace where my components are? Or where my tests are?
@witek I usually put them in a different source directory, so that I can easily put them in a separate build
I just tracked down a bug in my code that was due to int
behaving in a way I didn’t expect:
cljs.user> (int 15201360000.000002)
-1978509184
This seems odd to me - it happens because int
calls bit-or
on its argument - but I assume this is one of those host-y things, so I’m not trying to argue about implementation. However, I think the docstrings are misleading for these functions: https://github.com/clojure/clojurescript/blob/master/src/main/cljs/cljs/core.cljs#L2639-L2657
- int
doesn’t really just strip off decimal places
- the docstring for unchecked-int
is identical to int
, but it behaves differently (it returns what I’d expect for my input above)
- the docstrings for long
and unchecked-long
say they are identical to int
, but instead are identical to unchecked-int
.
Is this the sort of thing I should file a jira ticket for?so ClojureScript 1.9.293 seems to be loading commonjs modules that have the umd pattern now
I was reading the announcement and found a reference to this mysterious commit again: http://dev.clojure.org/jira/browse/CLJS-1809 Wonder what that’s about 🙂
@borkdude https://github.com/clojure/clojure/commit/e547d35bb796051bb2cbf07bbca6ee67c5bc022f
just feature parity w/ Clojure
yes, that commit. I tweeted about it some days ago 😛 https://twitter.com/borkdude/status/787377977302679556?lang=en
ah right
I suppose most of use don’t 🙂
it’s coming :)
not spec related
not anything big either, just a little transducer thing
suspense is killing me @alexmiller
just imagine Rich out in the garage tinkering :)
@alexmiller I suppose clojure.core.async/transduce
is also related
might have been spurred by the same thoughts
but more gap filling
Some months ago I thought: there must be some arity we are overseeing where Rich can fit in a feature that will blow most of us away. I’ll be watching github...
it’s not a big deal
I think we’ve spent more time talking about what to call it than he took to write it
@alexmiller don’t spoil it now
I don’t know the final name so can’t :)
I don’t believe anything till it’s a commit :)
@alexmiller Actually the feature turned out to be spec, but it didn’t fit inside a secret arity somewhere. Still blown away. 😉
I’d still love to expand vec and set to take a transducer
@alexmiller what’s your rationale for vec
? doesn’t (into [] xform coll)
cut it?
for vectors in particular, you could make this more efficient than the current impl by directly building the owning root array
oh you just explained it
some of that is in LazilyPersistentVector, but this would incur effectively no overhead to leverage that perf trick
basically drop the incoming values directly into an array and then embed that inside the root vector node at the point where you meet the threshold
@chris-andrews Maria’s patch was probably further enhanced
@dnolen Yeah, it’s really cool. I’m going to try making a couple boot tasks that make it easier to take advantage of some of this