Re: Fastest way to generate comma-separated list

2010-10-27 Thread Avram
Does this help? user> (use 'clojure.string) nil user> (join "," (range 10)) "0,1,2,3,4,5,6,7,8,9" -Avram On Oct 28, 4:22 am, andrei wrote: > I was seeking `interpose` function, thanks. But it still doesn't work > for strings - they are not wrapped by "\"\. E.g. > > (apply str (interpose ", "

for rich: caffeine?

2010-10-27 Thread Steven Deobald
Rich, I meant to corner you for a minute after your second talk, but you were pretty thoroughly cornered for all of clojure conj. Just curious: Do you subscribe to Linda Rising's suggestion that we could replace our caffeine intake with naps*? Or do you not find it as damaging as booze? -steve

Re: Fastest way to generate comma-separated list

2010-10-27 Thread Stuart Campbell
On 28 October 2010 13:22, andrei wrote: > > I was seeking `interpose` function, thanks. But it still doesn't work > for strings - they are not wrapped by "\"\. E.g. > > (apply str (interpose ", " (list 1 2 3 4 5))) ==> "1, 2, 3, 4, 5" > > and > > (apply str (interpose ", " (list "1" "2" "3" "4"

Re: Fastest way to generate comma-separated list

2010-10-27 Thread andrei
I was seeking `interpose` function, thanks. But it still doesn't work for strings - they are not wrapped by "\"\. E.g. (apply str (interpose ", " (list 1 2 3 4 5))) ==> "1, 2, 3, 4, 5" and (apply str (interpose ", " (list "1" "2" "3" "4" "5"))) ==> "1, 2, 3, 4, 5" The problem is that applying

Re: Odds for tail calls in JVM

2010-10-27 Thread Tim Daly
I use emacs to write Java code for work. I even use fundamental mode because I don't want emacs changing my buffer while I work. I don't find that IDEs add any value to programming and they often get in my way. I guess I must be part amish :-) Tim Daly On 10/27/2010 12:10 PM, MarkH wrote: O

Re: Clojure issue tracking is now on JIRA

2010-10-27 Thread Stuart Halloway
Thanks to Contegix tech support and some RTFM on my part, self sign-on is now enabled for JIRA at http://dev.clojure.org/jira/browse/CLJ. Have at it. Stu > I sure wish somebody would tell me! The only thing I have figured out how to > do with Crowd is create accounts for others. Email me privat

Re: Fastest way to generate comma-separated list

2010-10-27 Thread Christopher Petrilli
I didn't do any timing, but, I would say the idiomatic way: (apply str (interpose ", " some-vector)) Chris On Wed, Oct 27, 2010 at 8:18 PM, andrei wrote: > Hi all, > > I work with a database and need a function, that will convert Clojure > sequence to a string with a comma-separated element

Fastest way to generate comma-separated list

2010-10-27 Thread andrei
Hi all, I work with a database and need a function, that will convert Clojure sequence to a string with a comma-separated elements. E.g., (comma-separated (list 1 2 3 4 5)) ==> "1, 2, 3, 4, 5" It must work with any data type - ints, strings, other lists, etc. E.g. for a list of strings it mu

Re: Clojure 1.3 Alpha 2

2010-10-27 Thread nickikt
I'm not sure about this either, just wait for the videos of the conj then you will get information on this. On 27 Okt., 22:16, ka wrote: > Hi, > > Please explain this! > > > > > code path for using vars is now *much* faster for the common case, and you > > must explicitly ask for :dynamic bindab

Re: Karras update problem

2010-10-27 Thread Wilkes Joiner
You want use $elemMatch to test for items in an array: http://www.mongodb.org/display/DOCS/Advanced+Queries#AdvancedQueries-ValueinanArray In karras that would be: (fetch-one projects (where (element-match :users uu))) That doesn't explain why the first query passed. I can recreate it, but I d

Re: Clojure issue tracking is now on JIRA

2010-10-27 Thread Stuart Halloway
I sure wish somebody would tell me! The only thing I have figured out how to do with Crowd is create accounts for others. Email me privately with your desired account name / email and I will do it. Stu >> Apologies to all whose tickets have gone unloved in the last 48 hours. I >> have been bus

Re: Clojure issue tracking is now on JIRA

2010-10-27 Thread Baishampayan Ghose
> Apologies to all whose tickets have gone unloved in the last 48 hours. I have > been busy moving the ticketing system itself. > > The Old: http://www.assembla.com/spaces/clojure > The New: http://dev.clojure.org/jira/browse/CLJ How do I create an account? Regards, BG -- Baishampayan Ghose b.

