Re: RC 16: Last chance to test against Clojure 1.5 before it ships
Stuart Halloway stuart.hallo...@gmail.com writes: If you care about Clojure 1.5 compatibility for your codebase, please test it against RC 16 as soon as possible. My code using tons of protocols, some deftypes, and the new reducers here and there still compiles, runs, and all tests pass. That said, I've always used the most bleeding-edge 1.5 alphas, betas, RCs, so that actually means only that there's no breakage to features I use in a very recent commit while there might still be compatibitily issues when coming from 1.4. Bye, Tassilo -- -- 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 - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
:use an entire namespace full of protocols or stick with :require?
I know that using a bare :use in the ns macro is generally frowned upon as it provides no hints about what is actually being used... However, I 've got 2 namespaces 'abstractions.clj' and 'concretions.clj'...concretions.clj will eventually use all the protocols defined in abstractions.clj...at the moment it doesn't but as I work through it I want to provide concrete records for *all* the protocols... Should I just go and :use the entire thing or should I stick with :require and keep typing 'pro/XXX' a million times? That specific namespace is very central to my work... Jim -- -- 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 - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Help on implementing a simple java (openNLP) EventStream interface
Hi All, I want to turn a clojure sequence into an 'EventStream' java interface in clojure (see http://opennlp.apache.org/documentation/1.5.2-incubating/apidocs/opennlp-maxent/index.html). Basically this is an object that implements next() and hasNext() methods. I know this can be done with proxy: (proxy [EventStream] [] (hasNext [] ...) (next [] (Event. ...) ...)) What I am not sure about is how to deal with state. More precisely, the object returned by the above call to proxy obviously must somehow keep a pointer to the current position in the input sequence and increment the index after a call to next() etc. Any ideas on how to best do something like this? Thanks a lot! Joachim. -- -- 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 - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: Belgium Clojure Meetup
Hi there, I might join if the event takes place in Ghent. grtz Op maandag 11 februari 2013 23:11:36 UTC+1 schreef Thomas Goossens het volgende: *With some fellow Belgian clojurians (Frederik De Bleserhttp://www.enigmeta.com/ Wim De Clerq) I’m planning to organise a Clojure meetup in Belgium while being inspired by the Amsterdam clojurians. So far no decisions have been made so don’t expect to find information like the planning, a date and the location in this post yet. This message is merely a quick check whether people are interested. If you are interested in a meetup, please let us know. Why a meetup? It is always interesting to meet people with common interests. Wanting to share opinions, insights and projects is a really valuable virtue. Sharing ideas gets more fun and easy if you can talk to each other in person. It's the interaction that makes the transfer rate of knowledge increase rapidly. Doing this in group only makes this process more pleasurable and interesting. What will it be about? There are a lot of options of what the meetup could be about. So this part of the meetup is still in brainstorm-phase. For instance, we could have some sessions on some different clojure related topics / projects. The topics might be very diverse: going from big data, music/visuals, core.logic, to meta-stuff and projects you worked on. A quick idea: One might give a session on heroku, where we build a website for this meetup group and deploy it to heroku. (Or something alike) If you have any interesting ideas about what we could do as well, don’t hesitate to let us know. Also if you are interested in giving a session you can let us know as well. Where and when? At this early stage of setup, it is really hard to tell. But belgium is not that large so a finding a suitable location shouldn’t be that hard. Nevertheless, I would like to ask anyone interested in the meetup to leave a comment to let us know what city you live in, what time of the day you would prefer and what locations you prefer. What now? Everything is still a bit vague at the moment but as soon as decisions are going to be made, I’ll be sure to post updates. We really hope that we’ll be able to get it started so any advice is really appreciated (also from non belgian people!) You can also follow the latest developments by following @belgiumclj on twitter. * -- -- 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 - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: :use an entire namespace full of protocols or stick with :require?
I don't like :use because I can't tell where things come from. require :refer [...] is good is you don't want the prefix. On Friday, 15 February 2013 00:26:50 UTC+11, Jim foo.bar wrote: I know that using a bare :use in the ns macro is generally frowned upon as it provides no hints about what is actually being used... However, I 've got 2 namespaces 'abstractions.clj' and 'concretions.clj'...concretions.clj will eventually use all the protocols defined in abstractions.clj...at the moment it doesn't but as I work through it I want to provide concrete records for *all* the protocols... Should I just go and :use the entire thing or should I stick with :require and keep typing 'pro/XXX' a million times? That specific namespace is very central to my work... Jim -- -- 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 - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: Help on implementing a simple java (openNLP) EventStream interface
How about having your methods access an atom provided in a closure like it's done here: http://kotka.de/blog/2010/03/proxy_gen-class_little_brother.html U On 14 February 2013 13:58, Joachim De Beule joachim.de.be...@gmail.comwrote: Hi All, I want to turn a clojure sequence into an 'EventStream' java interface in clojure (see http://opennlp.apache.org/documentation/1.5.2-incubating/apidocs/opennlp-maxent/index.html). Basically this is an object that implements next() and hasNext() methods. I know this can be done with proxy: (proxy [EventStream] [] (hasNext [] ...) (next [] (Event. ...) ...)) What I am not sure about is how to deal with state. More precisely, the object returned by the above call to proxy obviously must somehow keep a pointer to the current position in the input sequence and increment the index after a call to next() etc. Any ideas on how to best do something like this? Thanks a lot! Joachim. -- -- 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 - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- -- 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 - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: Help on implementing a simple java (openNLP) EventStream interface
Thanks! So you mean like this (assuming some function elt-event): (defn seq-event-stream [input-seq] (let [remaining (atom input-seq)] (proxy [EventStream] [] (next [] (let [current (first @remaining)] (swap! remaining rest) (elt-event current))) (hasNext [] (not (empty? @remaining)) 2013/2/14 Ulises ulises.cerv...@gmail.com How about having your methods access an atom provided in a closure like it's done here: http://kotka.de/blog/2010/03/proxy_gen-class_little_brother.html U On 14 February 2013 13:58, Joachim De Beule joachim.de.be...@gmail.comwrote: Hi All, I want to turn a clojure sequence into an 'EventStream' java interface in clojure (see http://opennlp.apache.org/documentation/1.5.2-incubating/apidocs/opennlp-maxent/index.html). Basically this is an object that implements next() and hasNext() methods. I know this can be done with proxy: (proxy [EventStream] [] (hasNext [] ...) (next [] (Event. ...) ...)) What I am not sure about is how to deal with state. More precisely, the object returned by the above call to proxy obviously must somehow keep a pointer to the current position in the input sequence and increment the index after a call to next() etc. Any ideas on how to best do something like this? Thanks a lot! Joachim. -- -- 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 - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- -- 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 - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- -- 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 - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: Help on implementing a simple java (openNLP) EventStream interface
Without testing or anything that looks reasonable enough. I'm sure that there are plenty caveats around infinite seqs, etc. though. On 14 February 2013 14:22, Joachim De Beule joachim.de.be...@gmail.comwrote: Thanks! So you mean like this (assuming some function elt-event): (defn seq-event-stream [input-seq] (let [remaining (atom input-seq)] (proxy [EventStream] [] (next [] (let [current (first @remaining)] (swap! remaining rest) (elt-event current))) (hasNext [] (not (empty? @remaining)) 2013/2/14 Ulises ulises.cerv...@gmail.com How about having your methods access an atom provided in a closure like it's done here: http://kotka.de/blog/2010/03/proxy_gen-class_little_brother.html U On 14 February 2013 13:58, Joachim De Beule joachim.de.be...@gmail.comwrote: Hi All, I want to turn a clojure sequence into an 'EventStream' java interface in clojure (see http://opennlp.apache.org/documentation/1.5.2-incubating/apidocs/opennlp-maxent/index.html). Basically this is an object that implements next() and hasNext() methods. I know this can be done with proxy: (proxy [EventStream] [] (hasNext [] ...) (next [] (Event. ...) ...)) What I am not sure about is how to deal with state. More precisely, the object returned by the above call to proxy obviously must somehow keep a pointer to the current position in the input sequence and increment the index after a call to next() etc. Any ideas on how to best do something like this? Thanks a lot! Joachim. -- -- 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 - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- -- 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 - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- -- 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 - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- -- 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 - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
How to set the value of a static variable in a java factory class from clojure?
Hi All, I know how to call static java methods such as the ones defined here: http://grepcode.com/file/repo1.maven.org/maven2/org.apache.opennlp/opennlp-maxent/3.0.2-incubating/opennlp/maxent/GIS.java, e.g. trainModel(...). However, before I call this method I want to change the value of the variable SMOOTHING_OBSERVATION (see above link section #SMOOTHING_OBSERVATION). My problem is that I don't know how to do that from clojure? Thanks a lot! Joachim -- -- 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 - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: How to set the value of a static variable in a java factory class from clojure?
Haven't looked at the code, but `set!` should work. ~BG Sent from phone. Please excuse brevity. On 14 Feb 2013 21:30, Joachim De Beule joachim.de.be...@gmail.com wrote: Hi All, I know how to call static java methods such as the ones defined here: http://grepcode.com/file/repo1.maven.org/maven2/org.apache.opennlp/opennlp-maxent/3.0.2-incubating/opennlp/maxent/GIS.java, e.g. trainModel(...). However, before I call this method I want to change the value of the variable SMOOTHING_OBSERVATION (see above link section #SMOOTHING_OBSERVATION). My problem is that I don't know how to do that from clojure? Thanks a lot! Joachim -- -- 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 - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- -- 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 - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: how to automatically and idiomatically add newlines to clojure code in emacs
@Feng It doesn't clean up the way John is looking to clean some code like this: (defun func1 [a b c d] (func5 (let [f (func3 c)] (func2 a b f)) (let [e 5] (func4 c d e On Tue, Feb 12, 2013 at 9:11 AM, Feng Shen shen...@gmail.com wrote: (defun indent-buffer () (interactive) (indent-region (point-min) (point-max))) (defun cleanup-buffer () (interactive) (indent-buffer) (untabify-buffer) (delete-trailing-whitespace)) ;; bind to other key if you like(global-set-key (kbd M-q) 'cleanup-buffer) cleanup-buffer is very fast, I hit it all the time. On Tuesday, February 12, 2013 10:28:43 AM UTC+8, John Fries wrote: Clojure Users, I'm relatively new to clojure and wanted to get some workflow advice. I often find myself staring at something like this: (defun func1 [a b c d] (func5 (let [f (func3 c)] (func2 a b f)) (let [e 5] (func4 c d e and wishing for a function to automatically and idiomatically break it up into multiple lines and indent it: (defun func1 [a b c d] (func5 (let [f (func3 c)] (func2 a b f)) (let [e 5] (func4 c d e I find the latter form more readable, but inserting the newlines by hand is getting repetitive (also, I am not always confident in my choice of idiomatic breakpoints). Once I insert the newlines, I can trigger auto-indentation by hitting M-q (which on my system is mapped to paredit-reindent-defun) or by highlighting the region and hitting M-C-\ (which on my system is indent-region). My question(s) is: How are people currently handling this situation? Is it part of most people's clojure/emacs workflow to 1) Just insert the newlines by hand? (perhaps I'm the only one finding this repetitive) 2) Do people have some accepted pretty printing function they are using within emacs? 3) Is there some larger issue I'm not seeing that maybe makes this whole idea irrelevant? I've seen this document: http://richhickey.github.com/**clojure/doc/clojure/pprint/** PrettyPrinting.htmlhttp://richhickey.github.com/clojure/doc/clojure/pprint/PrettyPrinting.html But I haven't found any guide to using that function *within emacs*. If this is not a common thing to do, then why is it not common? Thanks, John caveat: My init.el is an amalgam of ideas from ESK, prelude and emacs live, so it could be the case that this functionality is provided out of the box, if only I were configured properly. If people have some way of doing this in their emacs environment, a clue as to the kit or configuration you are using would be very much appreciated. -- -- 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 - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- Regards, Mayank. -- -- 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 - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: how to automatically and idiomatically add newlines to clojure code in emacs
C-u M-x indent-pp-sexp On Thu, Feb 14, 2013 at 6:06 PM, Mayank Jain firesof...@gmail.com wrote: @Feng It doesn't clean up the way John is looking to clean some code like this: (defun func1 [a b c d] (func5 (let [f (func3 c)] (func2 a b f)) (let [e 5] (func4 c d e On Tue, Feb 12, 2013 at 9:11 AM, Feng Shen shen...@gmail.com wrote: (defun indent-buffer () (interactive) (indent-region (point-min) (point-max))) (defun cleanup-buffer () (interactive) (indent-buffer) (untabify-buffer) (delete-trailing-whitespace)) ;; bind to other key if you like (global-set-key (kbd M-q) 'cleanup-buffer) cleanup-buffer is very fast, I hit it all the time. On Tuesday, February 12, 2013 10:28:43 AM UTC+8, John Fries wrote: Clojure Users, I'm relatively new to clojure and wanted to get some workflow advice. I often find myself staring at something like this: (defun func1 [a b c d] (func5 (let [f (func3 c)] (func2 a b f)) (let [e 5] (func4 c d e and wishing for a function to automatically and idiomatically break it up into multiple lines and indent it: (defun func1 [a b c d] (func5 (let [f (func3 c)] (func2 a b f)) (let [e 5] (func4 c d e I find the latter form more readable, but inserting the newlines by hand is getting repetitive (also, I am not always confident in my choice of idiomatic breakpoints). Once I insert the newlines, I can trigger auto-indentation by hitting M-q (which on my system is mapped to paredit-reindent-defun) or by highlighting the region and hitting M-C-\ (which on my system is indent-region). My question(s) is: How are people currently handling this situation? Is it part of most people's clojure/emacs workflow to 1) Just insert the newlines by hand? (perhaps I'm the only one finding this repetitive) 2) Do people have some accepted pretty printing function they are using within emacs? 3) Is there some larger issue I'm not seeing that maybe makes this whole idea irrelevant? I've seen this document: http://richhickey.github.com/clojure/doc/clojure/pprint/PrettyPrinting.html But I haven't found any guide to using that function *within emacs*. If this is not a common thing to do, then why is it not common? Thanks, John caveat: My init.el is an amalgam of ideas from ESK, prelude and emacs live, so it could be the case that this functionality is provided out of the box, if only I were configured properly. If people have some way of doing this in their emacs environment, a clue as to the kit or configuration you are using would be very much appreciated. -- -- 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 - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- Regards, Mayank. -- -- 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 - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- -- 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 - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Google Summer of Code 2013
Hello, all, It's official: Google Summer of Code 2013 is on. Last year, Clojure was able to get four students who worked on projects like Typed Clojure, Clojure on Android, Clojure and Lua, and Overtone, and I'd love to see Clojure be a mentoring organisation again this year. I have created a GSoC 2013 page on the Clojure community wiki http://dev.clojure.org/display/community/Google+Summer+of+Code+2013. Here you will be able to find the latest information about what's going on with Clojure's GSoC 2013 effort and how to get involved. Here's some ways you can help: * Let people in your local user groups or university know about Clojure and GSoC. * If you're going to Clojure/West, attend the GSoC unsession. For students * Start researching project ideas and get involved with the relevant communities to find mentors. For developers: Does your open source project have a backlog of features to implement? GSoC is a great way to draw new contributors to your project. * Post it to the project idea page and become a mentor. * Let people know about GSoC on your project mailing list. I'd like to thank everyone in advance for helping with our GSoC 2013 project. Sincerely, Daniel -- -- 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 - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
proper way to override clojure.core functions without getting warning/error
Let's say I want to override clojure.core/sorted? (ns random.learning.clojure.overridex (:refer-clojure :exclude [sorted?])) (defn sorted? [coll] {:pre [ (coll? coll)]} (clojure.core/sorted? coll)) I'm using Eclipse+counterclockwise, so loading this namespace(Ctrl+Alt+L) first time gives no warnings/errors, loading it second time, one warning and no errors, and subsequent times it's loaded there are no errors/warnings. the warning is this: WARNING: sorted? already refers to: #'clojure.core/sorted? in namespace: random.learning.clojure.overridex, being replaced by: #'random.learning.clojure.overridex/sorted? I could ignore the warning, no problem, but then I try to use this namespace in another namespace: (ns random.learning.clojure.usetheoverridexns (:use random.learning.clojure.overridex) ) (and (= false (sorted? '(1 2))) (= true (sorted? (sorted-set 1 2 When I load this namespace first time I get: WARNING: sorted? already refers to: #'clojure.core/sorted? in namespace: random.learning.clojure.usetheoverridexns, being replaced by: #'random.learning.clojure.overridex/sorted? true I could ignore that, but then I load it again(and any subsequent time) and this is an error (not just a warning that can be ignored): IllegalStateException sorted? already refers to: #'random.learning.clojure.overridex/sorted? in namespace: random.learning.clojure.usetheoverridexns clojure.lang.Namespace.warnOrFailOnReplace (Namespace.java:88) Notice there's no true aka return value. When I actually close the REPL, and Ctrl+Alt+L load only this latter namespace I get this: ;; Clojure 1.5.0-RC16 ;; Switching to random.learning.clojure.usetheoverridexns namespace WARNING: sorted? already refers to: #'clojure.core/sorted? in namespace: random.learning.clojure.usetheoverridexns, being replaced by: #'random.learning.clojure.overridex/sorted? true *IllegalStateException sorted? already refers to: #'random.learning.clojure.overridex/sorted? in namespace: random.learning.clojure.usetheoverridexns clojure.lang.Namespace.warnOrFailOnReplace (Namespace.java:88)* and any subsequent loads, show only the part in bold. While this may be some ccw issue, I am probably also doing something wrong that I could be doing better. What is the way to do this? especially in the latter namespace which is using the namespace which has overridden the sorted? I do want the overridden sorted? to actually be available and override the clojure.core/sorted? in any namespaces that are using the overridex namespace. Thank you. -- Please correct me if I'm wrong or incomplete, even if you think I'll subconsciously hate it. -- -- 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 - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: Google Summer of Code 2013
WOOT! I'm of course more than happy to mentor any projects around ClojureScript, core.logic, and core.match. David On Thu, Feb 14, 2013 at 1:03 PM, Daniel Solano Gómez cloj...@sattvik.comwrote: Hello, all, It's official: Google Summer of Code 2013 is on. Last year, Clojure was able to get four students who worked on projects like Typed Clojure, Clojure on Android, Clojure and Lua, and Overtone, and I'd love to see Clojure be a mentoring organisation again this year. I have created a GSoC 2013 page on the Clojure community wiki http://dev.clojure.org/display/community/Google+Summer+of+Code+2013. Here you will be able to find the latest information about what's going on with Clojure's GSoC 2013 effort and how to get involved. Here's some ways you can help: * Let people in your local user groups or university know about Clojure and GSoC. * If you're going to Clojure/West, attend the GSoC unsession. For students * Start researching project ideas and get involved with the relevant communities to find mentors. For developers: Does your open source project have a backlog of features to implement? GSoC is a great way to draw new contributors to your project. * Post it to the project idea page and become a mentor. * Let people know about GSoC on your project mailing list. I'd like to thank everyone in advance for helping with our GSoC 2013 project. Sincerely, Daniel -- -- 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 - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- -- 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 - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: Help on implementing a simple java (openNLP) EventStream interface
Also It looks like you could use reify instead of proxy here, it would improve performance. http://clojuredocs.org/clojure_core/clojure.core/reify - Max On Thursday, February 14, 2013 3:26:02 PM UTC+1, Ulises wrote: Without testing or anything that looks reasonable enough. I'm sure that there are plenty caveats around infinite seqs, etc. though. On 14 February 2013 14:22, Joachim De Beule joachim@gmail.comjavascript: wrote: Thanks! So you mean like this (assuming some function elt-event): (defn seq-event-stream [input-seq] (let [remaining (atom input-seq)] (proxy [EventStream] [] (next [] (let [current (first @remaining)] (swap! remaining rest) (elt-event current))) (hasNext [] (not (empty? @remaining)) 2013/2/14 Ulises ulises@gmail.com javascript: How about having your methods access an atom provided in a closure like it's done here: http://kotka.de/blog/2010/03/proxy_gen-class_little_brother.html U On 14 February 2013 13:58, Joachim De Beule joachim@gmail.comjavascript: wrote: Hi All, I want to turn a clojure sequence into an 'EventStream' java interface in clojure (see http://opennlp.apache.org/documentation/1.5.2-incubating/apidocs/opennlp-maxent/index.html). Basically this is an object that implements next() and hasNext() methods. I know this can be done with proxy: (proxy [EventStream] [] (hasNext [] ...) (next [] (Event. ...) ...)) What I am not sure about is how to deal with state. More precisely, the object returned by the above call to proxy obviously must somehow keep a pointer to the current position in the input sequence and increment the index after a call to next() etc. Any ideas on how to best do something like this? Thanks a lot! Joachim. -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clo...@googlegroups.comjavascript: Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+u...@googlegroups.com javascript: For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+u...@googlegroups.com javascript:. For more options, visit https://groups.google.com/groups/opt_out. -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clo...@googlegroups.comjavascript: Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+u...@googlegroups.com javascript: For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+u...@googlegroups.com javascript:. For more options, visit https://groups.google.com/groups/opt_out. -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clo...@googlegroups.comjavascript: Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+u...@googlegroups.com javascript: For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+u...@googlegroups.com javascript:. For more options, visit https://groups.google.com/groups/opt_out. -- -- 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 - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Why is this so difficult?
Having studied Lisp decades ago I like the look of Clojure a lot. But as a complete newbie when it comes to modern software development, I'm exasperated by what strikes me as a very difficult and primitive set of tools to get started. I keep seeing Leinigen, Leinigen, and the Leinigen homepage boasts that Leinigen offers the easiest way to get started with Clojure, but this simply isn't true. The easiest way to get started with Clojure that I've come across so far is IntelliJ IDEA. If I hadn't found that I'd probably have given up by now. What got me back into programming recently was a Lua-based development environment for Android called Gideros. Lua seems popular for developing apps for some reason. (Cf Corona, Moia, Unity). It seems like quite a neat language, though I'd like to use something more Lisp-like. Maybe the tools are just too difficult for me at the moment, though I'll persevere for a bit. I'd like to achieve some simple graphics on an Android device at least. I've come across some tutorials for CLojure and jMonkey and I'm wondering to dive into that, though I'm still unsure whether OpenGL is the way to go for simple 2D stuff... -- -- 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 - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: proper way to override clojure.core functions without getting warning/error
The problem is that your first namespace defines 'sorted?' and your second namespace just uses the namespace, thus overriding 'sorted?'. You have two options here. Your biggest project is that you're using ':use'. Use ':require' instead. Something like `(:require [random.learning.clojure.overridex :as overridex])`. Your second option is to do the :refer-clojure dance in this namespace as well, but really you should just use :require and qualify the namespace. On Thursday, February 14, 2013 10:04:55 AM UTC-8, AtKaaZ wrote: Let's say I want to override clojure.core/sorted? (ns random.learning.clojure.overridex (:refer-clojure :exclude [sorted?])) (defn sorted? [coll] {:pre [ (coll? coll)]} (clojure.core/sorted? coll)) I'm using Eclipse+counterclockwise, so loading this namespace(Ctrl+Alt+L) first time gives no warnings/errors, loading it second time, one warning and no errors, and subsequent times it's loaded there are no errors/warnings. the warning is this: WARNING: sorted? already refers to: #'clojure.core/sorted? in namespace: random.learning.clojure.overridex, being replaced by: #'random.learning.clojure.overridex/sorted? I could ignore the warning, no problem, but then I try to use this namespace in another namespace: (ns random.learning.clojure.usetheoverridexns (:use random.learning.clojure.overridex) ) (and (= false (sorted? '(1 2))) (= true (sorted? (sorted-set 1 2 When I load this namespace first time I get: WARNING: sorted? already refers to: #'clojure.core/sorted? in namespace: random.learning.clojure.usetheoverridexns, being replaced by: #'random.learning.clojure.overridex/sorted? true I could ignore that, but then I load it again(and any subsequent time) and this is an error (not just a warning that can be ignored): IllegalStateException sorted? already refers to: #'random.learning.clojure.overridex/sorted? in namespace: random.learning.clojure.usetheoverridexns clojure.lang.Namespace.warnOrFailOnReplace (Namespace.java:88) Notice there's no true aka return value. When I actually close the REPL, and Ctrl+Alt+L load only this latter namespace I get this: ;; Clojure 1.5.0-RC16 ;; Switching to random.learning.clojure.usetheoverridexns namespace WARNING: sorted? already refers to: #'clojure.core/sorted? in namespace: random.learning.clojure.usetheoverridexns, being replaced by: #'random.learning.clojure.overridex/sorted? true *IllegalStateException sorted? already refers to: #'random.learning.clojure.overridex/sorted? in namespace: random.learning.clojure.usetheoverridexns clojure.lang.Namespace.warnOrFailOnReplace (Namespace.java:88)* and any subsequent loads, show only the part in bold. While this may be some ccw issue, I am probably also doing something wrong that I could be doing better. What is the way to do this? especially in the latter namespace which is using the namespace which has overridden the sorted? I do want the overridden sorted? to actually be available and override the clojure.core/sorted? in any namespaces that are using the overridex namespace. Thank you. -- Please correct me if I'm wrong or incomplete, even if you think I'll subconsciously hate it. -- -- 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 - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: Why is this so difficult?
Can you explain a bit more? What do you find difficult about Leinigen? Thanks, Timothy On Thu, Feb 14, 2013 at 11:42 AM, BJG145 benmagicf...@gmail.com wrote: Having studied Lisp decades ago I like the look of Clojure a lot. But as a complete newbie when it comes to modern software development, I'm exasperated by what strikes me as a very difficult and primitive set of tools to get started. I keep seeing Leinigen, Leinigen, and the Leinigen homepage boasts that Leinigen offers the easiest way to get started with Clojure, but this simply isn't true. The easiest way to get started with Clojure that I've come across so far is IntelliJ IDEA. If I hadn't found that I'd probably have given up by now. What got me back into programming recently was a Lua-based development environment for Android called Gideros. Lua seems popular for developing apps for some reason. (Cf Corona, Moia, Unity). It seems like quite a neat language, though I'd like to use something more Lisp-like. Maybe the tools are just too difficult for me at the moment, though I'll persevere for a bit. I'd like to achieve some simple graphics on an Android device at least. I've come across some tutorials for CLojure and jMonkey and I'm wondering to dive into that, though I'm still unsure whether OpenGL is the way to go for simple 2D stuff... -- -- 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 - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- “One of the main causes of the fall of the Roman Empire was that–lacking zero–they had no way to indicate successful termination of their C programs.” (Robert Firth) -- -- 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 - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: Library naming etiquette?
Thanks for the replies. I'm not the owner of what the official namespace should be, so perhaps I'll just clj-xxx and I can always stop using that and change with a major release milestone. Clearly too much thought has gone into this already, and there doesn't appear to be a problem with people using clj-xxx on their own. On Tuesday, February 12, 2013 7:51:44 PM UTC-5, Jim Klucar wrote: I have a library that I'm getting ready to push to github / clojars and had a question about the naming of it. During development I called it clojure-xxx, where xxx is the application it interacts with. This is mostly because I didn't want to think of something clever. At any rate I'd like to know if that naming convention would be frowned upon because it isn't coming from the official clojure dev group. Thanks, Jim -- -- 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 - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: Help on implementing a simple java (openNLP) EventStream interface
Thanks for the tip Max, so you mean like this? (defn cases-event-stream [cases features-extractor labeler] (let [remaining (atom cases)] (reify opennlp.model.EventStream (next [this] (let [current (first @remaining)] (swap! remaining rest) (case-event current features-extractor labeler))) (hasNext [this] (not (empty? @remaining)) May I ask why that would be faster? And when proxy is preferred over reify? Joachim. 2013/2/14 Max Penet m...@qbits.cc Also It looks like you could use reify instead of proxy here, it would improve performance. http://clojuredocs.org/clojure_core/clojure.core/reify - Max On Thursday, February 14, 2013 3:26:02 PM UTC+1, Ulises wrote: Without testing or anything that looks reasonable enough. I'm sure that there are plenty caveats around infinite seqs, etc. though. On 14 February 2013 14:22, Joachim De Beule joachim@gmail.comwrote: Thanks! So you mean like this (assuming some function elt-event): (defn seq-event-stream [input-seq] (let [remaining (atom input-seq)] (proxy [EventStream] [] (next [] (let [current (first @remaining)] (swap! remaining rest) (elt-event current))) (hasNext [] (not (empty? @remaining)) 2013/2/14 Ulises ulises@gmail.com How about having your methods access an atom provided in a closure like it's done here: http://kotka.de/blog/**2010/03/proxy_gen-class_** little_brother.htmlhttp://kotka.de/blog/2010/03/proxy_gen-class_little_brother.html U On 14 February 2013 13:58, Joachim De Beule joachim@gmail.comwrote: Hi All, I want to turn a clojure sequence into an 'EventStream' java interface in clojure (see http://opennlp.apache.**org/documentation/1.5.2-** incubating/apidocs/opennlp-**maxent/index.htmlhttp://opennlp.apache.org/documentation/1.5.2-incubating/apidocs/opennlp-maxent/index.html). Basically this is an object that implements next() and hasNext() methods. I know this can be done with proxy: (proxy [EventStream] [] (hasNext [] ...) (next [] (Event. ...) ...)) What I am not sure about is how to deal with state. More precisely, the object returned by the above call to proxy obviously must somehow keep a pointer to the current position in the input sequence and increment the index after a call to next() etc. Any ideas on how to best do something like this? Thanks a lot! Joachim. -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clo...@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+u...@**googlegroups.com For more options, visit this group at http://groups.google.com/**group/clojure?hl=enhttp://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+u...@**googlegroups.com. For more options, visit https://groups.google.com/**groups/opt_outhttps://groups.google.com/groups/opt_out . -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clo...@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+u...@**googlegroups.com For more options, visit this group at http://groups.google.com/**group/clojure?hl=enhttp://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+u...@**googlegroups.com. For more options, visit https://groups.google.com/**groups/opt_outhttps://groups.google.com/groups/opt_out . -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clo...@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+u...@**googlegroups.com For more options, visit this group at http://groups.google.com/**group/clojure?hl=enhttp://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+u...@**googlegroups.com. For more options, visit https://groups.google.com/**groups/opt_outhttps://groups.google.com/groups/opt_out . -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group,
Re: proper way to override clojure.core functions without getting warning/error
Thank you for replying. I see that using :require like (:require [random.learning.clojure.overridex :as o]) also means I have to use sorted? as o/sorted? else the clojure.core/sorted? is used or using (:require [random.learning.clojure.overridex]) means I've to use random.learning.clojure.overridex/sorted?. This is actually something I was trying to avoid. I mean, I still want to use just sorted? and simply by somehow including another namespace (require/use/refer whichever way) in my namespace declaration then the implementation of sorted? would be different as dictated by this included namespace (supposed I could switch between the two, or even just not include any and have it be clojure.core variant of sorted?) What I forgot to mention is that I've tried the (:refer-clojure :exclude [sorted?]) variant in the new namespace but I was still unable to get rid of the errors. But maybe this is now just a ccw bug and this is indeed the right way for me to do thing if I really wanted the behavior that I mentioned. (ns random.learning.clojure.usetheoverridexns (:refer-clojure :exclude [sorted?]) (:use random.learning.clojure.overridex) (:refer-clojure :exclude [sorted?]) ) (and (= false (sorted? '(1 2))) (= true (sorted? (sorted-set 1 2 First time loading this in a new repl yields: ;; Clojure 1.5.0-RC16 ;; Switching to random.learning.clojure.usetheoverridexns namespace true IllegalStateException sorted? already refers to: #'random.learning.clojure.overridex/sorted? in namespace: random.learning.clojure.usetheoverridexns clojure.lang.Namespace.warnOrFailOnReplace (Namespace.java:88) it's not too bad, and any successive loads just show true The only thing is that if I switch to another namespace while repl is running I can't ever switch back due to the error: ;; Switching to random.learning.clojure.overridex namespace nil = *ns* #Namespace random.learning.clojure.overridex ;; Switching to random.learning.clojure.usetheoverridexns namespace IllegalStateException sorted? already refers to: #'random.learning.clojure.overridex/sorted? in namespace: random.learning.clojure.usetheoverridexns clojure.lang.Namespace.warnOrFailOnReplace (Namespace.java:88) = *ns* #Namespace random.learning.clojure.overridex I've already reported the ccw issue here: https://code.google.com/p/counterclockwise/issues/detail?id=528sort=-id So, I'll keep using this variant (:refer-clojure :exclude [sorted?]) for now, thank you Anthony. Btw, is there a way to not implicitly include clojure.core or to have it aliased :as cc for example so that I would have to always cc/sorted? if I wanted to use clojure.core and any others from it ? Even if this were possible, I wouldn't be able to just plug in a different implementation of sorted? and easily choose between the: namespace1, namespace2 and clojure.core 's implementation of sorted? because I would have to at least change from cc/sorted? to nsany/sorted? where depending on which namespace I import they can be aliased :as nsany but clojure.core would always be a different alias :as cc. thx On Thu, Feb 14, 2013 at 7:52 PM, Anthony Grimes disciplera...@gmail.comwrote: The problem is that your first namespace defines 'sorted?' and your second namespace just uses the namespace, thus overriding 'sorted?'. You have two options here. Your biggest project is that you're using ':use'. Use ':require' instead. Something like `(:require [random.learning.clojure.**overridex :as overridex])`. Your second option is to do the :refer-clojure dance in this namespace as well, but really you should just use :require and qualify the namespace. On Thursday, February 14, 2013 10:04:55 AM UTC-8, AtKaaZ wrote: Let's say I want to override clojure.core/sorted? (ns random.learning.clojure.**overridex (:refer-clojure :exclude [sorted?])) (defn sorted? [coll] {:pre [ (coll? coll)]} (clojure.core/sorted? coll)) I'm using Eclipse+counterclockwise, so loading this namespace(Ctrl+Alt+L) first time gives no warnings/errors, loading it second time, one warning and no errors, and subsequent times it's loaded there are no errors/warnings. the warning is this: WARNING: sorted? already refers to: #'clojure.core/sorted? in namespace: random.learning.clojure.**overridex, being replaced by: #'random.learning.clojure.**overridex/sorted? I could ignore the warning, no problem, but then I try to use this namespace in another namespace: (ns random.learning.clojure.**usetheoverridexns (:use random.learning.clojure.**overridex) ) (and (= false (sorted? '(1 2))) (= true (sorted? (sorted-set 1 2 When I load this namespace first time I get: WARNING: sorted? already refers to: #'clojure.core/sorted? in namespace: random.learning.clojure.**usetheoverridexns, being replaced by: #'random.learning.clojure.**overridex/sorted? true I could ignore that, but then I load it again(and any subsequent time) and this is an error (not just a warning that can
Re: Clojure, Heroku and the dreaded R10 Boot Timeout Error
Leonardo Borges writes: Could it be related to new relic? That's the only external service - besides downloading jars - that the app tries to reach upon starting up. If your app is downloading jars on startup that's a bad sign; all your dependencies should be downloaded during git push. If you can track down what's causing this then it should take care of your boot timeouts. If you're having trouble determining where it's coming from feel free to email me directly with your app name and I can help. -Phil -- -- 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 - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: Why is this so difficult?
What I find exasperating about Leinigen is that I've got a degree in computer science, decades of experience in IT support, and I still haven't been able to get it working yet. :-( Package Manager? Curl? What? OK, look, I'm not very bright. It took me years to get my head round OOP because all the books and examples were so dull. I like this Gideros thing I've discovered because it lets me throw together interesting programs with sound and graphics like I used to do on my BBC Micro when I was a kid. I feel I could release a Kindle app if I set my mind to it. I'd like to feel the same about Clojure, but I'm struggling. I read that functional programming is the future; it's fun; it's expressive; but to do anything interesting with it it seems you have to be a professional programmer. I can't imagine any teenagers releasing hit apps with it like they do with Corona. I'm exasperated that I can't find a nice Windows-based environment and a set of comprehensible graphics functions. Oh, just ignore me, I'm just having a rant. ;-) -- -- 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 - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: Why is this so difficult?
I think I have an idea of where your coming from. Leiningen does lots of wonderful and important things but coming from the outside (or at least from certain outsides) it's not even clear why you'd want to do a lot of those things, and it doesn't do some of the things that seem most essential to really getting started (like provide a way to edit code). I'm glad you've found IntelliJ IDEA to be helpful but FWIW I think that the best way to get started for many outsiders may instead be Clooj, which lets you edit and run code without knowing anything about Java or package managers or anything else -- you can just download and double click one thing and then start typing pure Clojure code in an environment that has minimal but essential features like bracket matching and auto-indentation. Clooj is listed on one of the getting started pages out there, but I know that its author could use help keeping it up to date and improving it. -Lee On Feb 14, 2013, at 2:32 PM, BJG145 wrote: What I find exasperating about Leinigen is that I've got a degree in computer science, decades of experience in IT support, and I still haven't been able to get it working yet. :-( Package Manager? Curl? What? OK, look, I'm not very bright. It took me years to get my head round OOP because all the books and examples were so dull. I like this Gideros thing I've discovered because it lets me throw together interesting programs with sound and graphics like I used to do on my BBC Micro when I was a kid. I feel I could release a Kindle app if I set my mind to it. I'd like to feel the same about Clojure, but I'm struggling. I read that functional programming is the future; it's fun; it's expressive; but to do anything interesting with it it seems you have to be a professional programmer. I can't imagine any teenagers releasing hit apps with it like they do with Corona. I'm exasperated that I can't find a nice Windows-based environment and a set of comprehensible graphics functions. Oh, just ignore me, I'm just having a rant. ;-) -- -- 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 - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
protocol implementation delegating to protocol extension doesn't compile
let me explain with an example: ;;in some namespace x (defprotocol IStemmable (stem [this token] [this token lang]) (getRoot [this token dictionary])) (defprotocol IDistance (getDistance [this s1 s2] [this s1 s2 m-weight])) ;;in some namespace y that refers all vars from x (extend-type String IStemmable (stem ([this] (stem this english)) ([this lang] (let [stemmer (help/porter-stemmer lang)] (doto stemmer (.setCurrent this) (.stem)) (.getCurrent stemmer (getRoot [this _ dic] (get dic this NOT-FOUND!)) IDistance (getDistance ([this other] (help/levenshtein-distance* this other)) ;;delegate to helper fn ([this other mismatch-weight] (help/levenshtein-distance* this other mismatch-weight ;;same here (defrecord PorterStemmer [lang input output] ;;COMPILES AND WORKS FINE - NO PROBLEMS IStemmable (stem [_ token] (stem token lang)) ;;delegate to String for this (getRoot [_ token dic] (getRoot token _ dic ;;delegate to String for this (defrecord LevenshteinDistance [] ;;DOESN'T COMPILE IDistance (getDistance [_ s1 s2] (getDistance s1 s2)) ;;delegate to String for this (getDistance [_ s1 s2 weight] (getDistance s1 s2 weight))) ;;and this trying to load the file results in: CompilerException java.lang.IllegalArgumentException: No single method: getDistance of interface: cluja.protocols.IDistance found for function: getDistance of protocol: IDistance, compiling:(/media/sorted/uni_stick/cluja/src/cluja/concretions/models.clj:152:3) What am I doing wrong? I am practically doing the exact same thing for these 2 protocols. Both of them delegate to the implementations extended to string. I keep looking at the code and I see nothing wrong! The 'getDistance' with 3 args delegates to the one with 2 and the one with 4 delegates to the one with 3 (from String)...even more confusingly why one works and the other complains? any ideas/insights? Jim -- -- 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 - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: Why is this so difficult?
The easiest, when anything becomes a road block, is simply tryclj.comcombined with 4clojure.com. Those two alone can give you enough to work with and chew on while you become more familiar with clojure and setup a proper environment (including Leiningen). Another simplification is to use lein-oneoffhttps://github.com/mtyaka/lein-oneoff, once you have Leiningen installed, so that you can delay understanding how projects are structured and ran when typing lein new. On Thursday, February 14, 2013 1:51:06 PM UTC-6, Lee wrote: I think I have an idea of where your coming from. Leiningen does lots of wonderful and important things but coming from the outside (or at least from certain outsides) it's not even clear why you'd want to do a lot of those things, and it doesn't do some of the things that seem most essential to really getting started (like provide a way to edit code). I'm glad you've found IntelliJ IDEA to be helpful but FWIW I think that the best way to get started for many outsiders may instead be Clooj, which lets you edit and run code without knowing anything about Java or package managers or anything else -- you can just download and double click one thing and then start typing pure Clojure code in an environment that has minimal but essential features like bracket matching and auto-indentation. Clooj is listed on one of the getting started pages out there, but I know that its author could use help keeping it up to date and improving it. -Lee On Feb 14, 2013, at 2:32 PM, BJG145 wrote: What I find exasperating about Leinigen is that I've got a degree in computer science, decades of experience in IT support, and I still haven't been able to get it working yet. :-( Package Manager? Curl? What? OK, look, I'm not very bright. It took me years to get my head round OOP because all the books and examples were so dull. I like this Gideros thing I've discovered because it lets me throw together interesting programs with sound and graphics like I used to do on my BBC Micro when I was a kid. I feel I could release a Kindle app if I set my mind to it. I'd like to feel the same about Clojure, but I'm struggling. I read that functional programming is the future; it's fun; it's expressive; but to do anything interesting with it it seems you have to be a professional programmer. I can't imagine any teenagers releasing hit apps with it like they do with Corona. I'm exasperated that I can't find a nice Windows-based environment and a set of comprehensible graphics functions. Oh, just ignore me, I'm just having a rant. ;-) -- -- 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 - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
new, macros and Can't eval locals
The goal is to can write this form: = *(let [a java.lang.RuntimeException] (new a) )* CompilerException java.lang.IllegalArgumentException: Unable to resolve classname: a, compiling:(NO_SOURCE_PATH:2:3) attempt with macro: =* (defmacro mew [cls restt] `(new ~(eval cls) ~@restt) )* #'runtime.q/mew = *(let [a java.lang.RuntimeException] (mew a) )* CompilerException java.lang.UnsupportedOperationException: Can't eval locals, compiling:(NO_SOURCE_PATH:2:3) attempt with function: = *(defn mew [cls restt] (new cls) )* CompilerException java.lang.IllegalArgumentException: Unable to resolve classname: cls, compiling:(NO_SOURCE_PATH:2:3) attempt with a macro inside the function: = *(defn mew [cls restt] (mew cls) )* CompilerException java.lang.UnsupportedOperationException: Can't eval locals, compiling:(NO_SOURCE_PATH:2:3) Ok, i give up, how? impossible ? -- Please correct me if I'm wrong or incomplete, even if you think I'll subconsciously hate it. -- -- 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 - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: Why is this so difficult?
Thanks for the suggestions - this really isn't an anti-Leiningen thread, I'm just impatient that I don't understand it yet. But I'll give it another crack and post some more coherent queries when I get stuck...:-) -- -- 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 - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
[GSoC Idea] cljs layer/dsl over express js
Just throwing ideas. Feel free to shoot it down if you folks think its not worth it :). Also, I'm a student, and would actually be participating in GSOC, so this is more of a shoutout for possible mentors, if you guys think the project makes sense. The Problem: 1. cljs doesn't yet have a library/framework of its own to facilitate serverside web dev over nodejs. (I might be wrong here, and please correct me if I am). 2. Expressjs(http://expressjs.com/) is an awesome sinatra inspired, very popular, web app framework for node. 3. Using express directly using js interop calls can get ugly QED: It would make sense to have a cljs layer over express The Solution: I haven't ironed this out fully, but it would probably be a good idea to produce a compojure like framework, so its easier to adopt. Under the hood you'll obviously have either interop calls, or cljs implementations for the same functionality. Would love feedback on the idea! And whether can haz mentor? Cheers, Omer (@olenhad) -- -- 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 - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: new, macros and Can't eval locals
On Feb 14, 2013, at 1:27 PM, AtKaaZ wrote: The goal is to can write this form: = (let [a java.lang.RuntimeException] (new a) ) CompilerException java.lang.IllegalArgumentException: Unable to resolve classname: a, compiling:(NO_SOURCE_PATH:2:3) attempt with macro: = (defmacro mew [cls restt] `(new ~(eval cls) ~@restt) ) #'runtime.q/mew This is probably your closest attempt. Try this variation on the above: (defmacro mew [cls args] `(new ~cls ~@args)) user= (macroexpand-1 '(mew java.lang.RuntimeException)) (new java.lang.RuntimeException) Andy -- -- 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 - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: new, macros and Can't eval locals
thanks for the reply, = *(defmacro mew [cls args] `(new ~cls ~@args))* #'runtime.q/mew =* (let [a java.lang.RuntimeException] (mew a) )* CompilerException java.lang.IllegalArgumentException: Unable to resolve classname: a, compiling:(NO_SOURCE_PATH:2:3) that would be the equivalent macro of what *new* is doing it's like *(new a)* CompilerException java.lang.IllegalArgumentException: Unable to resolve classname: a, compiling:(NO_SOURCE_PATH:2:3) This is the goal: The goal is to can write this form: = *(let [a java.lang.RuntimeException] (new a))* but I think it's impossible, at least by using new it is On Thu, Feb 14, 2013 at 10:34 PM, Andy Fingerhut andy.finger...@gmail.comwrote: On Feb 14, 2013, at 1:27 PM, AtKaaZ wrote: The goal is to can write this form: = *(let [a java.lang.RuntimeException] (new a) )* CompilerException java.lang.IllegalArgumentException: Unable to resolve classname: a, compiling:(NO_SOURCE_PATH:2:3) attempt with macro: =* (defmacro mew [cls restt] `(new ~(eval cls) ~@restt) )* #'runtime.q/mew This is probably your closest attempt. Try this variation on the above: (defmacro mew [cls args] `(new ~cls ~@args)) user= (macroexpand-1 '(mew java.lang.RuntimeException)) (new java.lang.RuntimeException) Andy -- -- 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 - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- Please correct me if I'm wrong or incomplete, even if you think I'll subconsciously hate it. -- -- 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 - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: new, macros and Can't eval locals
I figure since new is expecting a class at compiletime, we can never pass it a class that we evaluate at runtime(those locals), ergo = impossible to macro around new like that like this = impossible: *(let [a java.lang.RuntimeException] (macro-that-eventually-calls-new a))* maybe someone could suggest another way? clojure.reflect ? On Thu, Feb 14, 2013 at 10:40 PM, AtKaaZ atk...@gmail.com wrote: thanks for the reply, = *(defmacro mew [cls args] `(new ~cls ~@args))* #'runtime.q/mew =* (let [a java.lang.RuntimeException] (mew a) )* CompilerException java.lang.IllegalArgumentException: Unable to resolve classname: a, compiling:(NO_SOURCE_PATH:2:3) that would be the equivalent macro of what *new* is doing it's like *(new a)* CompilerException java.lang.IllegalArgumentException: Unable to resolve classname: a, compiling:(NO_SOURCE_PATH:2:3) This is the goal: The goal is to can write this form: = *(let [a java.lang.RuntimeException] (new a))* but I think it's impossible, at least by using new it is On Thu, Feb 14, 2013 at 10:34 PM, Andy Fingerhut andy.finger...@gmail.com wrote: On Feb 14, 2013, at 1:27 PM, AtKaaZ wrote: The goal is to can write this form: = *(let [a java.lang.RuntimeException] (new a) )* CompilerException java.lang.IllegalArgumentException: Unable to resolve classname: a, compiling:(NO_SOURCE_PATH:2:3) attempt with macro: =* (defmacro mew [cls restt] `(new ~(eval cls) ~@restt) )* #'runtime.q/mew This is probably your closest attempt. Try this variation on the above: (defmacro mew [cls args] `(new ~cls ~@args)) user= (macroexpand-1 '(mew java.lang.RuntimeException)) (new java.lang.RuntimeException) Andy -- -- 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 - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- Please correct me if I'm wrong or incomplete, even if you think I'll subconsciously hate it. -- Please correct me if I'm wrong or incomplete, even if you think I'll subconsciously hate it. -- -- 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 - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: new, macros and Can't eval locals
ok looks like it's not impossible: = *(defmacro mew [cls restt] (let [c a] `(eval (new ~a ~@restt)) ) )* #'runtime.q/mew = *(let [a java.lang.RuntimeException] (mew a) )* #RuntimeException java.lang.RuntimeException On Thu, Feb 14, 2013 at 10:53 PM, AtKaaZ atk...@gmail.com wrote: I figure since new is expecting a class at compiletime, we can never pass it a class that we evaluate at runtime(those locals), ergo = impossible to macro around new like that like this = impossible: *(let [a java.lang.RuntimeException] (macro-that-eventually-calls-new a))* maybe someone could suggest another way? clojure.reflect ? On Thu, Feb 14, 2013 at 10:40 PM, AtKaaZ atk...@gmail.com wrote: thanks for the reply, = *(defmacro mew [cls args] `(new ~cls ~@args))* #'runtime.q/mew =* (let [a java.lang.RuntimeException] (mew a) )* CompilerException java.lang.IllegalArgumentException: Unable to resolve classname: a, compiling:(NO_SOURCE_PATH:2:3) that would be the equivalent macro of what *new* is doing it's like *(new a)* CompilerException java.lang.IllegalArgumentException: Unable to resolve classname: a, compiling:(NO_SOURCE_PATH:2:3) This is the goal: The goal is to can write this form: = *(let [a java.lang.RuntimeException] (new a))* but I think it's impossible, at least by using new it is On Thu, Feb 14, 2013 at 10:34 PM, Andy Fingerhut andy.finger...@gmail.com wrote: On Feb 14, 2013, at 1:27 PM, AtKaaZ wrote: The goal is to can write this form: = *(let [a java.lang.RuntimeException] (new a) )* CompilerException java.lang.IllegalArgumentException: Unable to resolve classname: a, compiling:(NO_SOURCE_PATH:2:3) attempt with macro: =* (defmacro mew [cls restt] `(new ~(eval cls) ~@restt) )* #'runtime.q/mew This is probably your closest attempt. Try this variation on the above: (defmacro mew [cls args] `(new ~cls ~@args)) user= (macroexpand-1 '(mew java.lang.RuntimeException)) (new java.lang.RuntimeException) Andy -- -- 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 - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- Please correct me if I'm wrong or incomplete, even if you think I'll subconsciously hate it. -- Please correct me if I'm wrong or incomplete, even if you think I'll subconsciously hate it. -- Please correct me if I'm wrong or incomplete, even if you think I'll subconsciously hate it. -- -- 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 - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: new, macros and Can't eval locals
and I forgot to mention that I already had another a defined = a java.lang.RuntimeException hence why it worked On Thu, Feb 14, 2013 at 11:01 PM, AtKaaZ atk...@gmail.com wrote: ah I tricked myself... I used ~a inside the macro instead of ~c or ~cls so back to still impossible = (defmacro mew [cls restt] (let [c cls] `(eval (new ~c ~@restt)) ) ) #'runtime.q/mew = (let [a java.lang.RuntimeException] (mew a) ) CompilerException java.lang.IllegalArgumentException: Unable to resolve classname: a, compiling:(NO_SOURCE_PATH:2:3) = (defmacro mew [cls restt] `(eval (new ~cls ~@restt)) ) #'runtime.q/mew = (let [a java.lang.RuntimeException] (mew a) ) CompilerException java.lang.IllegalArgumentException: Unable to resolve classname: a, compiling:(NO_SOURCE_PATH:2:3) On Thu, Feb 14, 2013 at 10:58 PM, AtKaaZ atk...@gmail.com wrote: ok looks like it's not impossible: = *(defmacro mew [cls restt] (let [c a] `(eval (new ~a ~@restt)) ) )* #'runtime.q/mew = *(let [a java.lang.RuntimeException] (mew a) )* #RuntimeException java.lang.RuntimeException On Thu, Feb 14, 2013 at 10:53 PM, AtKaaZ atk...@gmail.com wrote: I figure since new is expecting a class at compiletime, we can never pass it a class that we evaluate at runtime(those locals), ergo = impossible to macro around new like that like this = impossible: *(let [a java.lang.RuntimeException] (macro-that-eventually-calls-new a))* maybe someone could suggest another way? clojure.reflect ? On Thu, Feb 14, 2013 at 10:40 PM, AtKaaZ atk...@gmail.com wrote: thanks for the reply, = *(defmacro mew [cls args] `(new ~cls ~@args))* #'runtime.q/mew =* (let [a java.lang.RuntimeException] (mew a) )* CompilerException java.lang.IllegalArgumentException: Unable to resolve classname: a, compiling:(NO_SOURCE_PATH:2:3) that would be the equivalent macro of what *new* is doing it's like *(new a)* CompilerException java.lang.IllegalArgumentException: Unable to resolve classname: a, compiling:(NO_SOURCE_PATH:2:3) This is the goal: The goal is to can write this form: = *(let [a java.lang.RuntimeException] (new a))* but I think it's impossible, at least by using new it is On Thu, Feb 14, 2013 at 10:34 PM, Andy Fingerhut andy.finger...@gmail.com wrote: On Feb 14, 2013, at 1:27 PM, AtKaaZ wrote: The goal is to can write this form: = *(let [a java.lang.RuntimeException] (new a) )* CompilerException java.lang.IllegalArgumentException: Unable to resolve classname: a, compiling:(NO_SOURCE_PATH:2:3) attempt with macro: =* (defmacro mew [cls restt] `(new ~(eval cls) ~@restt) )* #'runtime.q/mew This is probably your closest attempt. Try this variation on the above: (defmacro mew [cls args] `(new ~cls ~@args)) user= (macroexpand-1 '(mew java.lang.RuntimeException)) (new java.lang.RuntimeException) Andy -- -- 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 - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- Please correct me if I'm wrong or incomplete, even if you think I'll subconsciously hate it. -- Please correct me if I'm wrong or incomplete, even if you think I'll subconsciously hate it. -- Please correct me if I'm wrong or incomplete, even if you think I'll subconsciously hate it. -- Please correct me if I'm wrong or incomplete, even if you think I'll subconsciously hate it. -- Please correct me if I'm wrong or incomplete, even if you think I'll subconsciously hate it. -- -- 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 - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: new, macros and Can't eval locals
Yes, since this is runtime you should use reflection. (let [a java.lang.RuntimeException] (.newInstance a)) Alternatively, you can use eval: (let [a java.lang.RuntimeException] (eval (list 'new a))) On Thu, Feb 14, 2013 at 4:53 PM, AtKaaZ atk...@gmail.com wrote: I figure since new is expecting a class at compiletime, we can never pass it a class that we evaluate at runtime(those locals), ergo = impossible to macro around new like that like this = impossible: *(let [a java.lang.RuntimeException] (macro-that-eventually-calls-new a))* maybe someone could suggest another way? clojure.reflect ? On Thu, Feb 14, 2013 at 10:40 PM, AtKaaZ atk...@gmail.com wrote: thanks for the reply, = *(defmacro mew [cls args] `(new ~cls ~@args))* #'runtime.q/mew =* (let [a java.lang.RuntimeException] (mew a) )* CompilerException java.lang.IllegalArgumentException: Unable to resolve classname: a, compiling:(NO_SOURCE_PATH:2:3) that would be the equivalent macro of what *new* is doing it's like *(new a)* CompilerException java.lang.IllegalArgumentException: Unable to resolve classname: a, compiling:(NO_SOURCE_PATH:2:3) This is the goal: The goal is to can write this form: = *(let [a java.lang.RuntimeException] (new a))* but I think it's impossible, at least by using new it is On Thu, Feb 14, 2013 at 10:34 PM, Andy Fingerhut andy.finger...@gmail.com wrote: On Feb 14, 2013, at 1:27 PM, AtKaaZ wrote: The goal is to can write this form: = *(let [a java.lang.RuntimeException] (new a) )* CompilerException java.lang.IllegalArgumentException: Unable to resolve classname: a, compiling:(NO_SOURCE_PATH:2:3) attempt with macro: =* (defmacro mew [cls restt] `(new ~(eval cls) ~@restt) )* #'runtime.q/mew This is probably your closest attempt. Try this variation on the above: (defmacro mew [cls args] `(new ~cls ~@args)) user= (macroexpand-1 '(mew java.lang.RuntimeException)) (new java.lang.RuntimeException) Andy -- -- 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 - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- Please correct me if I'm wrong or incomplete, even if you think I'll subconsciously hate it. -- Please correct me if I'm wrong or incomplete, even if you think I'll subconsciously hate it. -- -- 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 - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- -- 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 - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: Why is this so difficult?
This might help: 1. create a new project in the current directory lein new 2. Edit project.clj and add this plugin [lein-idea: 1.0.1] 3. run this to create idea project files lein idea 4. Open the project in intellij Josh On Fri, Feb 15, 2013 at 12:29 AM, BJG145 benmagicf...@gmail.com wrote: Thanks for the suggestions - this really isn't an anti-Leiningen thread, I'm just impatient that I don't understand it yet. But I'll give it another crack and post some more coherent queries when I get stuck...:-) -- -- 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 - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- -- 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 - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: [GSoC Idea] cljs layer/dsl over express js
Clojure has compojure ... which is a sinatra like web framework and you can create a new project usinglein new compojure and start creating your request handler functions from there ... Just like in express. If you want a jade equivalent... you can use hiccup . Josh. On Fri, Feb 15, 2013 at 12:30 AM, Omer Iqbal momeriqb...@gmail.com wrote: Just throwing ideas. Feel free to shoot it down if you folks think its not worth it :). Also, I'm a student, and would actually be participating in GSOC, so this is more of a shoutout for possible mentors, if you guys think the project makes sense. The Problem: 1. cljs doesn't yet have a library/framework of its own to facilitate serverside web dev over nodejs. (I might be wrong here, and please correct me if I am). 2. Expressjs(http://expressjs.com/) is an awesome sinatra inspired, very popular, web app framework for node. 3. Using express directly using js interop calls can get ugly QED: It would make sense to have a cljs layer over express The Solution: I haven't ironed this out fully, but it would probably be a good idea to produce a compojure like framework, so its easier to adopt. Under the hood you'll obviously have either interop calls, or cljs implementations for the same functionality. Would love feedback on the idea! And whether can haz mentor? Cheers, Omer (@olenhad) -- -- 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 - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- -- 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 - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: Why is this so difficult?
On Feb 14, 2013, at 3:50 PM, Alex Walker wrote: The easiest, when anything becomes a road block, is simply tryclj.com combined with 4clojure.com. Those two alone can give you enough to work with and chew on while you become more familiar with clojure and setup a proper environment (including Leiningen). Another simplification is to use lein-oneoff, once you have Leiningen installed, so that you can delay understanding how projects are structured and ran when typing lein new. tryclj.com is fantastic for day 1 but not much more. 4clojure.com is fantastic for what it is, but not for writing your own code for your own purposes. I do use these on day 1 of my classes with newcomers and suggest them to others who want a first taste. But Clooj can take you from day 1 through many kinds of complete projects. In my experience it's pretty much the only thing out there in this sweet spot, requiring no prior knowledge of much of anything (JVM, installation stuff, special purpose editors, etc), but letting you do real work. Some other systems may be there some time soon (e.g. LightTable, although that has a lot of other stuff going on too), but in my experience none are quite as simple to deal with as Clooj while simultaneously supporting real work. I've championed Clooj on this list a number of times and it's not because I have any personal connection to it. It's just because I think that the sweet spot that it fills is really important, and I hope that others (with more tool development skills etc) will come to appreciate that too and either help with that project or push other projects in that direction. -Lee -- -- 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 - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: [GSoC Idea] cljs layer/dsl over express js
But compojure isn't in cljs, so you have to use the jvm. A wrapper around express would mean you could run it on node. On Thu, Feb 14, 2013 at 5:35 PM, Josh Kamau joshnet2...@gmail.com wrote: Clojure has compojure ... which is a sinatra like web framework and you can create a new project usinglein new compojure and start creating your request handler functions from there ... Just like in express. If you want a jade equivalent... you can use hiccup . Josh. On Fri, Feb 15, 2013 at 12:30 AM, Omer Iqbal momeriqb...@gmail.comwrote: Just throwing ideas. Feel free to shoot it down if you folks think its not worth it :). Also, I'm a student, and would actually be participating in GSOC, so this is more of a shoutout for possible mentors, if you guys think the project makes sense. The Problem: 1. cljs doesn't yet have a library/framework of its own to facilitate serverside web dev over nodejs. (I might be wrong here, and please correct me if I am). 2. Expressjs(http://expressjs.com/) is an awesome sinatra inspired, very popular, web app framework for node. 3. Using express directly using js interop calls can get ugly QED: It would make sense to have a cljs layer over express The Solution: I haven't ironed this out fully, but it would probably be a good idea to produce a compojure like framework, so its easier to adopt. Under the hood you'll obviously have either interop calls, or cljs implementations for the same functionality. Would love feedback on the idea! And whether can haz mentor? Cheers, Omer (@olenhad) -- -- 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 - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- -- 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 - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- -- 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 - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Pretty-printing `lein test`s output?
First of all, I must say I'm new to testing in Clojure. My current workflow is pretty simple: * Edit + save the tests (which use clojure.test - I hear Midje is better though) in emacs * Run `lein test` in the terminal * recur But then the printed values (triggered when e.g. an `are` case fails) are fairly illegible, especially when big. Can I get the test runner to pprint its output? Is my workflow improvable anyway? Thanks - Victor -- -- 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 - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
How to bind an Aleph TCP server to a TCP v4 port?
I started to learn Clojure a couple of days ago. I was trying with some Aleph TCP echo server examples but I can not get the server to bind to a tcp v4 port. The server only binds to a tcp v6 port by default. Here my project file: (defproject clj-echo-server 0.1.0-SNAPSHOT :description Echo server with Aleph :url http://example.com/FIXME; :license {:name Eclipse Public License :url http://www.eclipse.org/legal/epl-v10.html} :dependencies [[org.clojure/clojure 1.4.0] [aleph 0.3.0-beta12]] :main clj-echo-server.core) And the server code: (ns clj-echo-server.core) (use 'lamina.core 'aleph.tcp 'gloss.core) (defn handler [ch client-info] (receive-all ch #(enqueue ch (str You said % (start-tcp-server handler {:port 9000, :frame (string :utf-8 :delimiters [\r\n])}) I can't figure out if I'm doing something wrong or how to configure the binding port, the documentation wasn't very helpful about tcp ports. My OS is an Ubuntu 12.04.2 LTS, the Leiningen version is 2.0.0-preview10 and all runs on Java 1.6.0_24 OpenJDK 64-Bit Server VM. Can anyone advise me on how to configure the port binding for the tcp server? Thanks for your time. -- -- 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 - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: Why is this so difficult?
You are certainly not alone. Learning the language and concepts is very easy for me, but the sysadmin stuff to get set up is so much harder. Believe it or not, I had much more trouble with installing core.logic than understanding it. It doesn't end either, you bump into more problems once you try to do something interesting. Just try e.g. to call the LLVM C api from Clojure, I have not succeeded to this day (was trying to implement a LLVM backend for Clojurescript). You have the same problem with many open source projects, they are simply not focused on user friendliness, it's certainly not a Clojure specific problem. If you are on Windows the problems are 10x worse. Compare this with e.g. Visual Studio. You install it, and everything just works. Package manager, calling C functions, powerful GUI libraries, IDE with debugger, syntax highlighting, autocomplete, etc. From the first minute on you are programming rather than sysadmining. I wish we had the same experience for Clojure. On Thursday, February 14, 2013 7:42:57 PM UTC+1, BJG145 wrote: Having studied Lisp decades ago I like the look of Clojure a lot. But as a complete newbie when it comes to modern software development, I'm exasperated by what strikes me as a very difficult and primitive set of tools to get started. I keep seeing Leinigen, Leinigen, and the Leinigen homepage boasts that Leinigen offers the easiest way to get started with Clojure, but this simply isn't true. The easiest way to get started with Clojure that I've come across so far is IntelliJ IDEA. If I hadn't found that I'd probably have given up by now. What got me back into programming recently was a Lua-based development environment for Android called Gideros. Lua seems popular for developing apps for some reason. (Cf Corona, Moia, Unity). It seems like quite a neat language, though I'd like to use something more Lisp-like. Maybe the tools are just too difficult for me at the moment, though I'll persevere for a bit. I'd like to achieve some simple graphics on an Android device at least. I've come across some tutorials for CLojure and jMonkey and I'm wondering to dive into that, though I'm still unsure whether OpenGL is the way to go for simple 2D stuff... -- -- 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 - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Looping and accumulation
I have a loop over a function that is accumulating a list of database keys for later use. But it is primarily doing other processing and returning a collection of processed/filtered records. I'd normally just PUSH the ids and records onto a list in Common Lisp, or even LOOP... COLLECT into 2 lists. In the Clojure way, how would I build this auxiliary list without using a mutable collection? Would it make sense to return a map or some other structure from the processing function that would contain both the processed record as well as any id of interest? I could accumulate this result, then filter the map into 2 collections - one of processed records and the other a subset of id's of interest. But that seems kludgy commingling the results like that. -- -- 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 - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: [GSoC Idea] cljs layer/dsl over express js
I responded to Omer on Twitter, it's probably worth looking into existing projects like Bodil Stokke's Dog Fort first - https://github.com/bodil/dogfort David On Thu, Feb 14, 2013 at 5:48 PM, Tamreen Khan histor...@gmail.com wrote: But compojure isn't in cljs, so you have to use the jvm. A wrapper around express would mean you could run it on node. On Thu, Feb 14, 2013 at 5:35 PM, Josh Kamau joshnet2...@gmail.com wrote: Clojure has compojure ... which is a sinatra like web framework and you can create a new project usinglein new compojure and start creating your request handler functions from there ... Just like in express. If you want a jade equivalent... you can use hiccup . Josh. On Fri, Feb 15, 2013 at 12:30 AM, Omer Iqbal momeriqb...@gmail.comwrote: Just throwing ideas. Feel free to shoot it down if you folks think its not worth it :). Also, I'm a student, and would actually be participating in GSOC, so this is more of a shoutout for possible mentors, if you guys think the project makes sense. The Problem: 1. cljs doesn't yet have a library/framework of its own to facilitate serverside web dev over nodejs. (I might be wrong here, and please correct me if I am). 2. Expressjs(http://expressjs.com/) is an awesome sinatra inspired, very popular, web app framework for node. 3. Using express directly using js interop calls can get ugly QED: It would make sense to have a cljs layer over express The Solution: I haven't ironed this out fully, but it would probably be a good idea to produce a compojure like framework, so its easier to adopt. Under the hood you'll obviously have either interop calls, or cljs implementations for the same functionality. Would love feedback on the idea! And whether can haz mentor? Cheers, Omer (@olenhad) -- -- 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 - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- -- 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 - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- -- 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 - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- -- 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 - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: Why is this so difficult?
I never tried out core.logic. This is how I just got it installed in less than a minute. Really no magic here: lein new foo; cd foo # google core.logic, grab the dependencies vector ([org.clojure/core.logic 0.7.5]), attach it to your project.clj lein repl (use 'clojure.core.logic)(run* [q] (== q true)) Same principle for practically every single Clojure lib. On Friday, February 15, 2013 12:08:18 AM UTC+1, Jules wrote: You are certainly not alone. Learning the language and concepts is very easy for me, but the sysadmin stuff to get set up is so much harder. Believe it or not, I had much more trouble with installing core.logic than understanding it. It doesn't end either, you bump into more problems once you try to do something interesting. Just try e.g. to call the LLVM C api from Clojure, I have not succeeded to this day (was trying to implement a LLVM backend for Clojurescript). You have the same problem with many open source projects, they are simply not focused on user friendliness, it's certainly not a Clojure specific problem. If you are on Windows the problems are 10x worse. Compare this with e.g. Visual Studio. You install it, and everything just works. Package manager, calling C functions, powerful GUI libraries, IDE with debugger, syntax highlighting, autocomplete, etc. From the first minute on you are programming rather than sysadmining. I wish we had the same experience for Clojure. On Thursday, February 14, 2013 7:42:57 PM UTC+1, BJG145 wrote: Having studied Lisp decades ago I like the look of Clojure a lot. But as a complete newbie when it comes to modern software development, I'm exasperated by what strikes me as a very difficult and primitive set of tools to get started. I keep seeing Leinigen, Leinigen, and the Leinigen homepage boasts that Leinigen offers the easiest way to get started with Clojure, but this simply isn't true. The easiest way to get started with Clojure that I've come across so far is IntelliJ IDEA. If I hadn't found that I'd probably have given up by now. What got me back into programming recently was a Lua-based development environment for Android called Gideros. Lua seems popular for developing apps for some reason. (Cf Corona, Moia, Unity). It seems like quite a neat language, though I'd like to use something more Lisp-like. Maybe the tools are just too difficult for me at the moment, though I'll persevere for a bit. I'd like to achieve some simple graphics on an Android device at least. I've come across some tutorials for CLojure and jMonkey and I'm wondering to dive into that, though I'm still unsure whether OpenGL is the way to go for simple 2D stuff... -- -- 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 - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: Why is this so difficult?
Sure, but you have assumed that you have a perfectly working clojure environment set up. *That* is the hard part. On Friday, February 15, 2013 12:19:34 AM UTC+1, vemv wrote: I never tried out core.logic. This is how I just got it installed in less than a minute. Really no magic here: lein new foo; cd foo # google core.logic, grab the dependencies vector ([org.clojure/core.logic 0.7.5]), attach it to your project.clj lein repl (use 'clojure.core.logic)(run* [q] (== q true)) Same principle for practically every single Clojure lib. On Friday, February 15, 2013 12:08:18 AM UTC+1, Jules wrote: You are certainly not alone. Learning the language and concepts is very easy for me, but the sysadmin stuff to get set up is so much harder. Believe it or not, I had much more trouble with installing core.logic than understanding it. It doesn't end either, you bump into more problems once you try to do something interesting. Just try e.g. to call the LLVM C api from Clojure, I have not succeeded to this day (was trying to implement a LLVM backend for Clojurescript). You have the same problem with many open source projects, they are simply not focused on user friendliness, it's certainly not a Clojure specific problem. If you are on Windows the problems are 10x worse. Compare this with e.g. Visual Studio. You install it, and everything just works. Package manager, calling C functions, powerful GUI libraries, IDE with debugger, syntax highlighting, autocomplete, etc. From the first minute on you are programming rather than sysadmining. I wish we had the same experience for Clojure. On Thursday, February 14, 2013 7:42:57 PM UTC+1, BJG145 wrote: Having studied Lisp decades ago I like the look of Clojure a lot. But as a complete newbie when it comes to modern software development, I'm exasperated by what strikes me as a very difficult and primitive set of tools to get started. I keep seeing Leinigen, Leinigen, and the Leinigen homepage boasts that Leinigen offers the easiest way to get started with Clojure, but this simply isn't true. The easiest way to get started with Clojure that I've come across so far is IntelliJ IDEA. If I hadn't found that I'd probably have given up by now. What got me back into programming recently was a Lua-based development environment for Android called Gideros. Lua seems popular for developing apps for some reason. (Cf Corona, Moia, Unity). It seems like quite a neat language, though I'd like to use something more Lisp-like. Maybe the tools are just too difficult for me at the moment, though I'll persevere for a bit. I'd like to achieve some simple graphics on an Android device at least. I've come across some tutorials for CLojure and jMonkey and I'm wondering to dive into that, though I'm still unsure whether OpenGL is the way to go for simple 2D stuff... -- -- 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 - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: Why is this so difficult?
If this does not work for you, you can help everyone by opening an issue at the Leiningen bug tracker: Make sure java and curl are correctly installed Run the corresponding (unix or Windows) lein install script Now you should be able to run lein repl, lein new, etc On Friday, February 15, 2013 12:26:15 AM UTC+1, Jules wrote: Sure, but you have assumed that you have a perfectly working clojure environment set up. *That* is the hard part. On Friday, February 15, 2013 12:19:34 AM UTC+1, vemv wrote: I never tried out core.logic. This is how I just got it installed in less than a minute. Really no magic here: lein new foo; cd foo # google core.logic, grab the dependencies vector ([org.clojure/core.logic 0.7.5]), attach it to your project.clj lein repl (use 'clojure.core.logic)(run* [q] (== q true)) Same principle for practically every single Clojure lib. On Friday, February 15, 2013 12:08:18 AM UTC+1, Jules wrote: You are certainly not alone. Learning the language and concepts is very easy for me, but the sysadmin stuff to get set up is so much harder. Believe it or not, I had much more trouble with installing core.logic than understanding it. It doesn't end either, you bump into more problems once you try to do something interesting. Just try e.g. to call the LLVM C api from Clojure, I have not succeeded to this day (was trying to implement a LLVM backend for Clojurescript). You have the same problem with many open source projects, they are simply not focused on user friendliness, it's certainly not a Clojure specific problem. If you are on Windows the problems are 10x worse. Compare this with e.g. Visual Studio. You install it, and everything just works. Package manager, calling C functions, powerful GUI libraries, IDE with debugger, syntax highlighting, autocomplete, etc. From the first minute on you are programming rather than sysadmining. I wish we had the same experience for Clojure. On Thursday, February 14, 2013 7:42:57 PM UTC+1, BJG145 wrote: Having studied Lisp decades ago I like the look of Clojure a lot. But as a complete newbie when it comes to modern software development, I'm exasperated by what strikes me as a very difficult and primitive set of tools to get started. I keep seeing Leinigen, Leinigen, and the Leinigen homepage boasts that Leinigen offers the easiest way to get started with Clojure, but this simply isn't true. The easiest way to get started with Clojure that I've come across so far is IntelliJ IDEA. If I hadn't found that I'd probably have given up by now. What got me back into programming recently was a Lua-based development environment for Android called Gideros. Lua seems popular for developing apps for some reason. (Cf Corona, Moia, Unity). It seems like quite a neat language, though I'd like to use something more Lisp-like. Maybe the tools are just too difficult for me at the moment, though I'll persevere for a bit. I'd like to achieve some simple graphics on an Android device at least. I've come across some tutorials for CLojure and jMonkey and I'm wondering to dive into that, though I'm still unsure whether OpenGL is the way to go for simple 2D stuff... -- -- 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 - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: Looping and accumulation
You want either `reduce` or `loop` as the control flow construct, and `conj` for appending items to a collection (without resorting to mutability). Have a look at them, they're pretty well covered in the available books, tutorials etc. Hope it helps - Victor On Friday, February 15, 2013 12:11:24 AM UTC+1, Jonathon McKitrick wrote: I have a loop over a function that is accumulating a list of database keys for later use. But it is primarily doing other processing and returning a collection of processed/filtered records. I'd normally just PUSH the ids and records onto a list in Common Lisp, or even LOOP... COLLECT into 2 lists. In the Clojure way, how would I build this auxiliary list without using a mutable collection? Would it make sense to return a map or some other structure from the processing function that would contain both the processed record as well as any id of interest? I could accumulate this result, then filter the map into 2 collections - one of processed records and the other a subset of id's of interest. But that seems kludgy commingling the results like that. -- -- 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 - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
poker-hands
A little library to score poker hands: https://github.com/jamesmacaulay/poker-hands Feedback would be great! -- -- 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 - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: Why is this so difficult?
Hi BJG145, I absolutely see where you're coming from. And in fairness, it did take a me a long and arduous time to get a really proficient development environment. I happen to really like expressive power. So when I came from a Java / OO development paradigm, it didn't bother me that I had to learn the innards of Clojure, it's toolset, and general world view. The fact that it provides a geometrically more powerful platform, meant I was willing to do the hard work to get started, to get those benefits. But I actually do see and agree with your point. Justifying that effort is hard given your background, spare time, etc. But I think this thread has given you a lot of good places that'll help you get started. *books resources: * - 4clojure.com *tools: * - clooj - tryclj.com HTH Tim On Thu, Feb 14, 2013 at 6:34 PM, vemv v...@vemv.net wrote: If this does not work for you, you can help everyone by opening an issue at the Leiningen bug tracker: Make sure java and curl are correctly installed Run the corresponding (unix or Windows) lein install script Now you should be able to run lein repl, lein new, etc On Friday, February 15, 2013 12:26:15 AM UTC+1, Jules wrote: Sure, but you have assumed that you have a perfectly working clojure environment set up. *That* is the hard part. On Friday, February 15, 2013 12:19:34 AM UTC+1, vemv wrote: I never tried out core.logic. This is how I just got it installed in less than a minute. Really no magic here: lein new foo; cd foo # google core.logic, grab the dependencies vector ([org.clojure/core.logic 0.7.5]), attach it to your project.clj lein repl (use 'clojure.core.logic)(run* [q] (== q true)) Same principle for practically every single Clojure lib. On Friday, February 15, 2013 12:08:18 AM UTC+1, Jules wrote: You are certainly not alone. Learning the language and concepts is very easy for me, but the sysadmin stuff to get set up is so much harder. Believe it or not, I had much more trouble with installing core.logic than understanding it. It doesn't end either, you bump into more problems once you try to do something interesting. Just try e.g. to call the LLVM C api from Clojure, I have not succeeded to this day (was trying to implement a LLVM backend for Clojurescript). You have the same problem with many open source projects, they are simply not focused on user friendliness, it's certainly not a Clojure specific problem. If you are on Windows the problems are 10x worse. Compare this with e.g. Visual Studio. You install it, and everything just works. Package manager, calling C functions, powerful GUI libraries, IDE with debugger, syntax highlighting, autocomplete, etc. From the first minute on you are programming rather than sysadmining. I wish we had the same experience for Clojure. On Thursday, February 14, 2013 7:42:57 PM UTC+1, BJG145 wrote: Having studied Lisp decades ago I like the look of Clojure a lot. But as a complete newbie when it comes to modern software development, I'm exasperated by what strikes me as a very difficult and primitive set of tools to get started. I keep seeing Leinigen, Leinigen, and the Leinigen homepage boasts that Leinigen offers the easiest way to get started with Clojure, but this simply isn't true. The easiest way to get started with Clojure that I've come across so far is IntelliJ IDEA. If I hadn't found that I'd probably have given up by now. What got me back into programming recently was a Lua-based development environment for Android called Gideros. Lua seems popular for developing apps for some reason. (Cf Corona, Moia, Unity). It seems like quite a neat language, though I'd like to use something more Lisp-like. Maybe the tools are just too difficult for me at the moment, though I'll persevere for a bit. I'd like to achieve some simple graphics on an Android device at least. I've come across some tutorials for CLojure and jMonkey and I'm wondering to dive into that, though I'm still unsure whether OpenGL is the way to go for simple 2D stuff... -- -- 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 - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: Looping and accumulation
Look at the first example here: http://clojuredocs.org/clojure_core/clojure.core/transient It should inspire you. Transient structures make this kind of loop run faster but as you lay out your first iteration just toss this aside (and the xxx! version of conj and cie). Luc P. I have a loop over a function that is accumulating a list of database keys for later use. But it is primarily doing other processing and returning a collection of processed/filtered records. I'd normally just PUSH the ids and records onto a list in Common Lisp, or even LOOP... COLLECT into 2 lists. In the Clojure way, how would I build this auxiliary list without using a mutable collection? Would it make sense to return a map or some other structure from the processing function that would contain both the processed record as well as any id of interest? I could accumulate this result, then filter the map into 2 collections - one of processed records and the other a subset of id's of interest. But that seems kludgy commingling the results like that. -- -- 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 - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- Softaddictslprefonta...@softaddicts.ca sent by ibisMail from my ipad! -- -- 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 - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: Looping and accumulation
On Feb 14, 2013 6:11 PM, Jonathon McKitrick jmckitr...@gmail.com wrote: I have a loop over a function that is accumulating a list of database keys for later use. But it is primarily doing other processing and returning a collection of processed/filtered records. As you come from Common Lisp, where all standard library sequences are strict, I think it will be more interesting for you to write a version of your function that can work on infinite lists of records. The point is laziness, not that the function will ever receive an infinite seq, but this is a good way to think about it. Consider that several library functions, like map, filter, iterate, and take-while are all lazy-friendly. -- Stephen Compall If anyone in the MSA is online, you should watch this flythrough. -- -- 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 - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: Google Summer of Code 2013
I would love to improve upon core.match On Thursday, February 14, 2013 1:10:29 PM UTC-5, David Nolen wrote: WOOT! I'm of course more than happy to mentor any projects around ClojureScript, core.logic, and core.match. David On Thu, Feb 14, 2013 at 1:03 PM, Daniel Solano Gómez clo...@sattvik.comjavascript: wrote: Hello, all, It's official: Google Summer of Code 2013 is on. Last year, Clojure was able to get four students who worked on projects like Typed Clojure, Clojure on Android, Clojure and Lua, and Overtone, and I'd love to see Clojure be a mentoring organisation again this year. I have created a GSoC 2013 page on the Clojure community wiki http://dev.clojure.org/display/community/Google+Summer+of+Code+2013. Here you will be able to find the latest information about what's going on with Clojure's GSoC 2013 effort and how to get involved. Here's some ways you can help: * Let people in your local user groups or university know about Clojure and GSoC. * If you're going to Clojure/West, attend the GSoC unsession. For students * Start researching project ideas and get involved with the relevant communities to find mentors. For developers: Does your open source project have a backlog of features to implement? GSoC is a great way to draw new contributors to your project. * Post it to the project idea page and become a mentor. * Let people know about GSoC on your project mailing list. I'd like to thank everyone in advance for helping with our GSoC 2013 project. Sincerely, Daniel -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clo...@googlegroups.comjavascript: Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+u...@googlegroups.com javascript: For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+u...@googlegroups.com javascript:. For more options, visit https://groups.google.com/groups/opt_out. -- -- 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 - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: Why is this so difficult?
FWIW, I've been using Clojure seriously for a couple of years now and never really used Leiningen. I've found that Eclipse with the awesome Counterclockwise plugin does everything that I need. This is also pretty easy for newcomers (assuming they know Eclipse) - just install the Counterclockwise plugin, create a Clojure project and code away. I use straight, regular Maven for build management, which does all of the dependency management stuff you need from Leiningen. Nothing against Leiningen, it is certainly a powerful toolset. However I prefer IDEs to command line tools, and I also do quite a bit of Java development so having an integrated IDE that does both Clojure and Java is much more useful to me. So basically Clojure gives you a choice of different toolchains to suit your preferences and environment. That's a good thing overall, though I still agree that it would be better if there were more newcomer friendly distributions. In particular, a GUI-based REPL that people can use to just launch and play without learning a host of command line options or setting up an entire build environment would be an awesome addition if anyone feels inclined to create one. An evolution of https://github.com/alandipert/clj-swingrepl perhaps, maybe with a WebStart option so people can run it without having to download / install anything. On Friday, 15 February 2013 02:42:57 UTC+8, BJG145 wrote: Having studied Lisp decades ago I like the look of Clojure a lot. But as a complete newbie when it comes to modern software development, I'm exasperated by what strikes me as a very difficult and primitive set of tools to get started. I keep seeing Leinigen, Leinigen, and the Leinigen homepage boasts that Leinigen offers the easiest way to get started with Clojure, but this simply isn't true. The easiest way to get started with Clojure that I've come across so far is IntelliJ IDEA. If I hadn't found that I'd probably have given up by now. What got me back into programming recently was a Lua-based development environment for Android called Gideros. Lua seems popular for developing apps for some reason. (Cf Corona, Moia, Unity). It seems like quite a neat language, though I'd like to use something more Lisp-like. Maybe the tools are just too difficult for me at the moment, though I'll persevere for a bit. I'd like to achieve some simple graphics on an Android device at least. I've come across some tutorials for CLojure and jMonkey and I'm wondering to dive into that, though I'm still unsure whether OpenGL is the way to go for simple 2D stuff... -- -- 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 - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: Pretty-printing `lein test`s output?
Hi Victor, I've developed something I use on my own projects to compare pretty printed test failure output. The final piece for it would be to incorporate its test failure report diffing into a leiningen plugin that wrapped lein test. https://github.com/AlexBaranosky/gui-diff On Thu, Feb 14, 2013 at 3:06 PM, vemv v...@vemv.net wrote: First of all, I must say I'm new to testing in Clojure. My current workflow is pretty simple: * Edit + save the tests (which use clojure.test - I hear Midje is better though) in emacs * Run `lein test` in the terminal * recur But then the printed values (triggered when e.g. an `are` case fails) are fairly illegible, especially when big. Can I get the test runner to pprint its output? Is my workflow improvable anyway? Thanks - Victor -- -- 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 - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- -- 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 - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: Why is this so difficult?
vemv, here is a file describing my Clojure install experience: https://www.dropbox.com/s/ln2ek5f5n47qnl1/clojureinstall.odp How should I continue? And where would a beginner find that information? Hopefully this is taken in good humor, this is meant as an illustration from a beginners' point of view, because undoubtedly the stupidity of a beginner (i.e. me) is greater than any expert can imagine. Keep in mind that once you know how to do something, doing it is easy. Driving to work is easy, but if you are in a new city then driving from point A to point B is hard if you don't know the way. The problem is the multitude of ways you can go wrong. The ideal experience would be a big download Clojure starter kit right on the clojure.org homepage, that would install leiningen, and an IDE with leiningen integration, and display a quick guide how to set up a project and run it. Jules On Friday, February 15, 2013 12:34:26 AM UTC+1, vemv wrote: If this does not work for you, you can help everyone by opening an issue at the Leiningen bug tracker: Make sure java and curl are correctly installed Run the corresponding (unix or Windows) lein install script Now you should be able to run lein repl, lein new, etc On Friday, February 15, 2013 12:26:15 AM UTC+1, Jules wrote: Sure, but you have assumed that you have a perfectly working clojure environment set up. *That* is the hard part. On Friday, February 15, 2013 12:19:34 AM UTC+1, vemv wrote: I never tried out core.logic. This is how I just got it installed in less than a minute. Really no magic here: lein new foo; cd foo # google core.logic, grab the dependencies vector ([org.clojure/core.logic 0.7.5]), attach it to your project.clj lein repl (use 'clojure.core.logic)(run* [q] (== q true)) Same principle for practically every single Clojure lib. On Friday, February 15, 2013 12:08:18 AM UTC+1, Jules wrote: You are certainly not alone. Learning the language and concepts is very easy for me, but the sysadmin stuff to get set up is so much harder. Believe it or not, I had much more trouble with installing core.logic than understanding it. It doesn't end either, you bump into more problems once you try to do something interesting. Just try e.g. to call the LLVM C api from Clojure, I have not succeeded to this day (was trying to implement a LLVM backend for Clojurescript). You have the same problem with many open source projects, they are simply not focused on user friendliness, it's certainly not a Clojure specific problem. If you are on Windows the problems are 10x worse. Compare this with e.g. Visual Studio. You install it, and everything just works. Package manager, calling C functions, powerful GUI libraries, IDE with debugger, syntax highlighting, autocomplete, etc. From the first minute on you are programming rather than sysadmining. I wish we had the same experience for Clojure. On Thursday, February 14, 2013 7:42:57 PM UTC+1, BJG145 wrote: Having studied Lisp decades ago I like the look of Clojure a lot. But as a complete newbie when it comes to modern software development, I'm exasperated by what strikes me as a very difficult and primitive set of tools to get started. I keep seeing Leinigen, Leinigen, and the Leinigen homepage boasts that Leinigen offers the easiest way to get started with Clojure, but this simply isn't true. The easiest way to get started with Clojure that I've come across so far is IntelliJ IDEA. If I hadn't found that I'd probably have given up by now. What got me back into programming recently was a Lua-based development environment for Android called Gideros. Lua seems popular for developing apps for some reason. (Cf Corona, Moia, Unity). It seems like quite a neat language, though I'd like to use something more Lisp-like. Maybe the tools are just too difficult for me at the moment, though I'll persevere for a bit. I'd like to achieve some simple graphics on an Android device at least. I've come across some tutorials for CLojure and jMonkey and I'm wondering to dive into that, though I'm still unsure whether OpenGL is the way to go for simple 2D stuff... -- -- 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 - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: Why is this so difficult?
You might, BJG145, also profit by taking a look at clojurewiki.org - I'm listing there all resources I can find. Good luck! 2013/2/15 Jules julesjac...@gmail.com vemv, here is a file describing my Clojure install experience: https://www.dropbox.com/s/ln2ek5f5n47qnl1/clojureinstall.odp How should I continue? And where would a beginner find that information? Hopefully this is taken in good humor, this is meant as an illustration from a beginners' point of view, because undoubtedly the stupidity of a beginner (i.e. me) is greater than any expert can imagine. Keep in mind that once you know how to do something, doing it is easy. Driving to work is easy, but if you are in a new city then driving from point A to point B is hard if you don't know the way. The problem is the multitude of ways you can go wrong. The ideal experience would be a big download Clojure starter kit right on the clojure.org homepage, that would install leiningen, and an IDE with leiningen integration, and display a quick guide how to set up a project and run it. Jules On Friday, February 15, 2013 12:34:26 AM UTC+1, vemv wrote: If this does not work for you, you can help everyone by opening an issue at the Leiningen bug tracker: Make sure java and curl are correctly installed Run the corresponding (unix or Windows) lein install script Now you should be able to run lein repl, lein new, etc On Friday, February 15, 2013 12:26:15 AM UTC+1, Jules wrote: Sure, but you have assumed that you have a perfectly working clojure environment set up. *That* is the hard part. On Friday, February 15, 2013 12:19:34 AM UTC+1, vemv wrote: I never tried out core.logic. This is how I just got it installed in less than a minute. Really no magic here: lein new foo; cd foo # google core.logic, grab the dependencies vector ([org.clojure/core.logic 0.7.5]), attach it to your project.clj lein repl (use 'clojure.core.logic)(run* [q] (== q true)) Same principle for practically every single Clojure lib. On Friday, February 15, 2013 12:08:18 AM UTC+1, Jules wrote: You are certainly not alone. Learning the language and concepts is very easy for me, but the sysadmin stuff to get set up is so much harder. Believe it or not, I had much more trouble with installing core.logic than understanding it. It doesn't end either, you bump into more problems once you try to do something interesting. Just try e.g. to call the LLVM C api from Clojure, I have not succeeded to this day (was trying to implement a LLVM backend for Clojurescript). You have the same problem with many open source projects, they are simply not focused on user friendliness, it's certainly not a Clojure specific problem. If you are on Windows the problems are 10x worse. Compare this with e.g. Visual Studio. You install it, and everything just works. Package manager, calling C functions, powerful GUI libraries, IDE with debugger, syntax highlighting, autocomplete, etc. From the first minute on you are programming rather than sysadmining. I wish we had the same experience for Clojure. On Thursday, February 14, 2013 7:42:57 PM UTC+1, BJG145 wrote: Having studied Lisp decades ago I like the look of Clojure a lot. But as a complete newbie when it comes to modern software development, I'm exasperated by what strikes me as a very difficult and primitive set of tools to get started. I keep seeing Leinigen, Leinigen, and the Leinigen homepage boasts that Leinigen offers the easiest way to get started with Clojure, but this simply isn't true. The easiest way to get started with Clojure that I've come across so far is IntelliJ IDEA. If I hadn't found that I'd probably have given up by now. What got me back into programming recently was a Lua-based development environment for Android called Gideros. Lua seems popular for developing apps for some reason. (Cf Corona, Moia, Unity). It seems like quite a neat language, though I'd like to use something more Lisp-like. Maybe the tools are just too difficult for me at the moment, though I'll persevere for a bit. I'd like to achieve some simple graphics on an Android device at least. I've come across some tutorials for CLojure and jMonkey and I'm wondering to dive into that, though I'm still unsure whether OpenGL is the way to go for simple 2D stuff... -- -- 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 - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com.
Re: Why is this so difficult?
On Thu, Feb 14, 2013 at 6:56 PM, Jules julesjac...@gmail.com wrote: vemv, here is a file describing my Clojure install experience: https://www.dropbox.com/s/ln2ek5f5n47qnl1/clojureinstall.odp How should I continue? And where would a beginner find that information? The problem is the Clojure world, for the most part, is all Mac and Linux - Windows is very much a second class citizen that very few Clojurians use at all. I surveyed the Bay Area Clojure Meetup members. 53 responded. Just 3 of them said they used Windows. Go to a Clojure conference and it'll be mostly Macs and almost all of the rest will be running Linux. That means all the tools, all the instructions, all the thinking, is focused on the command line and comes from a world where developers know that installed software has to go on your path, which usually means editing a dot file in your home directory, updating the PATH variable and sourcing the dot file to pick up the changes. It also means that the primary Clojure website is aimed at those kind of developers and, more specifically, aimed at experienced developers on those platforms who can pick thru the minimalist information and variety of links scattered everywhere. The fact is: clojure.org is NOT beginner friendly :( Leiningen - the primary build tool - is a shell script. Clojure is a library - a JAR file - and using Clojure relies (under the hood) on a local Maven repository and then declaring and fetching dependencies from various known repositories. Leiningen makes all that much simpler than the raw tools. But it doesn't make it as simple as most Windows users expect. Having set up a dozen or so Clojure development environments on a variety of Mac, Linux and Windows, here's what I recommend for Windows: * Start with GOW - Gnu on Windows - so that you have the basic Linux toolset that is so familiar to most Clojurians: https://github.com/bmatzelle/gow/downloads * It installs curl and wget (and a bunch of other very useful stuff) and adds it to your path directly! Read more here: https://github.com/bmatzelle/gow/wiki * Download the Leiningen Windows batch file. I put mine in C:\LEIN and then added C:\LEIN to my Path environment variable (in the system environment variables) * Start a new cmd shell window (or Powershell if you're that way inclined) and type: lein self-install At least at this point you can create new Clojure projects, edit project.clj with your favorite editor to add dependencies, and use lein repl in a cmd shell to experiment with those libraries. As others have said, try Clooj if you really have no idea about the command line or the Java ecosystem. Try LightTable once you've installed Leiningen and created a project to play with. If you're a Java developer on Windows, you're probably using Eclipse or IntelliJ so install the Clojure plugin and use that. If you're brave, try Emacs - that's what most Clojurians use and it really does have the most integrated overall workflow, especially with a built-in shell, IRC client and various other goodies. -- 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 good. -- Gustave Flaubert, French realist novelist (1821-1880) -- -- 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 - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: Why is this so difficult?
2013/2/15 Konrad Scorciapino scorciap...@gmail.com You might, BJG145, also profit by taking a look at clojurewiki.org - I'm listing there all resources I can find. You may want to add clojure-doc.org, which is the most complete, contributor friendly source of documentation guides (including guides on the ecosystem). -- MK http://github.com/michaelklishin http://twitter.com/michaelklishin -- -- 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 - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: [ANN] analyze 0.3.0 - Hygienic transformation
It looks as if https://github.com/jonase/kibit/ is a lint/check style tool that only reads the source code, this limits its utilization: Kibit readshttp://clojure.github.com/clojure/clojure.core-api.html#clojure.core/read source code without any macro expansion or evaluation. A macro can therefor easily invalidate a rule. Also, kibit will not know if the symbol + in the form (+ x 1) actually refers to a local or to a function in a namespace other than clojure.core. Expect some false positives. So there is a place for an AST based one (more similar to findbugs I guess) On Wednesday, February 13, 2013 9:21:52 AM UTC+2, Ambrose Bonnaire-Sergeant wrote: IMO that's the job of a linter-style tool, which can be written easily with `analyze`. On Tue, Feb 12, 2013 at 11:58 PM, Michael Wood esio...@gmail.comjavascript: wrote: It might be useful, though, to be able to enable warnings for shadowed variables. On 12 February 2013 17:38, Timothy Baldridge tbald...@gmail.comjavascript: wrote: This sort of pattern is used quite a lot in clojure (even in core): (let [data (if (string? data) (read-string data) data) data (if (string? (first data)) (first data) (next data)) data (if (string? (first data)) (first data) (next data))] data) Throwing exceptions on overridden variable names would not only break Clojure code, but also is very non-lispy. Timothy On Tue, Feb 12, 2013 at 6:31 AM, AtKaaZ atk...@gmail.com javascript: wrote: it makes sense to not throw now that I think about it, when using _ instead of a I'm also thinking of cases like: = (let [a 1] (let [b 2 a 3] (println a b))) 3 2 nil is there something that would let me know I'm overwriting a ? I figure if something like this would slip by would be tough to track down On Tue, Feb 12, 2013 at 1:46 PM, Michael Wood esio...@gmail.comjavascript: wrote: On 12 February 2013 12:28, AtKaaZ atk...@gmail.com javascript: wrote: what would this do: (let [a 1, a 2] a) becomes: (let [a 1, a123 2] a) or (let [a 1, a123 2] a123) or exception[I prefer] It would be the second option, i.e.: (let [a 1, a123 2] a123) The original code is valid, so it would not throw an exception. On Tue, Feb 12, 2013 at 7:10 AM, Ambrose Bonnaire-Sergeant abonnair...@gmail.com javascript: wrote: Processing a hygienic AST relieves the burden of worrying about shadowing of locals. Wherever a binding would normally be shadowed, it is instead renamed to a local binding currently not in scope. eg. (let [a 1, a a] a) becomes (let [a 1, a123 a] a123) It can be useful for those processing Clojure's analysis results. Thanks, Ambrose On Tue, Feb 12, 2013 at 1:54 AM, kovas boguta kovas@gmail.comjavascript: wrote: What is a hygienic AST? Thanks k On Sun, Feb 10, 2013 at 10:45 PM, Ambrose Bonnaire-Sergeant abonnair...@gmail.com javascript: wrote: Hi everyone, Happy to release analyze 0.3.0 with new hygienic code transformation capabilities. [analyze 0.3.0] In a line: analyze.hygienic= (- (ast (let [a 1 a a b a a a] a)) ast-hy emit-hy) ((fn* ([] (let* [a 1 a2921 a b a2921 a2922 a2921] a2922 Hygienic AST's have enabled large performance boosts in core.typed. I'm excited to see how it could be as useful to others. Note: hygienic AST's (those transformed with `analyze.hygienic/ast-hy` can be printed normally with `analyze.emit-form/emit-form`, and hygienically with `analyze.hygienic/emit-hy`. https://github.com/frenchy64/analyze Thanks, Ambrose -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clo...@googlegroups.comjavascript: Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+u...@googlegroups.com javascript: For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+u...@googlegroups.com javascript:. For more options, visit https://groups.google.com/groups/opt_out. -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clo...@googlegroups.comjavascript: Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+u...@googlegroups.com
Re: [ANN] analyze 0.3.0 - Hygienic transformation
On Friday, February 15, 2013 6:19:00 AM UTC+2, ronen wrote: It looks as if https://github.com/jonase/kibit/ is a lint/check style tool that only reads the source code, this limits its utilization: Kibit readshttp://clojure.github.com/clojure/clojure.core-api.html#clojure.core/read source code without any macro expansion or evaluation. A macro can therefor easily invalidate a rule. Also, kibit will not know if the symbol + in the form (+ x 1) actually refers to a local or to a function in a namespace other than clojure.core. Expect some false positives. So there is a place for an AST based one (more similar to findbugs I guess) If someone is interested in this https://github.com/jonase/eastwood might be a good starting point. On Wednesday, February 13, 2013 9:21:52 AM UTC+2, Ambrose Bonnaire-Sergeant wrote: IMO that's the job of a linter-style tool, which can be written easily with `analyze`. On Tue, Feb 12, 2013 at 11:58 PM, Michael Wood esio...@gmail.com wrote: It might be useful, though, to be able to enable warnings for shadowed variables. On 12 February 2013 17:38, Timothy Baldridge tbald...@gmail.com wrote: This sort of pattern is used quite a lot in clojure (even in core): (let [data (if (string? data) (read-string data) data) data (if (string? (first data)) (first data) (next data)) data (if (string? (first data)) (first data) (next data))] data) Throwing exceptions on overridden variable names would not only break Clojure code, but also is very non-lispy. Timothy On Tue, Feb 12, 2013 at 6:31 AM, AtKaaZ atk...@gmail.com wrote: it makes sense to not throw now that I think about it, when using _ instead of a I'm also thinking of cases like: = (let [a 1] (let [b 2 a 3] (println a b))) 3 2 nil is there something that would let me know I'm overwriting a ? I figure if something like this would slip by would be tough to track down On Tue, Feb 12, 2013 at 1:46 PM, Michael Wood esio...@gmail.com wrote: On 12 February 2013 12:28, AtKaaZ atk...@gmail.com wrote: what would this do: (let [a 1, a 2] a) becomes: (let [a 1, a123 2] a) or (let [a 1, a123 2] a123) or exception[I prefer] It would be the second option, i.e.: (let [a 1, a123 2] a123) The original code is valid, so it would not throw an exception. On Tue, Feb 12, 2013 at 7:10 AM, Ambrose Bonnaire-Sergeant abonnair...@gmail.com wrote: Processing a hygienic AST relieves the burden of worrying about shadowing of locals. Wherever a binding would normally be shadowed, it is instead renamed to a local binding currently not in scope. eg. (let [a 1, a a] a) becomes (let [a 1, a123 a] a123) It can be useful for those processing Clojure's analysis results. Thanks, Ambrose On Tue, Feb 12, 2013 at 1:54 AM, kovas boguta kovas@gmail.com wrote: What is a hygienic AST? Thanks k On Sun, Feb 10, 2013 at 10:45 PM, Ambrose Bonnaire-Sergeant abonnair...@gmail.com wrote: Hi everyone, Happy to release analyze 0.3.0 with new hygienic code transformation capabilities. [analyze 0.3.0] In a line: analyze.hygienic= (- (ast (let [a 1 a a b a a a] a)) ast-hy emit-hy) ((fn* ([] (let* [a 1 a2921 a b a2921 a2922 a2921] a2922 Hygienic AST's have enabled large performance boosts in core.typed. I'm excited to see how it could be as useful to others. Note: hygienic AST's (those transformed with `analyze.hygienic/ast-hy` can be printed normally with `analyze.emit-form/emit-form`, and hygienically with `analyze.hygienic/emit-hy`. https://github.com/frenchy64/analyze Thanks, Ambrose -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clo...@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+u...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+u...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clo...@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to
Re: Pretty-printing `lein test`s output?
On Thu, Feb 14, 2013 at 3:06 PM, vemv v...@vemv.net wrote: But then the printed values (triggered when e.g. an `are` case fails) are fairly illegible, especially when big. Can I get the test runner to pprint its output? Is my workflow improvable anyway? I use lein-difftest for this: https://github.com/brentonashworth/lein-difftest -Phil -- -- 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 - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: Pretty-printing `lein test`s output?
You'll find your workflow greatly improved by using nrepl (or slime/swank) and running tests directly from Emacs - and that applies whether you're using bare clojure.test, midje or expectations. I use expectations for testing and expectations-mode in Emacs. I can run an individual namespace's tests with C-c , and it shows the pass / fail summary in the minibuffer and highlights any failing tests in orange or red (depending on how they failed). It also shows the pass/fail summary in the repl buffer. Pretty sure there are equivalent modes for both clojure.test and midje. On Thu, Feb 14, 2013 at 3:06 PM, vemv v...@vemv.net wrote: First of all, I must say I'm new to testing in Clojure. My current workflow is pretty simple: * Edit + save the tests (which use clojure.test - I hear Midje is better though) in emacs * Run `lein test` in the terminal * recur But then the printed values (triggered when e.g. an `are` case fails) are fairly illegible, especially when big. Can I get the test runner to pprint its output? Is my workflow improvable anyway? Thanks - Victor -- -- 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 - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. -- 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 good. -- Gustave Flaubert, French realist novelist (1821-1880) -- -- 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 - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: protocol implementation delegating to protocol extension doesn't compile
Hi Jim: I think the problem is that you are actually calling the *getDistance *protocol function with only 2 arguments in the line in bold below: (defrecord LevenshteinDistance [] IDistance (getDistance [_ s1 s2] *(getDistance s1 s2)) ;; - Calling a getDistance function with 2 args * (getDistance [_ s1 s2 weight] (getDistance s1 s2 weight))) While in the protocol definition there's only a 3 and 4 arguments declarations for getDistance. (defprotocol IDistance (getDistance [this s1 s2]; 3 args [this s1 s2 m-weight])) ; 4 args You could add a 2 arguments override for the *getDistance* protocol function and it would work by calling the 2 args implementation added to String, which is actually never registered in the protocol and goes unnoticed for the reason that follows, which I myself found out while experimenting with your code, you can skip it if you like, I just had a little fun investigating some Clojure code :). When using *extend-type*, any implementation for a protocol function with a number of args not present in the protocol's declaration doesn't seem to produce any errors or warnings (*extend* presents the same behavior, which makes sense since *extend-type* uses it). (defprotocol SomeProtocol (some-function [this x] [this x y])) (defrecord SomeRecord []) (extend-type SomeRecord SomeProtocol (some-function ([_] (println 1-arg)) ; this is not declared ([_ _ _ _ _] (println 5-arg)) ; this is not declared ([_ x y] (some-function x y))) However, a *CompilerException* is thrown when implementing a protocol using the *defrecord* macro, and declaring a non-existing override for the function. I looked a little bit into the code of *defrecord *and the reason for this seems to be that it ultimately uses *deftype* which actually creates a class that implements the methods for the Java interface that the protocol defines, the compiler checks in this case if there's any method with the name and arity with the supplied implementation, and throws an exception if it doesn't. (defprotocol SomeProtocol (some-function [this x] [this x y])) (defrecord SomeRecord [] SomeProtocol (some-function [_] (println 1-arg)) ; this is not declared (some-function [_ x y] (some-function x y))) #CompilerException java.lang.IllegalArgumentException: Can't define method not in interfaces: some_function, compiling: (file.clj) This seems to indicate that using extend (or extend-type) vs. deftpye (or defrecord) for implementing a protocol yields two different results, the former registers the function implementations in the protocol using the map supplied and the latter actually creates a class method for the record or type class generated. This was not obvious at all to me and I think I even recall reading somewhere (can't remember exactly where and can't find it right now) that the defrecord inline implementation was just a convenience form for extend/extend-type, but is it possible that it's actually more performant to use the defrecord/deftpye? Hope it helps, Juan On Thursday, February 14, 2013 5:16:53 PM UTC-3, Jim foo.bar wrote: let me explain with an example: ;;in some namespace x (defprotocol IStemmable (stem [this token] [this token lang]) (getRoot [this token dictionary])) (defprotocol IDistance (getDistance [this s1 s2] [this s1 s2 m-weight])) ;;in some namespace y that refers all vars from x (extend-type String IStemmable (stem ([this] (stem this english)) ([this lang] (let [stemmer (help/porter-stemmer lang)] (doto stemmer (.setCurrent this) (.stem)) (.getCurrent stemmer (getRoot [this _ dic] (get dic this NOT-FOUND!)) IDistance (getDistance ([this other] (help/levenshtein-distance* this other)) ;;delegate to helper fn ([this other mismatch-weight] (help/levenshtein-distance* this other mismatch-weight ;;same here (defrecord PorterStemmer [lang input output] ;;COMPILES AND WORKS FINE - NO PROBLEMS IStemmable (stem [_ token] (stem token lang)) ;;delegate to String for this (getRoot [_ token dic] (getRoot token _ dic ;;delegate to String for this (defrecord LevenshteinDistance [] ;;DOESN'T COMPILE IDistance (getDistance [_ s1 s2] (getDistance s1 s2)) ;;delegate to String for this (getDistance [_ s1 s2 weight] (getDistance s1 s2 weight))) ;;and this trying to load the file results in: CompilerException java.lang.IllegalArgumentException: No single method: getDistance of interface: cluja.protocols.IDistance found for function: getDistance of protocol: IDistance, compiling:(/media/sorted/uni_stick/cluja/src/cluja/concretions/models.clj:152:3) What am I doing wrong? I am practically doing the exact same thing for these 2 protocols. Both of them
Re: Why is this so difficult?
I feel your pain BJG145, when I started learning Clojure I used Cloojhttps://github.com/arthuredelstein/clooj to be able start playing with the language, it provides the basics, a REPL, a text area for the code and a tree of files and folder for the current project. It's simple and get's you started, you can for example follow book examples with it, or try new concepts and play around. Once I started feeling that the pieces were fitting together, I began to consider checking what Leiningen was all about. At that time there was no .bat file for Windows, so I decided to use cygwin http://www.cygwin.com/ instead, which is a *nix like command-line environment for Windows, and it has worked like charm since then. Coming from IDE's like Eclispse and Visual Studio, getting used to the command-line for running things, was far from my comfort zone, and I think I understand where you are coming from. Counter-Clockwise https://github.com/laurentpetit/ccwis an Eclipse http://www.eclipse.org/downloads/plugin, really easy to install that is, IMHO, one of the best user-friendly, GUI-familiar options for Clojure development right now. Still, I think some tool is missing for Clojure that can lower the difficulties for newcomers to try out the language and be able to reap the benefits of using it, while avoiding to be overwhelmed by the initial environment configuration. It may seem trivial to some, but I think it's because we get used to the workflow, but for someone who's new, every little detail needs consideration and every new concept needs to be grasped, so if the configuration details and concepts could be minimized, then I think the language would speak for itself. Anyway, I digress. I just wanted to finish this post saying that if you take the time to learn Clojure I think you'll have fun in the process, you will have a very powerful tool under your belt and you'll get support from a friendly community. Cheers, J On Thursday, February 14, 2013 6:29:07 PM UTC-3, BJG145 wrote: Thanks for the suggestions - this really isn't an anti-Leiningen thread, I'm just impatient that I don't understand it yet. But I'll give it another crack and post some more coherent queries when I get stuck...:-) -- -- 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 - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: Why is this so difficult?
Well the first thing you assume is that project pages should be giant download buttons, and therefore the exposed content in those pages is not worth reading/understanding. For instance you can find the answer to the question posed in the slide 19 in slide 7. Just imagine if every single open source project had to explain what the PATH is, how to install curl, and so on. You (and me) will be constantly a newbie at something, and the getting started guide (if any) will be almost invariably incomplete. So you better practice the skill of figuring out things. That said, the wording in lein's installation instructions for Windows is improvable - it should acknowledge the fact that working with the Windows mindset can pretty much equal clicking till it works. In particular it should leave clear that you *want* curl installed even if it isn't: On Windows most users can get the batch file. If you have wget.exe or curl.exe already installed and in PATH, you can just run lein self-install, *otherwise* get the standalone jar from the downloads page. If you have Cygwin you should be able to use the shell script above rather than the batch file. Emphasis mine. On Fri, Feb 15, 2013 at 3:56 AM, Jules julesjac...@gmail.com wrote: vemv, here is a file describing my Clojure install experience: https://www.dropbox.com/s/ln2ek5f5n47qnl1/clojureinstall.odp How should I continue? And where would a beginner find that information? Hopefully this is taken in good humor, this is meant as an illustration from a beginners' point of view, because undoubtedly the stupidity of a beginner (i.e. me) is greater than any expert can imagine. Keep in mind that once you know how to do something, doing it is easy. Driving to work is easy, but if you are in a new city then driving from point A to point B is hard if you don't know the way. The problem is the multitude of ways you can go wrong. The ideal experience would be a big download Clojure starter kit right on the clojure.org homepage, that would install leiningen, and an IDE with leiningen integration, and display a quick guide how to set up a project and run it. Jules On Friday, February 15, 2013 12:34:26 AM UTC+1, vemv wrote: If this does not work for you, you can help everyone by opening an issue at the Leiningen bug tracker: Make sure java and curl are correctly installed Run the corresponding (unix or Windows) lein install script Now you should be able to run lein repl, lein new, etc On Friday, February 15, 2013 12:26:15 AM UTC+1, Jules wrote: Sure, but you have assumed that you have a perfectly working clojure environment set up. *That* is the hard part. On Friday, February 15, 2013 12:19:34 AM UTC+1, vemv wrote: I never tried out core.logic. This is how I just got it installed in less than a minute. Really no magic here: lein new foo; cd foo # google core.logic, grab the dependencies vector ([org.clojure/core.logic 0.7.5]), attach it to your project.clj lein repl (use 'clojure.core.logic)(run* [q] (== q true)) Same principle for practically every single Clojure lib. On Friday, February 15, 2013 12:08:18 AM UTC+1, Jules wrote: You are certainly not alone. Learning the language and concepts is very easy for me, but the sysadmin stuff to get set up is so much harder. Believe it or not, I had much more trouble with installing core.logic than understanding it. It doesn't end either, you bump into more problems once you try to do something interesting. Just try e.g. to call the LLVM C api from Clojure, I have not succeeded to this day (was trying to implement a LLVM backend for Clojurescript). You have the same problem with many open source projects, they are simply not focused on user friendliness, it's certainly not a Clojure specific problem. If you are on Windows the problems are 10x worse. Compare this with e.g. Visual Studio. You install it, and everything just works. Package manager, calling C functions, powerful GUI libraries, IDE with debugger, syntax highlighting, autocomplete, etc. From the first minute on you are programming rather than sysadmining. I wish we had the same experience for Clojure. On Thursday, February 14, 2013 7:42:57 PM UTC+1, BJG145 wrote: Having studied Lisp decades ago I like the look of Clojure a lot. But as a complete newbie when it comes to modern software development, I'm exasperated by what strikes me as a very difficult and primitive set of tools to get started. I keep seeing Leinigen, Leinigen, and the Leinigen homepage boasts that Leinigen offers the easiest way to get started with Clojure, but this simply isn't true. The easiest way to get started with Clojure that I've come across so far is IntelliJ IDEA. If I hadn't found that I'd probably have given up by now. What got me back into programming recently was a Lua-based development environment for Android called Gideros. Lua seems popular for developing apps for some reason. (Cf Corona, Moia,
Re: [ANN] analyze 0.3.0 - Hygienic transformation
Jonas already has another project which uses analyze https://github.com/jonase/eastwood On Fri, Feb 15, 2013 at 12:19 PM, ronen nark...@gmail.com wrote: It looks as if https://github.com/jonase/kibit/ is a lint/check style tool that only reads the source code, this limits its utilization: Kibit readshttp://clojure.github.com/clojure/clojure.core-api.html#clojure.core/read source code without any macro expansion or evaluation. A macro can therefor easily invalidate a rule. Also, kibit will not know if the symbol + in the form (+ x 1) actually refers to a local or to a function in a namespace other than clojure.core. Expect some false positives. So there is a place for an AST based one (more similar to findbugs I guess) On Wednesday, February 13, 2013 9:21:52 AM UTC+2, Ambrose Bonnaire-Sergeant wrote: IMO that's the job of a linter-style tool, which can be written easily with `analyze`. On Tue, Feb 12, 2013 at 11:58 PM, Michael Wood esio...@gmail.com wrote: It might be useful, though, to be able to enable warnings for shadowed variables. On 12 February 2013 17:38, Timothy Baldridge tbald...@gmail.com wrote: This sort of pattern is used quite a lot in clojure (even in core): (let [data (if (string? data) (read-string data) data) data (if (string? (first data)) (first data) (next data)) data (if (string? (first data)) (first data) (next data))] data) Throwing exceptions on overridden variable names would not only break Clojure code, but also is very non-lispy. Timothy On Tue, Feb 12, 2013 at 6:31 AM, AtKaaZ atk...@gmail.com wrote: it makes sense to not throw now that I think about it, when using _ instead of a I'm also thinking of cases like: = (let [a 1] (let [b 2 a 3] (println a b))) 3 2 nil is there something that would let me know I'm overwriting a ? I figure if something like this would slip by would be tough to track down On Tue, Feb 12, 2013 at 1:46 PM, Michael Wood esio...@gmail.com wrote: On 12 February 2013 12:28, AtKaaZ atk...@gmail.com wrote: what would this do: (let [a 1, a 2] a) becomes: (let [a 1, a123 2] a) or (let [a 1, a123 2] a123) or exception[I prefer] It would be the second option, i.e.: (let [a 1, a123 2] a123) The original code is valid, so it would not throw an exception. On Tue, Feb 12, 2013 at 7:10 AM, Ambrose Bonnaire-Sergeant abonnair...@gmail.com wrote: Processing a hygienic AST relieves the burden of worrying about shadowing of locals. Wherever a binding would normally be shadowed, it is instead renamed to a local binding currently not in scope. eg. (let [a 1, a a] a) becomes (let [a 1, a123 a] a123) It can be useful for those processing Clojure's analysis results. Thanks, Ambrose On Tue, Feb 12, 2013 at 1:54 AM, kovas boguta kovas@gmail.com wrote: What is a hygienic AST? Thanks k On Sun, Feb 10, 2013 at 10:45 PM, Ambrose Bonnaire-Sergeant abonnair...@gmail.com wrote: Hi everyone, Happy to release analyze 0.3.0 with new hygienic code transformation capabilities. [analyze 0.3.0] In a line: analyze.hygienic= (- (ast (let [a 1 a a b a a a] a)) ast-hy emit-hy) ((fn* ([] (let* [a 1 a2921 a b a2921 a2922 a2921] a2922 Hygienic AST's have enabled large performance boosts in core.typed. I'm excited to see how it could be as useful to others. Note: hygienic AST's (those transformed with `analyze.hygienic/ast-hy` can be printed normally with `analyze.emit-form/emit-form`, and hygienically with `analyze.hygienic/emit-hy`. https://github.com/frenchy64/**analyzehttps://github.com/frenchy64/analyze Thanks, Ambrose -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clo...@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+u...@**googlegroups.com For more options, visit this group at http://groups.google.com/**group/clojure?hl=enhttp://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups Clojure group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+u...@**googlegroups.com. For more options, visit https://groups.google.com/** groups/opt_out https://groups.google.com/groups/opt_out. -- -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clo...@googlegroups.com Note that posts from new members are moderated -