Unofficial answer from the sidelines. I am in no way associated with the folks who make decisions like this, other than that some of them know my name.
Throwing an exception in that case sounds like reasonable behavior to me, but of course any code written now that uses clojure.java.io/resource and relies on it returning nil, and does not catch an exception, could break if clojure.java.io/resource changed behavior from one Clojure release to the next. That is not to say that it should not change, or will not change, but a significant factor to consider in whether it will change. Anyone is welcome to create a ticket in JIRA requesting changes, just to get the question/suggestion 'in the system' and see what the response is (which may take significant time, given the other work desired to be done, some of which may be considered higher priority). I am probably belaboring the obvious by noting that if you want a function that behaves as you describe, it is pretty easy to write one using the existing clojure.java.io/resource. Please, pretty please, do not take this statement as a dismissal of your question. It is not intended that way. Andy On Wed, Jun 3, 2015 at 12:48 PM, Elric Erkose <elric.erk...@gmail.com> wrote: > The doc string for clojure.java.io/resource states that it returns a URL. > When an invalid file is passed as the only parameter, it returns nil. > Shouldn't we expect an Exception? > > user=> (clojure.java.io/resource "no-such-file") > nil > > -- > 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 > --- > You received this message because you are subscribed to the Google Groups > "Clojure" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to clojure+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. > -- 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 --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.