Re: clojure-scheme - Compiling Clojure to Scheme to C
Great work! Just a question, why Clojure->Scheme->C, instead of Clojure->Clozure? That way there would no be any C compiler dependency. -- Paulo On Mar 14, 10:08 pm, Nathan Sorenson wrote: > I've modified the output of the ClojureScript compiler to emit Scheme code. > At this point the core library is successfully compiled by Gambit Scheme. A > nice advantage of this is that Gambit compiles code via C, meaning that > stand-alone Clojure executables are now available for any platform with a > suitable gcc compiler! > > Gambit, notably, also compiles to iOS. Just recently I've confirmed that > Clojure's core library runs on the iPad simulator. > > There is a ton of yak-shaving required at this point---compilation consists > of a combination of shell commands, Clojure-interpreted commands and > Gambit-interpreted commands. Hopefully this will soon be streamlined. > > https://github.com/takeoutweight/clojure-scheme -- 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
clojurewest talk videos?
Hi, will the videos of the talks be available for those who did not make it to the conference? thx -- László Török -- 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
Try Clojure instance with web based REPL interface.
Hi all, If you want to try couple of quick things without waiting for "lein repl" to fire up, or you are just curious about Clojure but have not managed to install it yet, point your browser at: http://noirmon.herokuapp.com/ringmon/monview.html You will get syntax coloured editor, ability to start/stop Clojure scripts, persistent concurrent sessions and a chat facility to communicate with other people whose sessions are active at the same time. Regards Zoka -- 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
Re: clojurewest talk videos?
On Sun, Mar 18, 2012 at 11:12 AM, László Török wrote: > will the videos of the talks be available for those who did not make it to > the conference? They should be. Everything was video'd in the end. Probably take a few months to get everything sync'd with slides and posted online tho'... -- 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
Creating map from string
Hi, I would like to generate a hashmap from a string. The key portions of the string will have some a prefix such as @ to define that they are a key. So the following string "@key1 this is a value @another-key and another value @test1 and other value" would get converted to. { :@key1 "this is a value", :@another-key "and another value" , :@test1 "and other value"} What's the best way to do this? Thanks, Jimmy -- 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
Re: Creating map from string
You could use a regexp to pick out the key and the value - something like this: (into {} (map (fn [[_ x y]] [(keyword x) (clojure.string/trim y)]) (re-seq #"(@[^ ]*) *([^@]*)" s))) -- Dave -- 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
Re: Creating map from string
On Sun, Mar 18, 2012 at 21:14, David Powell wrote: > (into {} > (map (fn [[_ x y]] [(keyword x) (clojure.string/trim y)]) > (re-seq #"(@[^ ]*) *([^@]*)" s))) I think `for' is cleaner than map + anonymous function: (into {} (for [[_ k v] (re-seq #"(@[^ ]*) *([^@]*)" s)] [(keyword k) (clojure.string/trim v)])) -- Moritz Ulrich -- 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
Re: Creating map from string
argh i come back to paste in my answer and you beat me to it :( i was gonna say: (let [s ""@key1 this is a value @another-key and another value @test1 and other value""] (reduce (fn [m [_ k v]] (assoc m k (string/trim v))) {} (re-seq #"(@[\w-]+)([^@]*)" s))) much the same... On Sun, Mar 18, 2012 at 3:14 PM, David Powell wrote: > > You could use a regexp to pick out the key and the value - something like > this: > > (into {} > (map (fn [[_ x y]] [(keyword x) (clojure.string/trim y)]) > (re-seq #"(@[^ ]*) *([^@]*)" s))) > > -- > Dave > > -- > 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 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
Re: clojure url exception
I created an issue, doesn't look like we are getting a big response on the clojure group, maybe clojure dev? http://dev.clojure.org/jira/browse/CLJ-955 On Saturday, March 17, 2012 5:00:59 PM UTC-4, Brent Millare wrote: > > I still see this in 1.4.0-beta5 >> >> -- 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
Re: The extensible reader
So to answer my own question, this is in 1.4.0. Here is an example: (binding [*data-readers* {'user/f (fn [x] (java.io.File. (first x)))}] (read-string "#user/f [\"hello\"]")) returns # On the best way to pass types around, though, I still think this is an open question. The problem is that, currently, the default print behavior of java objects is an unreadable form like # I think there should be discussion about defaulting this to #java.class.name [args*] this form is still unreadable by default, but with tagged literals, allows users to define custom reader behavior per class. Either that or is there a way to alter the printing behavior of java objects locally, instead of globally as when defining a print-method for that type? On Saturday, March 17, 2012 5:05:40 PM UTC-4, Brent Millare wrote: > > So I just watched the Clojure conj keynote 2011 and I am particularly > interested in the extensible reader component. Is there anything of this > available for testing in master or 1.4.0-beta*? What's the best way to pass > around java types in the reader like s? > -- 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
Re: Resolving vars and quoting
Many thanks for all the replies. Paul On Thu, Mar 15, 2012 at 10:49 PM, Stuart Campbell wrote: > Almost, but you do need to resolve the symbols to functions when you > evaluate the operation: > > (defn arith [x y] > (map (fn [op] [((resolve op) x y) (list op x y)]) '[+ - / *])) > > Regards, > Stuart > > > On 16 March 2012 02:52, Jack Moffitt wrote: >> >> > If I apply the following function to 4 and 6 >> > >> > (defn arith [x y] >> > (map (fn [op] [(op x y) `(~op ~x ~y)]) [+ - / *])) >> > >> > I'd like to get a result of the form >> > >> > ([10 (+ 4 6)] [-2 (- 4 6)] ...) >> > >> > but instead I get something like >> > ([10 (# 4 6)] ... >> >> You want to quote the [+ - / *] so it doesn't resolve to the functions: >> >> (defn arith [x y] >> (map (fn [op] [(op x y) `(~op ~x ~y)]) '[+ - / *])) >> >> jack. >> >> -- >> 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 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 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
Re: Literate programming in emacs - any experience?
On Sat, 2012-01-28 at 06:51 -0800, Folcon wrote: > Hi Tim, > > > Personally if you have done or would be interested in doing a quick > vid cast of how you progress through your workflow, I think that would > be very interesting. Sorry for the delay. Here is the answer to your request. Note that the source and PDF are at: src: http://daly.axiom-developer.org/clojure.pamphlet pdf: http://daly.axiom-developer.org/clojure.pdf I have a quick video of my normal literate programming workflow (ignoring the usual git commits). It shows 3 things: 1) Extracting Clojure from the book and rebuilding the book PDF. 2) adding code chunks and rebuilding clojure and the book 3) making text-only modifications and rebuilding only the PDF. http://youtu.be/mDlzE9yy1mk Tim -- 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
Re: Clojurescript One and Websockets
Hey Jay, Are there any plans to make a ring adapter for webbit? On Friday, March 2, 2012 6:40:27 AM UTC-5, Jay Fields wrote: > > clojure + web sockets, not using aleph: > http://blog.jayfields.com/2011/02/clojure-web-socket-introduction.html > > On Mar 1, 2012, at 10:51 PM, Brian Rowe wrote: > > Hi, > > I'm thinking about using clojurescript one a starting point for a web > game. I would like to use websockets as the primary communication > mechanism between the browser and the server. As far as I know Zack > Tellman's Aleph is the only clojure web server that supports websockets. > Is this true? If so, are there any guides showing how to modify > clojurescript one to use Aleph? If there are no guides, how much work > would it take to modify cljs one to use aleph? > > Thanks! > > -- > 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 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
Clojure code optimizer
Hello, I am a third year student majoring in computer science and I am interested in the Clojure code optimizer project proposed for GSoC 2012. Could you please give more details (or examples) on the types of optimizations the optimizer should be able to do? Also, what is a tree shaker implementation? I was thinking that an optimizer could be implemented as a rule engine similar to Jess or CLIPS in which rules contains patterns which need to be replaced and the code to replace them with. For example one could write patterns for generic linear recursive functions that should be replaced with linear iterative functions. Similarly patterns can be written for functions which replicate the behavior of an already existing function (such as reverse, map, apply etc) and a rule to replace those functions with the predefined ones. Thank you, Andru Gheorghiu -- 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
Clojurescript One Errors
I copied the clojurescript one project and made changes to the html files. When I do (go) after `lein repl` I get errors in the browser about not being able to resolve some namespaces. And also the wiki makes no mention how to compile the project after any modifications to the files. So please I need help on how to do this compilation step as I suspect that could be the cause why all the namespaces are not being resolved properly. John -- 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
ClojureScript error messages
Is there any reason why ClojureScript does not return a source file and line number when there are reader errors? All I get is a long stack trace that only has line numbers for the clojure/clojurescript code that threw - not very helpful. Looking at the source for cljs.compiler/compile-file* and clojure.lang.LispReader, it seems like this information is readily available. A simple catch clause could be added to compile-file* that would wrap the exception with that information. I'd be willing a make a patch and submit 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
Re: how to include external lib with :foreign-libs in ClojureScript One?
On Fri, Mar 16, 2012 at 1:09 PM, George Oliver wrote: > hi, I think I'm almost there but I can't figure out how to include an > external js lib in a cljs one project. What's the correct way to do it > when working in development mode? > OK, I just figured out that :foreign-libs is in pull-requests for One, not master, and got it working. Again moderators, feel free to kill this if you catch 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
how to include external lib with :foreign-libs in ClojureScript One?
hi, I think I'm almost there but I can't figure out how to include an external js lib in a cljs one project. What's the correct way to do it when working in development mode? I have a dependency on unicodetiles.js in project.clj: :git-dependencies [ ["https://github.com/tapio/unicodetiles.js.git"; "8a1922b4977685bc168de147efc2a9c72a958b08"]] And I added that to the classpath (not sure if that's necessary): :extra-classpath-dirs [ ".lein-git-deps/unicodetiles.js/ unicodetiles"] In the compiler options in config.clj I tried adding :foreign-libs following http://lukevanderhart.com/2011/09/30/using-javascript-and-clojurescript.html: (def ^{:doc "Configuration for the sample application."} config { :foreign-libs [{:file "C:/george/work/great-mystery/.lein- git-deps/unicodetiles.js/unicodetiles/unicodetiles.js" :provides ["ut.core"]}] }) And from a view.cljs file tried to require the namespace: (:require [ut.core :as ut])) Working in development mode I get the error: Uncaught Error: Undefined nameToPath for ut.core asserts.js:71Uncaught TypeError: Cannot read property 'Error' of undefined event.js:44Uncaught TypeError: Cannot read property 'EventTarget' of undefined eventtype.js:58Uncaught TypeError: Cannot read property 'IE' of undefined 2base.js:1364Uncaught TypeError: Cannot read property 'prototype' of undefined events.js:996Uncaught TypeError: Cannot call method 'setProxyCallbackFunction' of undefined base.js:1364Uncaught TypeError: Cannot read property 'prototype' of undefined pools.js:137Uncaught TypeError: Cannot read property 'HAS_JSCRIPT' of undefined net.js:10Uncaught ReferenceError: cljs is not defined repl.js:5Uncaught ReferenceError: cljs is not defined base.js:284goog.require could not find: ut.core base.js:287Uncaught Error: goog.require could not find: ut.core animation.js:73Uncaught ReferenceError: cljs is not defined color.js:406Uncaught ReferenceError: cljs is not defined dom.js:156Uncaught ReferenceError: cljs is not defined base.js:1364Uncaught TypeError: Cannot read property 'prototype' of undefined domina.js:785Uncaught ReferenceError: cljs is not defined animation.js:13Uncaught ReferenceError: cljs is not defined remote.js:120Uncaught TypeError: Cannot call method 'call' of undefined html5history.js:50Uncaught TypeError: Object # has no method 'assert' core.js:24Uncaught TypeError: Cannot call method 'call' of undefined extensions/event.js:185Error in event handler for 'undefined': TypeError: Cannot call method 'split' of undefined at chrome-extension://kecaejkkcpijbbnnmnkpcpgiifdplcia/content.js: 11:45 at extensions/miscellaneous_bindings.js:264:13 at [object Object].dispatch (extensions/event.js:183:28) at Object. (extensions/miscellaneous_bindings.js: 164:22) Is :foreign-libs not what I want here? Thanks. -- 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
Re: beginner help with views in ClojureScript One?
On Thu, Mar 15, 2012 at 8:50 PM, George Oliver wrote: > hi, I'm starting to modify the One sample application and can't get > the hang of rendering a new view. I've tried looking at some forked > projects but am coming up short. > This is solved -- looks like I saved but didn't compile and load the snippets macro. Moderators, if you catch this before you approve the first message, feel free to kill the thread. -- 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
Re: 3d modeling tools
AFAIK there's not much projects focussing on 3D in Clojure, but you can take a look at processing (http://processing.org) and one of it's Clojure wrappers. It's a great little language for 2D/3D visuals, and there's plenty of swarm-like demos for it (http://openprocessing.org). For 3D calculations, (verlet) physics and more there's the java library toxiclibs (http://toxiclibs.org), whose author is currently porting/wrapping to Clojure. It's not really a cut-and-dried solution, but it's pretty flexible and has a simple API unlike a lot of 3D projects which focus very narrowly on games development. Regards, Niels Op maandag 12 maart 2012 15:58:43 UTC+1 schreef Lee het volgende: > > > I'm starting a new project involving 3d modeling and I'd like info on > availability of related clojure tools -- and I'd also like to pitch a > related tool-building project for anyone who might be interested in working > on such a thing. > > First, I see from github that penumbra is not under active development. Is > there a more active project or recommended approach for 3d graphics in > clojure? > > How about for physics (especially physics engines that can make use of > large numbers of cores)? > > How about (especially) something that integrates 3D graphics, a simulation > loop architecture, and features like fast neighbor/collision detection? > > What I'd really love more than anything else would be a version of Jon > Klein's "breve" system (http://www.spiderland.org/breve), or a tool with > many of the same features, that makes it really simple to write simulations > in clojure. Breve allows coding in its own language ("steve") and in > python... but it's not being actively developed. I'm not suggesting a > project that actually uses breve's code base (although it's open source and > that would be possible -- also, Jon was my student and developed breve in > part under my funding/direction, and while he has since moved on to other > things he's still reachable and helpful) but rather something independent > that provides similar functionality in the clojure world. > > What functionality do I mean? Well, breve provides lots of goodies > including trivial installation, a nice GUI for coding and running > simulations, painless and pretty 3d graphics, physics, a simulation loop > and event handling architecture, fast collision detection, etc. But I could > see great value in tools that handled only certain subsets of this. > > For example I could definitely see forgetting about the coding GUI since > that's a whole can of worms being dealt with elsewhere in the community, > and also a lot of simulation projects don't need physics. So something that > provided just the 3d graphics and a nice way to set up common simulation > loops (for example, making it easy and concise to code up the "swarm" demo > in breve) would be great. > > I'd love pointers to any tools that anyone thinks are relevant, and > assuming that there's not already a wonderful integrated tool that I don't > know about I'd be happy to correspond/collaborate with anyone who wants to > develop one. > > Thanks, > > -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
beginner help with views in ClojureScript One?
hi, I'm starting to modify the One sample application and can't get the hang of rendering a new view. I've tried looking at some forked projects but am coming up short. I created a basic template /templates/game.html: <_within file="application.html"> My game goes here. I edited /public/design.html to add a link: Form Greeting Play the game And now I can click on the link at http://localhost/design.html and see the template. To check if I can see this in Development mode, in one/sample/ view.cljs I changed the render method for :init, (defmethod render :init [_] (fx/my-initialize-views (:game snippets))) And in one/sample/animation.cljs added: (defn my-initialize-views [game-html] (let [content (xpath "//div[@id='content']")] (destroy-children! content) (set-html! content game-html) )) And in one/sample/snippets.clj modified the macro snippets: (defmacro snippets "Expands to a map of HTML snippets which are extracted from the design templates." [] {:form (snippet "form.html" [:div#form]) :greeting (snippet "greeting.html" [:div#greeting]) :game (snippet "game.html" [:div#game])}) However when I browse to Development the content div is empty -- the html looks like: Does anyone have some suggestions on how to display the game.html template when first browsing to Development? Thanks. -- 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
What is wrong with code
This is the code (ns example.core (:gen-class)) (defn -main [& args] (println "Hello, World")) ;java -cp classes:clojure.jar com.example I can't get this to run ??? -- 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
Keystone, the easiest web framework for Python. How about a 'keystone' for Clojure?
The idea : http://late.am/post/2011/11/27/keystone-a-simple-python-web-framework The doc : http://keystone.readthedocs.org/en/latest/index.html -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new 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
Re: Parallel SSH and system monitoring in Clojure
You might interested in clojure-control[1], which has similar functionality to your library. [1] https://github.com/killme2008/clojure-control On 03/16/2012 06:12 AM, Chris McBride wrote: Hi, I releases two simple clojure libraries to help running commands via SSH on multiple servers. Hopefully someone will find it useful. http://info.rjmetrics.com/blog/bid/54114/Parallel-SSH-and-system-monitoring-in-Clojure https://github.com/RJMetrics/Parallel-SSH https://github.com/RJMetrics/Server-Stats Best, Chris McBride -- Sun Ning Software developer Nanjing, China (N32°3'42'' E118°46'40'') http://about.me/sunng/bio -- 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
Re: Question about this little method I wrote
Thank you everybody who responded to my question! It is appreciated. On Feb 29, 3:14 pm, JuanManuel Gimeno Illa wrote: > A similar version: > > (defn combinations [[x & xs]] > (if xs > (for [e x c (combinations xs)] > (cons e c)) > (map list x))) > > Juan Manuel > > El lunes 27 de febrero de 2012 15:23:30 UTC+1, Bill Caputo escribió: > > > > > > > > > > > Here's a version that uses destructuring (but is otherwise the same) that > > cleans it up a bit: > > (defn combinations [[x & xs]] > > (if xs > > (for [frstitems x tlitm (combinations xs)] > > (flatten (list frstitems tlitm))) > > x)) > > > On Feb 26, 2012, at 9:45 PM, Mike Ledoux wrote: > > > > (defn combinations [items] > > > (if (== (count items) 1) > > > (flatten items) > > > (for [frstitems (flatten (first items)) > > > tlitm (combinations (rest items))] > > > (flatten (list frstitems tlitm) -- 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
understanding data structures, and other low-level stuff
Hi all, I am starting to learn Clojure after buying the book 7 Languages in 7 Weeks (really interesting read) and working through the examples there. But my background is PHP (and no Computer Science degree) so my understanding of data structures and in general, my understanding of low-level CS ideas, is pretty limited to say the least - PHP only has arrays (which I read are only 'ordered hash tables' in fact) and objects so I've never had to think hard about which data structures to use, nor how they actually work. So I guess I'm asking whether anyone can recommend some good primers on data structures, both as they relate to Clojure, but also how they work in the fundamentals - e.g. what exactly is the classic model of an 'array' and how does it work, etc. I have read the various performance commitments for the data-types in Clojure on the .org site but even things like Big O notation are still pretty new to me. I'm sure this stuff is pretty basic for many, but I don't know it and would like to! I'm not afraid of some heavy reading; I'd rather get a really deep and solid grasp of the fundamentals, then a quick surface-level solution. If I'm to develop as a programmer I feel like I need to get looking under the hood as it were, even though I can get by in PHP (for the most part anyway) without this kind of understanding. Thanks in advance, Nic -- 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
Re: Which emacs packages?
I would advice to just to through the emacs tutorial *Emacs Tutorial Learn basic Emacs keystroke commands* link that appears when you start emacs. There are some starter kits around, such as https://github.com/bbatsov/emacs-prelude https://github.com/technomancy/emacs-starter-kit Another advice is to have patience. Emacs is something that I classify as hard fun. So you can enjoy yourself learning it, but it won't be an easy ride. It does pay off, because emacs has decades of being hammered to be a great text crafting environment. Good luck. On Tue, Mar 13, 2012 at 12:09 AM, jaime wrote: > Is there any materials to introduce how to setup emacs env for a beginner? > > 在 2012年3月9日星期五UTC+8上午2时06分49秒,Tassilo Horn写道: >> >> AndyK writes: >> >> > Curious about which emacs packages folks use for increased Clojure >> > productivity (beyond the obvious, like slime/swank-clojure)... >> >> For any lisp: >> >> - paredit >> http://www.emacswiki.org/emacs/ParEdit >> - highlight-parentheses >> http://www.emacswiki.org/emacs/HighlightParentheses >> >> For any programming: >> >> - highlight-symbol >> http://www.emacswiki.org/emacs/HighlightSymbol >> >> 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 -- Eduardo Bellani "Resolve to serve no more, and you are at once freed." -- 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
Re: ANN: A Brief Beginner's Guide to Clojure
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 14/03/2012 18:24, John Gabriele wrote: > I wrote a [brief beginner's guide to Clojure][1] that might interest > those who are brand new to Clojure. > > [1]: http://www.unexpected-vortices.com/clojure/brief-beginners-guide/ > > First paragraph: "The purpose of this brief (and sometimes > opinionated) guide is to get new users quickly set up with and > acclimated to the Clojure landscape so they can then begin working > through other materials to learn the language itself." > > Thank you to the folks on #clojure (IRC) for feedback yesterday. Thanks for this, John. I'm just beginning with Clojure myself & just happen to have a Debian box handy too :-) Cheers, Phil... - -- But masters, remember that I am an ass. Though it be not written down, yet forget not that I am an ass. Wm. Shakespeare - Much Ado About Nothing -BEGIN PGP SIGNATURE- Version: GnuPG/MacGPG2 v2.0.17 (Darwin) Comment: §auto-key-locate cert pka ldap hkp://keys.gnupg.net Comment: GPGTools - http://gpgtools.org Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iQEcBAEBAgAGBQJPYhciAAoJEKpMeDHWT5ADhjUH/1UX/fdovrBzupJDXZvltLFC 3a9dtvSVKpCke7mhBB4XI74k3j/ITeHsa19Wzt51gHUtRTUeIWq6dLQhs5EGoWSV zzFNVZYF+SF5ntg9TDc/ttvQ+8SX/8sSXiGCl3Z9kb25E8ld2huOvd19oujvl77/ 30Lv87DBP2DvQqmeVbH567kAySPnLKdc6gOpnP/A9cdLPJNNkexn+RbcvbulOKAd BYEK9UjKUtoFvdQ1k9FLcQqgJ2V5IfnoXAi3omf6+zyLkV3g62LXmeIkcDz/J+Iy 0nWJ7N3X8/NEHrGwUa2yWaSDCGDy41ytpMfeJJ4NGZdkm50xwJg7tb+6s/4olDA= =OPKf -END PGP SIGNATURE- -- 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
Re: What is wrong with code
On Thu, Mar 15, 2012 at 10:36 PM, jayvandal wrote: > This is the code > > (ns example.core > (:gen-class)) > > (defn -main [& args] > (println "Hello, World")) > > ;java -cp classes:clojure.jar com.example Where is com.example coming from? Your namespace is example.core --Aaron -- 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
Re: understanding data structures, and other low-level stuff
Feel free to ask follow-up questions on the basics privately, since many Clojure programmers are probably already familiar with them, whereas follow-up questions on persistent data structures are very on-topic, since I would guess many people who have studied computer science and/or programming for a while may not be familiar with them. The classic model of an array is based upon the implementation of physical RAM in a computer: a physical RAM, at a high level and leaving out details of variations, is a device where you either give it a command READ and an address, and it returns an 8-bit byte stored at that location, or you give it a WRITE command, an address, and an 8-bit value, and it stores the 8-bit value at the location given by the address. A classic array is a one-dimensional structure indexed by an integer i, usually from 0 up to some maximum value N, and every item in the array stores an item of the same size and type, e.g. all 32-bit integers, or all pointers to some object elsewhere in the memory. If every item fits in exactly B bytes, and the first item of the array begins at address A in the memory, then item i will be at address A+B*i in the memory. In terms of performance, computers are designed to be able to access any address in their memory in the same amount of time, no matter what address it is stored at, so with a couple of instructions to calculate A+B*i, the computer can read or write any element of an array within a constant amount of time (constant meaning it doesn't get larger or smaller depending upon the size of the array -- it is always the same no matter the array's size). With other non-array data structures like trees, accessing an element takes longer as the data structure grows to contain more items. I don't recall if it covers persistent data structures like the ones most commonly used in Clojure, but Cormen, Leiserson, and Rivest's "Introduction to Algorithms" is used in many colleges as a text in courses on algorithms and data structures. There are probably other books that would be better as a "primer", and it does assume you are comfortable with at least algebra and a bit more math, but if you got through a chapter of it and understood even half of it, you'd have learned something worth knowing about the subject. http://www.amazon.com/Introduction-Algorithms-Includes-CD-Rom-Thomas/dp/0072970545/ref=sr_1_2?ie=UTF8&qid=1332128117&sr=8-2 There is a newer edition than the one I linked to, but an older used copy for $25.00 might be closer to what you want if you aren't sure yet. Andy On Mar 15, 2012, at 12:15 PM, Nic Long wrote: > Hi all, > > I am starting to learn Clojure after buying the book 7 Languages in 7 > Weeks (really interesting read) and working through the examples > there. But my background is PHP (and no Computer Science degree) so my > understanding of data structures and in general, my understanding of > low-level CS ideas, is pretty limited to say the least - PHP only has > arrays (which I read are only 'ordered hash tables' in fact) and > objects so I've never had to think hard about which data structures to > use, nor how they actually work. > > So I guess I'm asking whether anyone can recommend some good primers > on data structures, both as they relate to Clojure, but also how they > work in the fundamentals - e.g. what exactly is the classic model of > an 'array' and how does it work, etc. I have read the various > performance commitments for the data-types in Clojure on the .org site > but even things like Big O notation are still pretty new to me. > > I'm sure this stuff is pretty basic for many, but I don't know it and > would like to! > > I'm not afraid of some heavy reading; I'd rather get a really deep and > solid grasp of the fundamentals, then a quick surface-level solution. > If I'm to develop as a programmer I feel like I need to get looking > under the hood as it were, even though I can get by in PHP (for the > most part anyway) without this kind of understanding. > > Thanks in advance, > > Nic > > -- > 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 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
Re: ClojureScript error messages
On Fri, Mar 16, 2012 at 6:11 PM, Aaron wrote: > Is there any reason why ClojureScript does not return a source file and > line number when there are reader errors? All I get is a long stack trace > that only has line numbers for the clojure/clojurescript code that threw - > not very helpful. > > Looking at the source for cljs.compiler/compile-file* and > clojure.lang.LispReader, it seems like this information is readily > available. A simple catch clause could be added to compile-file* that > would wrap the exception with that information. I'd be willing a make a > patch and submit it Please do! David -- 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
Re: understanding data structures, and other low-level stuff
On Sun, Mar 18, 2012 at 11:57 PM, Andy Fingerhut wrote: > I don't recall if it covers persistent data structures like the ones most > commonly used in Clojure, but Cormen, Leiserson, and Rivest's "Introduction > to Algorithms" is used in many colleges as a text in courses on algorithms > and data structures. Funny you should mention that. Guess what there's always a copy of on the shelf directly above my computer in my office. -- 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