Clojure issue tracking is now on JIRA

2010-10-27 Thread Stuart Halloway
Apologies to all whose tickets have gone unloved in the last 48 hours. I have been busy moving the ticketing system itself. The Old: http://www.assembla.com/spaces/clojure The New: http://dev.clojure.org/jira/browse/CLJ Completed so far: * Moved tickets over. * Turned off write access to Assembl

Access to the issue tracker...

2010-10-27 Thread John Szakmeister
I'm not sure what the protocol is for this, but I'd like to attach a patch to one of the issues in Assembla. Unfortunately, it won't let me. Do I have to get added to the project in some way? Or should I just hang out until Jira comes online? BTW, I did send in my CA. Rich should hopefully hav

Re: Installing Clojure CLR

2010-10-27 Thread dmiller
Let me know on the error. Re REPL: run Clojure.Main.exe to start. -David On Oct 27, 2:54 pm, Sean Devlin wrote: > So, I just started running w/ Clojrue CLR.  I'm trying to get 1.2 up > and running.  I followed the instructions here: > > http://github.com/richhickey/clojure-clr/wiki/Getting-star

Re: Clojure 1.3 Alpha 2

2010-10-27 Thread Baishampayan Ghose
> Please explain this! > >> code path for using vars is now *much* faster for the common case, and you >> must explicitly ask for :dynamic bindability Earlier vars were looked up each time they were accessed inside functions because there was no way of telling if it was being dynamically rebound

Re: how to pass lazy seq to function for processing without keeping the head?

2010-10-27 Thread Matt Fowles
rb~ I believe that local variables are nulled after their last usage to prevent exactly this behavior. In fact, you can find code like: Object dummy(Object o, Object dummy) { return o; } call_stuff(dummy(var, var = null)); In the Clojure source to accomplish this. Matt On Wed, Oct 27, 2010 a

Re: Clojure 1.3 Alpha 2

2010-10-27 Thread ka
Hi, Please explain this! > code path for using vars is now *much* faster for the common case, and you > must explicitly ask for :dynamic bindability -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@google

Re: how to pass lazy seq to function for processing without keeping the head?

2010-10-27 Thread rb
On Oct 27, 4:36 pm, Chris Maier wrote: > On Wed, Oct 27, 2010 at 10:18 AM, rb wrote: > > P.s. I still don't understand though why the 'calls' argument to the > > store-calls function is not a held reference to the head of the lazy > > seq... > > I think (and someone please correct me if I'm wro

Installing Clojure CLR

2010-10-27 Thread Sean Devlin
So, I just started running w/ Clojrue CLR. I'm trying to get 1.2 up and running. I followed the instructions here: http://github.com/richhickey/clojure-clr/wiki/Getting-started-binary-distribution And got an error report. Doesn't seem like a show stopper, but I can post it later. Are there in

dynamic namespace generation using clj-record

2010-10-27 Thread takashi
Hello Jimm I've been testing the clojure library clj-record and it is very usefull. But I have a question, I'm a 'noob' on clojure language and I'm wondering if it is possible to write a macro or something to get namespaces generated for every table in my database, for example I inicialize the mod

Karras update problem

2010-10-27 Thread Victor Marzo
I'm trying to update a document that has an user list inside: test.db> (def uu (fetch-one users (where (eq :name "victor" #'test.db/uu test.db> uu {:password "1234", :name "victor", :_id #} test.db> (def pp (insert projects {:name "test" :users [uu]})) #'test.db/pp test.db> pp {:_id #, :users

Re: clojure-contrib 1.3.0-alpha2 deployed to build.clojure.org

2010-10-27 Thread Btsai
Thanks, that's great info to have :) Although I have to confess that I'm still doing only small exploratory projects, so I haven't gotten my feet wet with build systems like maven or lein yet. On Oct 27, 7:21 am, Stuart Sierra wrote: > Yes, to get one big JAR containing all of clojure-contrib, y

Re: Detecting "More than one matching method"

2010-10-27 Thread ataggart
If you (set! *warn-on-reflection* true) you'll see that the first uses reflection while the second doesn't. This is (imo) a bug in the method resolution behavior, namely that the code path for looking up compiled calls is different from reflected calls. I submitted a patch to fix both this diverg

Re: challenge with vectors

2010-10-27 Thread Glen Rubin
awesome dude!!! Thanks for the book recommendation...I'll take a look at those when I can. Right now I am just eager to get my code working ;) On Oct 27, 1:18 pm, Aravindh Johendran wrote: > On Oct 27, 8:24 am, Glen Rubin wrote: > > > wow, i think you just went way over my head.  First off a v

Re: Images in autodoc?

2010-10-27 Thread Eric Schulte
Christopher Petrilli writes: > Interestingly, the Python community does something like this. Usually > there's a very brief explanation of the function/class, a blank line, > then more, and many tools take this into account. Seems like it might > be a good way to split it up. > Similarly, in E

Re: creating a function from a sexp

2010-10-27 Thread Sunil S Nandihalli
actually i am able to find a few examples ... from a google group thread... http://groups.google.com/group/clojure/browse_thread/thread/d710c290b67951a3/b827d46389110f26?lnk=gst&q=clojure+macro+%26env#b827d46389110f26

Re: creating a function from a sexp

2010-10-27 Thread Sunil S Nandihalli
Hi Nicolas, Thanks for you response. This is an experimental work. Knowing that there was clojuratica to link to mathematica .. I was hoping that we can generate the code to solve PDE .. This is an experimental thing .. But been having a lot of trouble in getting the basic stuff setup .. being ab

Re: how to pass lazy seq to function for processing without keeping the head?

2010-10-27 Thread Chris Maier
On Wed, Oct 27, 2010 at 10:18 AM, rb wrote: > P.s. I still don't understand though why the 'calls' argument to the > store-calls function is not a held reference to the head of the lazy > seq... I think (and someone please correct me if I'm wrong) that the head of 'calls' isn't being retained bec

