This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
- # beginners (121)
- # boot (28)
- # cider (106)
- # clara (57)
- # cljs-dev (70)
- # cljsrn (6)
- # clojure (145)
- # clojure-dev (7)
- # clojure-italy (36)
- # clojure-russia (42)
- # clojure-spec (26)
- # clojure-uk (127)
- # clojurescript (103)
- # core-async (10)
- # cursive (56)
- # datascript (66)
- # datomic (16)
- # defnpodcast (1)
- # emacs (18)
- # events (6)
- # figwheel (1)
- # jobs (1)
- # luminus (1)
- # lumo (44)
- # off-topic (58)
- # om (17)
- # onyx (2)
- # parinfer (75)
- # pedestal (4)
- # re-frame (18)
- # ring (4)
- # ring-swagger (8)
- # rum (7)
- # spacemacs (7)
- # specter (2)
- # sql (4)
- # unrepl (39)
- # untangled (17)
- # vim (3)
- # yada (21)
Or should it crash due to the starting
\U not being followed up by any unicode sequence?
Full context on StackOverflow: https://stackoverflow.com/questions/44458453/clojure-escaping-unicode-u-in-json-encoding
Reading the spec for JSON (https://tools.ietf.org/html/rfc7159), particularly https://tools.ietf.org/html/rfc7159#section-7 and https://tools.ietf.org/html/rfc7159#section-8.2 I'm inclined to think that Elm's behaviour may be incorrect.
Having said that, the browser also interprets capital U's, so clojure probably should too.
Advice on how to get around the issue? Would you manually escape
\U on the server, or make a more robust string parser client side?
i basically have to make a function (blank? string-here) which tells if the string is blank
shouldn't empty string return false in this case since there is no whitespace character in there ?
I see your point. I guess, from the context of within a string, a lack of characters could be considered "white space"
could it ? because i thought i was missing something there. I went to wikipedia and it says whitespace is what it means, whitespace. That got me confused.
Every character in the string is white space. It’s just trivially true: there are no characters in the string.
according to logic, “for every e in E P(e)” is true for every P if E is empty, right?
because regardless of your domain, every? is doing the right thing for its definition
If all strings must go into only two categories, blank and not blank, "" is closer to the blank category
@retrazil blank != whitespace. the latter is a well-defined property of characters, not strings, see https://en.m.wikipedia.org/wiki/Whitespace_character .
@retrazil the function doesn’t even matter - every? knows that all predicates are true on every item of an empty collection
it doesn't really make much sense: intuitively, if P is true of every member of a collection, it must be true of some member. which is not possible with an empty collection.
> P is true of every member of a collection, it must be true of some member. not true. If P is not true for every member of a collection, then there must be some x in the collection for which P is not true
you don't have to give an example of false, all you have to do is derive a contradiction. in classic truth-conditional logic, at least. in constructive logic you do have to give an example.