Re: Is there a performance hit when dynamically require-ing namespaces

2013-01-29 Thread Sean Bowman
, 2013 1:13:29 AM UTC-7, Mikera wrote: On Wednesday, 23 January 2013 03:47:56 UTC+8, Sean Bowman wrote: I'm trying to implement a simple system to load certain namespaces into my application that are configurable at runtime, via a plugins text file that lists the namespaces we want to load

Is there a performance hit when dynamically require-ing namespaces

2013-01-22 Thread Sean Bowman
I'm trying to implement a simple system to load certain namespaces into my application that are configurable at runtime, via a plugins text file that lists the namespaces we want to load. I have some code that loads this file, then line by line calls require dynamically, like so: (doseq

Symbols, vars, and namespaces

2012-02-11 Thread Sean Bowman
I've been working with Compojure and Ring lately to build an app server, and I've gotten my brain stuck trying to figure out wrap- reload. It seems like I have to turn my routes into vars to get wrap- reload to work, but I don't understand why, and I suppose I don't really understand the when or

Re: Symbols, vars, and namespaces

2012-02-11 Thread Sean Bowman
passed-value (caller callee)) repl-1= (def passed-var (caller #'callee)) ;; if we redefine callee, only the pointer-version sees the new value repl-1= (defn callee [x] (* 2 x)) repl-1= (passed-value 4) 4 repl-1= (passed-var 4) 8 On Feb 11, 2:11 am, Sean Bowman pico...@gmail.com wrote

Re: Creating a var, functions from a macro

2011-11-09 Thread Sean Bowman
Apparently the missing bit is I need to escape the symbol calls, e.g. (defn ~(symbol index) ... Is this correct? -- 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

Reference a function dynamically in a macro?

2011-10-05 Thread Sean Bowman
I like to build DSLs when I code, so that at a high level, much of the logic is readable and consistent. I'm trying to create a macro that will verify the uniqueness of a record based on various fields in the record. For example, if I have a function that looks up a record by its name:

Testing clojure.contrib.condition

2011-04-29 Thread Sean Bowman
Is there any way to test code that uses clojure.contrib.condition to raise meaningful error messages? I've been struggling to write some sort of assert-expr, based on thrown-with-condition?, to check for these errors, but it's obviously way beyond my macro foo at this point. Thoughts, or should