Re: Jython Interoperability problem

2010-11-20 Thread Alex Osborne
Dilvan writes: > Do you know how can I "bootstrap" Clojure before using any Clojure > specific data structure (from Java or Jython)? It seems to be fine if you put it on the Java system classpath instead of python.path: $ jython -J-cp clojure-1.2.0.jar Jython 2.5.1 (Release_2_5_1:6813, Sep 26 2

Re: bimaps in clojure

2010-11-20 Thread David Nolen
On Tue, Nov 16, 2010 at 4:06 AM, Christophe Grand wrote: > You can implement your own, prettu easily with deftype. > However it can be tedious to track every methods, so we need a repl helper > function to scaffold the code for us. > > (defn scaffold [iface] > (doseq [[iface methods] (->> iface

Re: why does (clojure.repl/source in-ns) not work while (doc in-ns) gives the documentation?

2010-11-20 Thread Alex Osborne
Sunil S Nandihalli writes: > why does (clojure.repl/source in-ns) not work while (doc in-ns) gives > the documentation? in-ns is implemented in Java code. There's no (Clojure) source for it to show you. Another one is load-file. -- You received this message because you are subscribed to the

Re: string interpolation

2010-11-20 Thread Mike K
Check out the << macro from clojure.contrib.strint. http://clojure.github.com/clojure-contrib/strint-api.html -- 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 membe

Re: string interpolation

2010-11-20 Thread Tom Faulhaber
Wow, David, that's a nice little demonstration of cl-format. I hadn't seen that before. But as Mike points out, clojure.contrib.strint/<< is more precisely what the poster is asking for: true ruby-style string interpolation. It has occurred to me to extend cl-format to do real string interpolatio

Re: string interpolation

2010-11-20 Thread Mike K
Check out the << macro from clojure.contrib.strint. http://clojure.github.com/clojure-contrib/strint-api.html -- 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 membe

Re: string interpolation

2010-11-20 Thread Mike K
Check out the << macro from clojure.contrib.strint. http://clojure.github.com/clojure-contrib/strint-api.html -- 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 membe

why does (clojure.repl/source in-ns) not work while (doc in-ns) gives the documentation?

2010-11-20 Thread Sunil S Nandihalli
Hello everybody, why does (clojure.repl/source in-ns) not work while (doc in-ns) gives the documentation? In fact I have seen this happen for a couple of other vars which I am not able to recall. I tried to change in to clojure.core namespace and it still did not work .. I haven't looked at the cl

Re: println from within a thread

2010-11-20 Thread HiHeelHottie
I'm running it from a shell inside emacs and the output appears in that buffer. Thanks! On Nov 20, 6:44 pm, Ulises wrote: > > This is how I'm running the test in the slime-connect buffer: > > How are you running the swank process? I usually run it as lein swank. > Whenever I print inside a spaw

Re: println from within a thread

2010-11-20 Thread Ulises
> This is how I'm running the test in the slime-connect buffer: How are you running the swank process? I usually run it as lein swank. Whenever I print inside a spawned thread I get the output in the console where I started swank. U -- You received this message because you are subscribed to the

Re: string interpolation

2010-11-20 Thread David Sletten
The cool way is to use Tom Faulhaber's cl-format in clojure.pprint: http://clojure.github.com/clojure/#clojure.pprint (use '[clojure.contrib.pprint :only (cl-format)]) (cl-format true "This is a ~A string.~%" 'funky) This is a funky string. I have a mini-tutorial plus links here: http://www.getti

Re: string interpolation

2010-11-20 Thread gaz jones
you could use format or cl-format? http://clojure.github.com/clojure/clojure.core-api.html#clojure.core/format http://clojure.github.com/clojure-contrib/pprint-api.html#clojure.contrib.pprint/cl-format On Sat, Nov 20, 2010 at 5:00 PM, HiHeelHottie wrote: > > I think ruby has nice string interpo

string interpolation

2010-11-20 Thread HiHeelHottie
I think ruby has nice string interpolation. You can put the following in a textfield that a user can modify This is a #{adjective} string. Then, you can take that string, put it in quotes and have ruby evaluate it as a string. What is the clojure way of doing something similar. Presenting som

logging recommendation

2010-11-20 Thread HiHeelHottie
What do you recommend for logging, especially to a set of rolling files? Simply use log4j? -- 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 -

Re: println from within a thread

2010-11-20 Thread HiHeelHottie
M-x slime-redirect-inferior-output returns no inferior lisp process. This is how I'm running the test in the slime-connect buffer: user> (def my-thread (Thread. #(println "inside thread"))) #'user/my-thread user> (.start my-thread) nil user> I was hoping to see inside thread appear in the output

Re: println from within a thread

2010-11-20 Thread HiHeelHottie
I'm using lein swank and doing a slime-connect from within emacs. The repl is in *slime-repl clojure* buffer, but I don't see an *inferior lisp* buffer. Or did you mean that there is some elisp-var tied to the slime buffer. Can you outline how I can find that? I'm also new to emacs. On Nov 20

Re: println from within a thread

2010-11-20 Thread Ken Wesson
With NetBeans, look at the *out* tab (you should have Repl *err* *out* at the bottom of where the repl normally is) for any output you expected, but didn't see, in the repl. -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send e

Re: println from within a thread

2010-11-20 Thread Moritz Ulrich
Are you using slime? If so, take a look at the *inferior lisp* buffer. There is also a elisp-var you can set to redirect the inferior output to the repl. I just don't remember the name ;) On Sat, Nov 20, 2010 at 10:05 PM, HiHeelHottie wrote: > > I'm trying to output a debug string from a thread:

Re: ANN: Clojure Games

2010-11-20 Thread Glen Stampoultzis
On 20 November 2010 02:37, Tim Visher wrote: > Here's something quick I threw together this morning. I like your > logo a lot but I thought it had a little more potential. :) > > Anyway, free for you to use if you feel so inclined. Thanks. > > Since the ghost is bitmaped maybe the pacman shoul

println from within a thread

2010-11-20 Thread HiHeelHottie
I'm trying to output a debug string from a thread: (def my-thread (Thread. #(println "inside thread"))) (.start my-thread) In the repl, I don't see "inside thread" displayed. Am I coding something incorrectly? Any suggestions on how to get debug output from a thread? Thanks. -- You received

clojure-1.3.0-alpha3 and swank-clojure-1.3.0-SNAPSHOT

2010-11-20 Thread Sunil S Nandihalli
Hello everybody, when I try to use clojure-1.3.0-alpha3 along with swank-clojure-1.3.0 I get the following error when I do lein swank. Exception in thread "Thread-2" java.lang.RuntimeException: java.lang.IllegalStateException: Can't dynamically bind non-dynamic var: clojure.core/* at clojure.lang