On 12 April 2011 12:02, Ken Wesson <kwess...@gmail.com> wrote: > Don't be ridiculous. If you're putting that (chain ...) sexp of yours > in every separate place where a field is checked for being an integer > in a range, then that's duplication. And if you extract it into a > function that just takes the endpoints as parameters (and maybe the > error strings, or a map of these), then you have a compound function.
I think our differences lie in when that compound function is constructed. My opinion is that you should only combine your validations when you are certain of all the parameters. Because only the end developer knows what messages should be used, it should be the end developer's responsibility to combine those validations. In your case, you're combining your validations *before* you know what the messages are, so your validation function then needs to be combined with an external map of error message. Both approaches amount to the same thing, but I prefer the former approach. It makes sense (to me) to combine functions only when they can be said to contain a combined purpose (e.g. to define the valid values of a particular type of object). >>>> In my experience, "deny-by-default" is the right answer in >>> >>> less than 100% of cases. >> >> I didn't say that. > > Yes, you did. If you're going to be childish, I don't think we should continue this. "Less than 100%" is not the same thing as "at least 99%", but this is such a minor detail that we shouldn't be even talking about this at all. I have not deliberately misinterpreted anything you have said. You don't seem to disagree that deny-by-default is the most secure scheme in most scenarios, so I'm uncertain why you think this wouldn't be a sensible default. At this point, I don't believe we'll reconcile our differences, and your tone is becoming just a touch hostile. Let's end the discussion here. You have the option of adding in some last words to sum up your points, but this will be my final response to your messages on this subject. - James -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en