Fork me on GitHub
#braveandtrue
<
2016-05-31
>
nonrecursive00:05:58

@zackbleach: the “your email address doesn’t look like an email address” validation actually doesn’t mark the email invalid if it’s empty

nonrecursive01:05:53

this might make more sense if you consider just the (empty? %) part of #(or (empty? %) other-stuff)

nonrecursive01:05:43

it’s more like it’s saying, “don’t check the email address with re-seq if the email address is empty"

nonrecursive01:05:40

it’s like “the email is valid with regard to ‘Please enter an email address’ validation if the email address is not empty. The email address is valid with regard to ‘Your email address doesn’t look like an email address’ if either a) the email address is empty or b) the email address conforms to that regex’"

nonrecursive01:05:07

pretty much the wordiest way I could express it

zackbleach01:05:40

got it, I’m assuming that "Your email address doesn't look like an email address” will always be checked after "Please enter an email address"

nonrecursive01:05:59

the checks are actually all run independently of each other

nonrecursive01:05:32

what I mean is, they are run in that order but the output of one check doesn’t feed into the input of another

nonrecursive01:05:16

#(or (empty? %) (re-seq #"@" %)) works on (:email your-data)

nonrecursive01:05:02

the (empty? %) part is checking whether (:email some-map) is empty

nonrecursive01:05:10

it does that so you don’t get the “your email address doesn’t look…” validation message in addition to “please enter an email address”; if you haven’t entered an email address it’s not really helpful to also say that what you entered doesn’t look like an emaill address

zackbleach01:05:50

aha, I see! I’d totally forgotten how or works

zackbleach01:05:06

that’s clever 🙂

zackbleach01:05:26

thanks for being patient with the explanation!

nonrecursive01:05:54

np man hope you’re enjoying clojuring 🙂

zackbleach01:05:02

I’m doing the exercises in the macros chapter, it’s super fun and a bit mind bending 🙂 Cheers for the awesome book!

echristopherson22:05:20

someone pleeeease make me start clojuring

echristopherson22:05:47

I guess if I'd stop doing mundane scripting tasks in Ruby and sh that might help