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 Alan Malloy
In this case the var is simply acting as a mutable pointer, so that when the implementation is changed the route reflects the new value. Here's a simple example of that behavior in action, divorced from webservers and the like: ;; caller accepts a function and returns a new one that forwards to it

Re: clojurescript why: (def ... is failing whereas (let ... succeeds

2012-02-11 Thread Gijs S.
Hi, The solution is to explicitly require goog.fx.DragDrop in the :require in the ns declaration: [goog.fx.DragDrop :as dd-import] This adds this line in the generated js output: goog.require('goog.fx.DragDrop'); This line is required because DragDrop lives in its own file within the Google Clo

Re: clojurescript why: (def ... is failing whereas (let ... succeeds

2012-02-11 Thread Kevin Lynagh
How do you know the let is working? Is the run-draganddrop function being called by something outside of that source file? It'll have the same problem as the def, you just won't see it when you load the file because the function isn't called. I looked into goog.jar and goog.fx.DragDrop is an entir

Re: No show?

2012-02-11 Thread Ken Restivo
On Thu, Feb 09, 2012 at 11:41:31AM -0400, Stuart Halloway wrote: > > clojure.reflect/reflect gets you the same information as a big 'ole data > > structure. You can pprint it for readability. > > > > The only thing that was not ported was the formatted text output, which > > would be easy enough

clojure-opennlp

2012-02-11 Thread Jim foo.bar
HI everyone, I was just wondering whether anyone has used the clojure-opennlp wrapper for multi-word named entity recognition (NER)? I am using it to train a drug finder from my private corpus and even though i get correct behavior when using the command line tool of apache openNLP when trying to

Re: Clojure CDT up, cont, down, local-names throws arity errors after hitting breakpoint

2012-02-11 Thread George Jahad
SeanC is referring to is the fact that swank-cdt now works seamlessly with clojure-jack-in, thanks to the efforts @tavisrudd and the indefatigable technomancy. On Feb 9, 9:18 am, Sean Corfield wrote: > On Wed, Feb 8, 2012 at 10:16 PM, George Jahad > > wrote: > > If you use Emacs and Swank-cloju

Re: Symbols, vars, and namespaces

2012-02-11 Thread Sean Bowman
Using your example--very helpful, BTW--I simplified it a bit more: user=> (def x 10) #'user/x user=> (def y #'x) #'user/y user=> y #'user/x user=> @y 10 user=> (def x (fn [me] (println "Welcome" me))) #'user/x user=> (y "hello") Welcome hello nil user=> (@y "yikes") Welcome yikes nil What I come

Re: novice question, performance surprise

2012-02-11 Thread Jules
There is a standard library function for this: separate. For example (separate even? coll) returns two results in a vector: (filter even? coll) and (filter odd? coll). On Feb 10, 9:05 pm, Manuel Paccagnella wrote: > On 02/09/2012 11:40 PM, Steve Miner wrote: > > > filter is lazy so it won't actua

Re: novice question, performance surprise

2012-02-11 Thread Cedric Greevey
On Sat, Feb 11, 2012 at 4:44 PM, Jules wrote: > There is a standard library function for this: separate. Not according to clooj's tab completion, http://clojure.org/cheatsheet, or http://clojure.github.com/clojure/ -- none of those match any library function to the substring "sep", and the third

Re: novice question, performance surprise

2012-02-11 Thread Alan Malloy
(def separate (juxt filter remove)). It's in old-contrib, I think in clojure.contrib.seq-utils or something. Obviously not recommended for use in new programs. On Feb 11, 3:49 pm, Cedric Greevey wrote: > On Sat, Feb 11, 2012 at 4:44 PM, Jules wrote: > > There is a standard library function for

Re: novice question, performance surprise

2012-02-11 Thread Cedric Greevey
On Sat, Feb 11, 2012 at 7:05 PM, Alan Malloy wrote: > (def separate (juxt filter remove)). Cute, but that makes giving it a docstring, pre- and postconditions, and similar things a pain. > It's in old-contrib, I think in clojure.contrib.seq-utils or > something. Obviously not recommended for use

Re: novice question, performance surprise

2012-02-11 Thread Sean Corfield
On Sat, Feb 11, 2012 at 4:22 PM, Cedric Greevey wrote: > Cute, but that makes giving it a docstring, pre- and postconditions, > and similar things a pain. You can get a doctoring and even arglists (for code assist in your IDE and for clojure.repl/doc): (def ^{:arglists '([pred coll]) } separate

Re: novice question, performance surprise

2012-02-11 Thread Cedric Greevey
On Sat, Feb 11, 2012 at 8:46 PM, Sean Corfield wrote: > On Sat, Feb 11, 2012 at 4:22 PM, Cedric Greevey wrote: >> Cute, but that makes giving it a docstring, pre- and postconditions, >> and similar things a pain. > > You can get a doctoring and even arglists (for code assist in your IDE > and for

Re: No show?

2012-02-11 Thread Michał Marczyk
On 11 February 2012 10:35, Ken Restivo wrote: > => (clojure.pprint/print-table (clojure.reflect/reflect Math)) > ClassCastException clojure.lang.Keyword cannot be cast to java.util.Map$Entry >  clojure.lang.APersistentMap$KeySeq.first (APersistentMap.java:132) print-table expects a sequence of m

Re: novice question, performance surprise

2012-02-11 Thread Sean Corfield
On Sat, Feb 11, 2012 at 5:46 PM, Sean Corfield wrote: > You can get a doctoring D**n you autocorrect! :) You can get a docstring... -- Sean A Corfield -- (904) 302-SEAN An Architect's View -- http://corfield.org/ World Singles, LLC. -- http://worldsingles.com/ "Perfection is the enemy of the g

Re: No show?

2012-02-11 Thread Sean Corfield
On Sat, Feb 11, 2012 at 6:30 PM, Michał Marczyk wrote: > print-table expects a sequence of maps, e.g. > > (print-table (:members (reflect Math))) Wow! I had no idea how useful that could be... Learn something new every day! (and, lately, that's a new Clojure function every day...) -- Sean A Corf

Hierarchical logs

2012-02-11 Thread jweiss
I've been working on a tracing library, that works much like clojure.contrib.trace (based on it, actually). One sticky problem I've found is, hierarchical logs are really crappy to try to stream to a file. You can't just keep writing to the end of the file - new data needs to be inserted before