This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-06-09
Channels
- # 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.
@donaldball i am sorry but i am not sure if i get you 😅
according to logic, “for every e in E P(e)” is true for every P if E is empty, right?
maybe what you want is (not (some not-whitespace string))
because regardless of your domain, every? is doing the right thing for its definition
@noisesmith the function works and i got the problem right with every?
If all strings must go into only two categories, blank and not blank, "" is closer to the blank category
sure, but you didn’t write the quiz 😄
there’s an empty character?
you are right @noisesmith
well ' isn’t clojure syntax for characters, and isn’t a matching delimiter
ugh - this bot sucks
> (type 'foo)
clojure.lang.Symbol
that returns foo
- a symbol
but \space
is the space character
and ‘foo’ is a symbol ending in ' that prints as foo'
“” isn’t a character
@retrazil blank != whitespace. the latter is a well-defined property of characters, not strings, see https://en.m.wikipedia.org/wiki/Whitespace_character .
right, that could be (every? number? “”)
or (every? class? “”)
or (every? coll? “”)
all are true, because it’s empty
@noisesmith but whitespace? checks if there is whitespace in the string right
@retrazil the function doesn’t even matter - every? knows that all predicates are true on every item of an empty collection
boooo
@donaldball did you want some?
No, I was goofing around with illogical predicates 😛
right
@noisesmith thanks a lot !
it’s a premise of mainstream logic
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.
I thought it was “every possible proposition is true, given a contradiction”
> 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.
(or at least remember to use Slack’s threads when you go down a rabbit hole 🙂 )