This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-05-18
Channels
- # announcements (2)
- # asami (20)
- # aws (4)
- # babashka (35)
- # beginners (47)
- # calva (65)
- # cider (19)
- # clj-kondo (63)
- # clojure (177)
- # clojure-austin (2)
- # clojure-europe (27)
- # clojure-nl (1)
- # clojure-uk (4)
- # clojurescript (13)
- # community-development (5)
- # conjure (5)
- # css (2)
- # data-oriented-programming (9)
- # datalevin (13)
- # datascript (15)
- # datomic (4)
- # devcards (6)
- # duct (4)
- # emacs (8)
- # funcool (1)
- # gratitude (2)
- # helix (3)
- # hyperfiddle (3)
- # introduce-yourself (1)
- # jobs (4)
- # jobs-discuss (26)
- # lambdaisland (2)
- # lsp (20)
- # malli (2)
- # meander (2)
- # mid-cities-meetup (5)
- # missionary (15)
- # music (4)
- # off-topic (37)
- # reagent (3)
- # reitit (2)
- # releases (2)
- # ring (18)
- # shadow-cljs (70)
- # specter (4)
- # sql (20)
- # timbre (3)
- # tools-build (43)
- # tools-deps (11)
- # vim (29)
- # xtdb (61)
There is a good reason why I can't use promesa.core/extract
in ClojureScript, right?
(-> (p/create :a)
(p/extract)) => No protocol method IState.-extract defined for type object: [object Promise]
js promises don't have the concept of a current value. it can only ever be accessed via .then
, which makes all access async even when resolved
Hi folks. This regex works fine for Clojure, but it won’t work when cljs is compiled to js:
#"^v[0-9-a-z]+{2,5}"
Error in browser:
Uncaught SyntaxError: Invalid regular expression: /^v[0-9-a-z]+{2,5}/: Nothing to repeat
I don’t have details on why it is invalid for js, but, in any case, I’m wondering if cljs could warn about it somehow.Sorry, by ’works in cloure I meant “I can evaluate it with no errors”. But this is true of any regex that uses the #{}
syntax anyway
Yeah I don’t think you want the + which is adding meaning. you want V and 2-4 digits after?
I don’t have context on the original regex, I was just surprised that people noticed it only after the application did not work at all (because of the error). But I guess it makes sense.
Sorry to be clear, you are saying you want “V” followed by alpha newmerics 1 or more times (the +) then you also want that 2 - 5 times, which doesnt make sense
I am not sure why it works in CLJ… well. I wouldn’t say it “works” but you find a match against any alpha-numeric string following a V, regardless of length
Well I guess it will “find” thats fine, you will just get the first grouping being the v + up to 5 alpha numerics… having the plus there seems to be valid in java land but would change your first match to be any length of digits after the v
May fit whatever cross-platform usecase you may have: https://github.com/lambdaisland/regal
@andre.peric I don't see any practical way to warn about regexes which are a host feature anyway