At first glance, it seems like you probably want http://clojuredocs.org/clojure.core/ns-resolve
On Tuesday, February 6, 2018 at 2:38:06 PM UTC-6, Randy J. Ray wrote: > > First, some brief background/context: I've been playing around with > Clojure for a while, mostly just doing Project Euler problems. I'm taking > the "Algorithms Specialization" from Coursera, and decided to do all the > programming assignments in Clojure as a way of tackling some larger, deeper > problems. But overall, my understanding of Clojure overall is still fairly > mild. > > What I want to do, is write some scaffolding around the weekly programming > tasks that automates the execution of the user-contributed test-cases. I'd > like to be able to add a new form to be tested in a single place (e.g., the > project's core.clj file) and have a re-compile be able to find out that the > new namespace is now in place, locate the test-files, and execute the form > with each test-input. > > I'm pretty sure I can handle locating the test files as long as they're on > the file system (I'm looking at the fs package for walking around the file > system). But is there a way to (semi-)transparently handle the data files > being resources within the JAR, as well? > > Also, how would I take a pair of strings (namespace and form-name, > respectively) and turn that into the callable function? For example, if my > set of desired test-forms were a simple nested list: > > (("algorithms.class1.week1.karatsuba-mult" "karatsuba-mult") > ("algorithms.class1.week2.count-inv" "count-inv") > ...) > > (Currently, the last ns element is the same as the function-name to call, > but some of these will have multiple implementations that I'll want to time > for comparison, so this won't always be the case.) > > So, for the first "test", I want to turn > ("algorithms.class1.week1.karatsuba-mult" > "karatsuba-mult") into a binding that will call > algorithms.class1.week1.karatsuba-mult/karatsuba-mult when used as a > function. I know how to do this in other languages (my strongest is Perl, > but don't hold that against me!), just not in Clojure. > > The interface of all tests is the same-- they take the name of the input > file as a single input, and return a string as a result (I have > result-files in the same dirs as the input files, for comparison. I just > need to be able to iterate over the forms to test, and the test-cases for > each form. > > (I say "I just need", but I'll probably be back with more questions after > I get these answered...) > > Randy > -- > Randy J. Ray - randy...@gmail.com <javascript:> - twitter.com/rjray > Silicon Valley Scale Modelers: http://www.svsm.org > San Jose, CA > -- 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.