This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-03-23
Channels
- # admin-announcements (6)
- # aleph (3)
- # beginners (38)
- # boot (119)
- # braid-chat (15)
- # braveandtrue (1)
- # clara (4)
- # cljs-dev (56)
- # cljsfiddle (12)
- # cljsjs (15)
- # cljsrn (6)
- # clojars (4)
- # clojure (113)
- # clojure-art (1)
- # clojure-berlin (1)
- # clojure-dusseldorf (3)
- # clojure-india (15)
- # clojure-new-zealand (3)
- # clojure-poland (1)
- # clojure-russia (83)
- # clojure-uk (18)
- # clojurescript (97)
- # community-development (9)
- # cursive (1)
- # data-science (1)
- # datomic (12)
- # emacs (14)
- # hoplon (350)
- # immutant (2)
- # jobs (2)
- # jobs-discuss (23)
- # keechma (74)
- # liberator (1)
- # off-topic (1)
- # om (127)
- # onyx (54)
- # parinfer (74)
- # pedestal (1)
- # proton (5)
- # re-frame (6)
- # reagent (4)
- # remote-jobs (17)
- # ring-swagger (1)
- # slack-help (5)
- # untangled (16)
- # yada (21)
Can anyone explain why the literal 08
and 09
causes ClojureScript compiling to fail? 07
is fine. I’m guessing it’s some kind of octal thing?
It is interesting that bootstrapped behaves differently (uses a different reader, and lets those pass).
what value does it return for 08 and 09?
But, yes, that’s pretty common. For example:
$ perl -e 08
Illegal octal digit '8' at -e line 1, at end of line
luckily, the numberreader in the clojure parser is using a somewhat complex regex to figure out how this is done:
static Pattern intPat =
Pattern.compile(
"([-+]?)(?:(0)|([1-9][0-9]*)|0[xX]([0-9A-Fa-f]+)|0([0-7]+)|([1-9][0-9]?)[rR]([0-9A-Za-z]+)|0[0-9]+)(N)?”);
(def int-pattern #"^([-+]?)(?:(0)|([1-9][0-9]*)|0[xX]([0-9A-Fa-f]+)|0([0-7]+)|([1-9][0-9]?)[rR]([0-9A-Za-z]+)|(0[0-9]+))(N)?$”)
wasn't paying attention to this channel -- mention me or assign yourself to the ticket next time
I got a bit worried by the tests, since they sort of documented that invalid octal numbers should be parsed as decimal
@dnolen: I've opened the issue regarding specify!
, but I couldn't stop myself from exploring it a bit further and I think I've found the bug
specify!
defines a local variable in let
but extend-type
uses resolve-var (dissoc env :locals)
I think this is the problem
why this only happens in advanced compilation, I don't know
this might also not be the bug
changing it to env
still produces the issue
diving deeper
@dnolen: this is the line generating the warnings https://github.com/clojure/clojurescript/blob/master/src/main/clojure/cljs/compiler.cljc#L936
it gets there in :advanced
because *cljs-static-fns*
is true
I'm not sure what the fix is, I suppose I could attach this information to the issue
@anmonteiro: that would be helfpul
@anmonteiro: why are you using specify! (.-prototype MyBug)
instead of extend-type MyBug
?
@thheller: it's how I managed to reproduce the bug
it's what Om uses
it came from there
well, specify!
still calls extend-type
under the hood
Hello guys, I tried http://dev.clojure.org/jira/browse/CLJS-1585 and found a weird (but maybe expected) behavior:
cljs.user=> (ns alias-load.core (:require [foo.bar.baz :as b]))
nil
alias-load.core=> ::b/hey
Invalid token: ::b/hey
...
alias-load.core=> (ns alias-load.core (:require [foo.bar.baz :as foo]))
nil
alias-load.core=> ::foo/barta
:foo.bar.baz/barta
basically only if the alias corresponds to the first segment this works
I will report it in the issue
I am using 1.8.34
@richiardiandrea: let’s make a new ticket for that please.
done, I am trying to check if it's an easy patch 😉 http://dev.clojure.org/jira/browse/CLJS-1608
so false alarm, on a second attempt, I see that it is working as expected, I tested it in with an actually test, I probably made a mistake in the example above, sorry for the noise