Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Programmatically loading clojure libraries

Tags:

clojure

I'm trying to programmatically load some clojure libraries to make a simple auto-test program.

What I end up sending to require is this

(require :reload '("peg" "test.peg-test"))

How do I transform that list into something useful, or am I totally barking up the wrong tree?

like image 334
Ball Avatar asked Mar 25 '26 02:03

Ball


1 Answers

Are you aware that there are testing libraries available in clojure.contrib?

You may find it easier to do this if you orient your thinking around namespaces. If you look at Bill Clementson's user.clj you will find a useful function for clearing out the user namespace and reloading the base namespaces in preparation for bringing in your testing namespaces.

In any case, using namespaces your code would work like this:

(ns testing-peg
  (:require [peg test.peg-test])
like image 110
Pinochle Avatar answered Mar 26 '26 16:03

Pinochle



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!