Re: how to pass lazy seq to function for processing without keeping the head?

2010-10-27 Thread rb
Hi everyone, I found the solution and it has nothing to do with my ramblings above. It turns out that when I do (.executeQuery stmt), the MySQL JDBC driver fetches the entire resultset from the server at once. Here is how to make it lazy also on the JDBC side: (let [conn (datasource/connectio

Re: creating a function from a sexp

2010-10-27 Thread nicolas.o...@gmail.com
You need to use both eval and a macro to get then environment. I think &env contains the lexical environment in any macro call now. (I don't know in each form though). So you need to walk the term, looking for free variables, close under free variables by creating a function and then call eval. Th

Re: creating a function from a sexp

2010-10-27 Thread Sunil S Nandihalli
not really the problem is that the s-expression is passed I don't know it ahead of time during compilation .. it is known at run-time... On Wed, Oct 27, 2010 at 6:54 PM, Ulises wrote: > > Is it possible to write such a function? > > Perhaps you're looking for partial? > > user> (def x 10) > #'us

Re: creating a function from a sexp

2010-10-27 Thread Ulises
> Is it possible to write such a function? Perhaps you're looking for partial? user> (def x 10) #'user/x user> (let [y 5] (partial + x y)) # user> ((let [y 5] (partial + x y)) 1) 16 user> U -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to

Re: clojure-contrib 1.3.0-alpha2 deployed to build.clojure.org

2010-10-27 Thread Stuart Sierra
Yes, to get one big JAR containing all of clojure-contrib, you can depend on: groupId: org.clojure.contrib artifactId: standalone version: 1.3.0-alpha2 Or in Leiningen: [org.clojure.contrib/standalone "1.3.0-alpha2"] To get lots of little JARs for each of the contrib libraries, you can

creating a function from a sexp

2010-10-27 Thread Sunil S Nandihalli
Hello everybody, I would like to create a function from an arbitrary s-expression for example if I have something like (def x 10) (let [y 20] (create-fn-from-sexp '(+ x y z))) I would like create-fn-from-sexp to return a function which is a function of the third argument z .. since both x and

Re: Images in autodoc?

2010-10-27 Thread Andrew Gwozdziewycz
So, I started working on docup[1], which currently is just for fun, but my intentions are to find some subset of rules for what we've discussed in this thread that would be appropriate for autodoc's markup. It doesn't currently support much at all, but to eliminate gobbledegook, there's no nesting

Re: challenge with vectors

2010-10-27 Thread Glen Rubin
wow, i think you just went way over my head. First off a very naive question: I thought all clojure programming was functional, as long as you are not using refs, agents, or other mutable values etc...?? On Oct 27, 12:26 am, Aravindh Johendran wrote: > What kind of an answer are you looking

Re: using a macro like a function

2010-10-27 Thread Ken Wesson
On Wed, Oct 27, 2010 at 7:53 AM, Sunil S Nandihalli < sunil.nandiha...@gmail.com> wrote: > Hello everybody, > > I would like to do something like the following .. > > (->> "create" clojure.repl/apropos (map doc)) > > but I can't do it since doc is a macro and not a function.. how would one > wrap

Re: using a macro like a function

2010-10-27 Thread Sunil S Nandihalli
Thanks Meikel.. so it looks like doc was written as a macro since they wanted to avoid people having to quote the symbol when called from the repl.. or is there any other reason also? Sunil. On Wed, Oct 27, 2010 at 5:28 PM, Meikel Brandmeyer wrote: > Hi, > > On 27 Okt., 13:53, Sunil S Nandihal

Re: using a macro like a function

2010-10-27 Thread Meikel Brandmeyer
Hi, On 27 Okt., 13:53, Sunil S Nandihalli wrote: > I would like to do something like the following .. > >  (->> "create" clojure.repl/apropos (map doc)) > > but I can't do it since doc is a macro and not a function.. how would one > wrap doc with a function so that it can be used in the above ex

using a macro like a function

2010-10-27 Thread Sunil S Nandihalli
Hello everybody, I would like to do something like the following .. (->> "create" clojure.repl/apropos (map doc)) but I can't do it since doc is a macro and not a function.. how would one wrap doc with a function so that it can be used in the above example. Thanks Sunil. -- You received this

Re: bug or misunderstanding intern?

2010-10-27 Thread Meikel Brandmeyer
Hi again, and additionally (explaining the error message): "'.' has special meaning - it can be used one or more times in the middle of a symbol to designate a fully-qualified class name, e.g. java.util.BitSet, or in namespace names." Sincerely Meikel -- You received this message because you ar

Re: bug or misunderstanding intern?

2010-10-27 Thread Meikel Brandmeyer
Hi, from http://clojure.org/reader: "Symbols begin with a non-numeric character and can contain alphanumeric characters and *, +, !, -, _, and ?." (and ' with 1.3 I guess) So not really surprising behaviour. Sincerely Meikel -- You received this message because you are subscribed to the Google

bug or misunderstanding intern?

2010-10-27 Thread bOR_
Hi all. This got me puzzled. Intern has trouble with symbols containing periods? user> *clojure- version* {:major 1, :minor 2, :incremental 0, :qualifier ""} user> (intern *ns* (symbol "orig-0.5") 3) #'user/ orig-0.5 user> orig-0.5 ; Evaluation aborted. [Thrown class java.lang.ClassNotFound

Re: how to pass lazy seq to function for processing without keeping the head?

2010-10-27 Thread rb
Oops, I made an error in the last paragraph: > It also occurred to me that I should think in records instead of __seqs__ > and write store-calls as a kind of filter (store-call), but then I'd > lose the ability to compare the dates of the previous/current records > or would have to resort to some

how to pass lazy seq to function for processing without keeping the head?

2010-10-27 Thread rb
I have a big MySQL database containing telephone call detail records. The database is on a remote server and it's a bit slow to access. I want to migrate the data to local SQLite databases on my machine for further processing. I want to store each month's records in separate files, located under ~

Re: I eat parentheses for breakfast

2010-10-27 Thread Baishampayan Ghose
> Some of you might enjoy the music video for the new Land of Lisp book: > http://www.youtube.com/watch?v=HM1Zb3xmvMc&feature=player_embedded Wow. Kick ass. "Every programmer should learn a little Lisp" -- hell yeah! Regards, BG -- Baishampayan Ghose b.ghose at gmail.com -- You received this

I eat parentheses for breakfast

2010-10-27 Thread David Sletten
Some of you might enjoy the music video for the new Land of Lisp book: http://www.youtube.com/watch?v=HM1Zb3xmvMc&feature=player_embedded Have all good days, David Sletten -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send

I eat parentheses for breakfast

2010-10-27 Thread David Sletten
Some of you might enjoy the music video for the new Land of Lisp book: http://www.youtube.com/watch?v=HM1Zb3xmvMc&feature=player_embedded Have all good days, David Sletten -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send

Re: clojure-contrib 1.3.0-alpha2 deployed to build.clojure.org

2010-10-27 Thread Jacek Laskowski
On Wed, Oct 27, 2010 at 8:59 AM, Btsai wrote: > Ah, excellent.  Thank you :) No problem. To be honest, I had not known it either until you asked, but since I needed it too I dug deeper :-) Thank you. Jacek -- Jacek Laskowski Notatnik Projektanta Java EE - http://jaceklaskowski.pl -- You rece

Re: clojure-contrib 1.3.0-alpha2 deployed to build.clojure.org

2010-10-27 Thread Btsai
Ah, excellent. Thank you :) On Oct 27, 12:25 am, Jacek Laskowski wrote: > On Wed, Oct 27, 2010 at 4:37 AM, Btsai wrote: > > Is there still a complete jar somewhere that has all the modules?  If > > so, I can't seem to find it.  Or is that a thing of the past now? > > s/complete/standalone :-) >