Re: [ANN] Grimoire 0.2.0
Great UI improvement, nice work! -- 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/d/optout.
Re: [ANN] Grimoire: up to date Clojure web docs
I'd also love to see a custom domain for this as well. I'm happy to pay for it if no one else will. How about clj-docs.org or clj-doc.org (which are available)? I do see clojuredoc.org is available but could easily be confused with clojuredocs.org There's also clojure-doc.org. -- 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/d/optout.
Re: Game logic with Clojure
On Monday, June 23, 2014 12:54:56 PM UTC-7, Majen Ful wrote: Could you give me some tips and lead me to the right things to do. There's also this often referenced series of posts that might help, http://prog21.dadgum.com/23.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 --- 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/d/optout.
Re: Leiningen Clojure REPL in Windows doesn't accept arrow keys.
Arrow keys (left/right movement and up for history) on my lein repl in Windows XP works fine. Sounds like something on your system. -- 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/d/optout.
Re: cloure-mode indenting (or not)
On Friday, October 11, 2013 2:33:54 PM UTC-7, naipmoro wrote: The other strange thing, auto-indent no longer works; I have to hit the TAB key after ENTER to get indentation. I can't believe *that* was intentional (famous last words). So something must've broke. I think it was intentional. Possibly related to this, https://github.com/clojure-emacs/clojure-mode/issues/29 -- -- 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 reload Clojure files while connected to Clojurescript browser repl in Emacs?
On Sunday, October 6, 2013 1:26:21 PM UTC-7, Tim Visher wrote: That sounds really cool. I was not aware that Austin could do this. Do you have any pointers to documentation about it? Again, my model of how the system works is that the browser _is_ the repl, so refreshing the browser completely resets you back to the last time the clojurescript was built. The Austin sample project is a good example, https://github.com/cemerick/austin/blob/master/browser-connected-repl-sample/README.md . I could be wrong but my understanding is that the browser is just connecting to your cljs repl which actually is in the 'clojure repl'. Certainly if you refresh the page state built up in the browser is reset, but state in the cljs repl is a different story. -- -- 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 reload Clojure files while connected to Clojurescript browser repl in Emacs?
On Sunday, October 6, 2013 11:15:26 PM UTC-7, George Oliver wrote: I could be wrong but my understanding is that the browser is just connecting to your cljs repl which actually is in the 'clojure repl'. Certainly if you refresh the page state built up in the browser is reset, but state in the cljs repl is a different story. Well, that'll teach me to make a claim without verifying it first -- state in the repl -is- refreshed on a page refresh. -- -- 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 reload Clojure files while connected to Clojurescript browser repl in Emacs?
On Sunday, September 29, 2013 8:12:23 PM UTC-7, Tim Visher wrote: Now with nrepl's ability to have multiple sessions open at once (an ability I haven't taken any advantage of personally), you should be able to have a JVM nrepl open _and_ a browser repl nrepl session, both of which would be modifying client and server sides of the code respectively. Tim, yes I think this is possible (I've read that people can do this with vim and Eclipse), I just haven't found a good working method yet for Emacs and nrepl.el. And it's true I haven't really thought ahead to whether this workflow is a good idea or not :), but I would like to give it a try. The functionality in Austin enables browser refreshes while maintaining a connected browser repl, dealing with state is another issue. After reading more on the nrepl.el list I found some relevant posts, [1] [2], and I was able to get things to work using nrepl-make-repl-connection-default though it's not that smooth (and all manual at the moment). [1] https://groups.google.com/forum/#!topic/nrepl-el/tfsHaDTsYxY [2] https://groups.google.com/forum/#!topic/nrepl-el/9xl6yd51tbQ -- -- 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: Problems starting with Clojure and Leiningen and Light Table
To add to Shantanu's directions, if you receive an error when doing mkdir in C:\ it's probably because your user account doesn't have permissions to create directories there. At that point you have two basic options: 1) use a user account with admin privileges to do all your work (not recommended) 2) create your work account in your user directory (e.g. C:\Users\Zeynel\work) To add lein to your PATH, follow these steps: http://geekswithblogs.net/renso/archive/2009/10/21/how-to-set-the-windows-path-in-windows-7.aspx -- -- 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 reload Clojure files while connected to Clojurescript browser repl in Emacs?
I sent this to Clojure-tools before I realized that list is not really for support questions, apologies for the crosspost. I'm hoping someone can help me fit the missing piece in this workflow: (this works) 1. nrepl-jack-in in Emacs 2. launch web server from nrepl, modify Clojure files and reload (C-c C-k), refresh browser to see changes 3. launch browser repl from Emacs nrepl, connect it to the browser (using Austin [0], works great) (this doesn't work) 4. while connected with browser repl, modify Clojure files and reload, refresh browser to see changes All with the goal of being able to reload server-side code and also have the live browser repl to interact with the client-side. So far step 4 seems to reload Clojure code into the Clojurescript repl, obviously this won't work. I tried to connect two nrepl sessions to the same nrepl server following this thread [1] as so: 1) call nrepl-jack-in to start a server 2) get *nrepl* buffer for Clojure session 3) connect to the same server once more to get *nrepl*2 4) rename it to *cljs-repl* 5) make nrepl-nrepl-buffer local 6) set value of nrepl-nrepl-buffer to *cljs-repl* in cljs buffers I got everything up to (5), but setting nrepl-repl-buffer (I think that's what he meant ??) buffer local to my cljs file then doing step 6 didn't have any effect. I don't know much of elisp or Emacs though so I'm not sure if I followed those steps correctly. There have been some recent threads on this topic [2] but no complete solution as far as I can tell. thanks for any help, George [0] https://github.com/cemerick/austin [1] https://groups.google.com/forum/#!topic/clojure-tools/C0jND-uuV28 [2] https://groups.google.com/forum/#!topic/clojure-tools/aCk59YTUV_I -- -- 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: Design/structure for a game loop in clojure
On Sunday, May 19, 2013 6:02:23 PM UTC-7, Daniel Wright wrote: thoughts/guidance appreciated! You might get something out of http://clojurefun.wordpress.com/2013/03/ -- In this (somewhat extended) post I’m going to describe my experiences using Clojure for the 7DRL challenge – with discussion how to get the most out of Clojure for game development. The issue I'm having is that this system results in rather a lot of looping through every entity in the world. I'm not sure if this works with your code design, but can you reduce that by subscribing entities only to specific events? -- -- 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: noob question about try/catch
On Friday, April 26, 2013 8:01:45 AM UTC-7, larry google groups wrote: I thought I had written the try/catch blog so that this exception would be logged, but otherwise ignored. Instead, this exception stops my app cold -- the app stops. See http://clojure.org/special_forms#try , you're still responsible for the logic in the catch to ignore the exception. -- -- 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: Advice on state handling for a multiplayer poker app
On Thursday, April 11, 2013 2:35:03 PM UTC-7, James Adams wrote: How would you do this? All thoughts welcome and appreciated To simplify matters you could think about decoupling the incoming game events from the state changes; for example, have a queue hold game events and then serially apply those to the game state (which in that case could simply be contained in a map). -- -- 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 create dependncies for mysql in clojure
On Sunday, April 7, 2013 4:03:46 PM UTC-7, jayvan...@gmail.com wrote: I want to access mysql. it is in c:\program files as mysql what is the rule to create a dependicy statement [mysql/mysql-connector-java 5.1.23]]. I have two books Practical Clojure Programming Clojure No answer in the books that I find That looks right, what errors are you getting? -- -- 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: Invoke a specific multimethod
On Friday, March 29, 2013 6:19:19 PM UTC-7, JvJ wrote: Is it possible to invoke a particular multimethod and bypass the dispatch function? For instance, suppose that I have a multimethod with a dispatch value of ::foo, and it's a really complex method. Now, I want all cases where the dispatch function returns nil to use the same multimethod. Is there a way I can intercept the nil and pass it directly on to the ::foo multimethod? You could use the default multimethod to catch nil, and then call the multi with ::foo. -- -- 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: Debug prints don't execute on multimethod dispatch functions
On Sunday, March 24, 2013 12:49:40 PM UTC-7, JvJ wrote: I started using the meta-type function for dispatch, but then started using debug-switch. It actually works fine, running the appropriate version of the method, but the println doesn't execute. Does anyone know why? Not sure, but is it possible you're running afoul of a redefined defmulti not overriding the original defmulti in the REPL? Try clearing the defmulti with a (def dispatch-fn nil) and then reloading the defmulti? -- -- 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: Debug prints don't execute on multimethod dispatch functions
On Sunday, March 24, 2013 3:01:53 PM UTC-7, George Oliver wrote: Not sure, but is it possible you're running afoul of a redefined defmulti not overriding the original defmulti in the REPL? Try clearing the defmulti with a (def dispatch-fn nil) and then reloading the defmulti? Sorry, of course that should be (def testmulti nil) -- -- 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: Coding while running the program
On Saturday, March 23, 2013 7:22:14 AM UTC-7, Oskar Kvist wrote: Hi! I saw this video http://www.youtube.com/watch?v=BES9EKK4Aw4 of Notch coding on Minecraft while the game was running, and of course seeing the changes in the running program. He used some kind of debug mode in his IDE (I don't really know which IDE). I want to make a game, and I want to to also be able to code while the program is running. I think Notch uses Eclipse, which allows you to hot load (reload) code on the fly (and I believe tweak state in the debugger but I haven't done that). Funny you should post this, I just watched a video yesterday that you might like to see, http://vimeo.com/14709925 He's using Emacs in that video. Eclipse has the Counterclockwise plugin for Clojure if you prefer. I definitely would recommend using something like those over a plain REPL. See also this SO answer, http://stackoverflow.com/a/5119355/216798 . You shouldn't have to mess with JVM settings but there are a few things to keep in mind doing interactive development. However it's probably best to get started with the links above and then come back here with specific questions. -- -- 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: Coding while running the program
Also, I forgot to mention this, http://www.lighttable.com/ -- -- 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: Clojure HTML5 Game Development
On Tuesday, March 12, 2013 1:34:21 PM UTC-7, Reginald Choudari wrote: Any resources/people dedicated to game development using Clojure/Clojurescript? I have made a couple games using HTML5/Javascript with the canvas element, and seeing that Clojurescript can replace Javascript coupled with Clojure hosting an HTTP web server, I was thinking of moving over to the Clojure way of coding things.. Any suggestions? There are some links here, http://lispgames.org/index.php/Clojurescript -- -- 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: Windows Installation
On Friday, March 8, 2013 7:55:59 PM UTC-8, James Ashley wrote: But the bare-bones part of the installation process Just Worked. I agree, things are working well on Windows lately! It's pretty great. I've never bothered with cygwin. Some lightweight alternatives might be the bash shell provided with msys git or Gow. -- -- 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.
does a future call redirect printlns?
hi, I could use some help figuring out why this is working the way it is. It seems like a future function call is rebinding *out* so I don't see some printlns at the repl. I have a couple of functions for a server like this, (defn run [handler] (let [server (create-server) selector (:selector server) start (fn [] (future (handler server))) shutdown (fn [] (println Shutting down...) (doseq [k (.keys selector)] (.close (.channel k))) (.close selector) (println ...done.) )] {:server server :start start :shutdown shutdown})) (defn app [server] (let [acceptor (:acceptor server) selector (:selector server)] (println Starting Ex v Arcis on (.getLocalAddress acceptor)) (while (.isOpen selector) (select! selector) (echo-all (filter #(and (.isValid %) (.attachment %)) (.keys selector))) (Thread/sleep 3000)) (println after))) And a repl session looks like this, exvarcis.core (def my-server (run #'app)) #'exvarcis.core/my-server exvarcis.core ((:start my-server)) #core$future_call$reify__6110@1f9c9e3: :pending Starting Ex v Arcis on #InetSocketAddress /127.0.0.1:1325 exvarcis.core ((:shutdown my-server)) Shutting down... ...done. nil exvarcis.core So I never see the after called after the while loop. If I comment out the while loop, I do see it. Anyone have a clue why this is working like it is? thanks, George -- -- 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.
libs and resources for upcoming 7 day roguelike challenge?
hi, I've made a short list of Clojure resources for the upcoming 7 day roguelike challenge [1] [2], but I feel like I'm missing a few libs and games I've seen mentioned before. If anyone could jog my memory I'd appreciate it. In particular I feel like I saw a cljs roguelike link on Twitter last year but I couldn't find it again. Here's what I have at the moment: libs (for Clojurescript) http://tapiov.net/unicodetiles.js/ http://ondras.github.com/rot.js/hp/ (for Clojure) https://code.google.com/p/blacken/ https://github.com/SquidPony/SquidLib https://github.com/sjl/clojure-lanterna/ games https://github.com/thomcc/dunjeon http://stevelosh.com/blog/2012/07/caves-of-clojure-01/ thanks, George [1] http://7drl.roguetemple.com/ [2] http://roguebasin.roguelikedevelopment.org/index.php?title=7DRL -- -- 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.
beginner would like help with refactoring some functions in basic echo server
hi, I'm working on a basic single-threaded echo server for fun and learning (short-term goal is to have a simple chat server), and I'm at a point where I'd appreciate some feedback on refactoring a few functions. I've put them in a paste here, https://www.refheap.com/paste/12068 with some comments to explain the logic (or lack of it, as the case may be!). What I'd really appreciate are comments on: * better ways to isolate changing state in the clients' ByteBuffers from reading these buffers -- since the act of reading a buffer changes its state in the first place this gets a little hairy. * maybe some better practices in dealing with ByteBuffers in the first place, this is the first time I've used them directly. thanks for any help, George -- -- 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.
wrapping multimethods?
hi, I'm interested in what techniques are useful for adding functionality to multimethods without modifying the defmethod itself. A while back I asked a similar question [1] and there are good answers there, but recently I've been looking at simple concepts like Ring middleware and wrapping functions with functions defining :pre and :post conditions, and now wonder if there isn't a similar idea for multimethods. My code is a basic socket server with a defmulti that dispatches based on whether the socket is ready to accept, read, etcetera. I would like to add behavior to the defmethods in a simple and composable way and keep concerns separate (for example separating reading a socket from checking if it's actually closed). Here's a paste, https://www.refheap.com/paste/11861. thanks, George [1] https://groups.google.com/forum/?fromgroups=#!searchin/clojure/george$20before$20after/clojure/beqWiVSn8ws/CihDwDumLDQJ -- -- 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 understand differences in results for nrepl.el interrupt evaluation (C-c C-b)?
hi, I am experimenting at the repl with a while form. For now I just write it as (while true ...) and interrupt it with C-c C-b. This is for a basic socket server. Recently I noticed a difference in how C-c C-b behaves that I don't understand. Normally when I interrupt, the repl returns immediately to the prompt, regardless of the client state. However if I swap one function for another, when I interrupt the repl doesn't return to the prompt until I initiate some action on the client end -- say, close the connection on the client end, or if all connections are closed, try to open a new connection. Is there a rule of thumb for under what conditions the repl will return to the prompt on an interrupt? -- -- 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: recommended way to write loop where a binding depends on a previous 'useless binding' operation?
@Baishampayan, I'm just experimenting at the repl right now so there's no stopping condition yet. It's a socket server. On Monday, February 11, 2013 11:56:22 PM UTC-8, Evan Mezeske wrote: Generally when you are calling functions that have (and depend on) side-effects, you will end up using do a lot. Also, I noticed that in your example there's really no reason to make the x and y bindings part of the loop. I hadn't thought about using a let in the loop but you're right, I could just as easily bind in a let. Is there a benefit to doing it there rather than in the loop binding? Maybe it makes it easier to read? -- -- 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: recommended way to write loop where a binding depends on a previous 'useless binding' operation?
On Tuesday, February 12, 2013 9:52:35 AM UTC-8, Evan Mezeske wrote: The big advantage to my reorganization of your loop is that it doesn't have an unused x binding. [] Good points Evan, thank you! -- -- 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.
recommended way to write loop where a binding depends on a previous 'useless binding' operation?
hi, I have a loop that looks like this, (loop [x (a-function) y (another-function)] ; another-function must be called after a-function () ; x is not used in body (recur (a-function) (another-function))) This gets the job done (my a-function is a select() call which I don't use the return value of in the body), but it feels a little hacky so I'm wondering what's a better way? -- -- 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: Clojure Wiki
There might be some good information here to carry over, http://www.gettingclojure.com/start . -- -- 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.
techniques to work with Java mutable collections?
Hello, I'm writing a single-threaded TCP server for a bit of fun and learning, so I'm dealing with java.nio. I'm wondering how people here like to deal with mutable Java collections from Clojure. For example, I need to use java.nio.Selector and its Set of selected-keys (the channel sockets registered with it). I need to add to and remove from this Set regularly to process new connections, reads, and writes. Is this just a situation of needing to isolate I/O from other parts of my Clojure program, or are there additional techniques to keep in mind when working with collections like selected-keys? Thanks for any feedback. -- -- 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: Installing Clojure on Windows 7
On Thursday, January 24, 2013 12:56:59 PM UTC-5, sampso...@googlemail.comwrote: Apparently installing a development environment for Clojure on Windows 7 is very difficult. What is the best way, that has a chance that it might work? I just wanted to repeat the link that Phil Hagelberg posted earlier, as it seems like it got lost a little in the thread: http://clojure-doc.org/articles/tutorials/emacs.html This is an excellent current tutorial. I just installed a complete Windows setup and it took 5 minutes to go from zero to nrepl-jack-in. I have a related question, do I need a contributor agreement filed to make changes to http://dev.clojure.org/display/doc/Getting+Started+with+Emacs ? I have an account there but can't find the edit option for that page. -- -- 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: Installing Clojure on Windows 7
On Saturday, January 26, 2013 7:01:34 PM UTC-8, Ravi Sundaar wrote: I am running into problems getting emacs (24.2) to work with clojure as well on windows 7. I have installed leiningen fine. Clojure (1.4.0) itself seems to be behaving. The packages seem to install fine in emacs - no problems. When I invoke nrepl-jack-in from emacs, I get an Access Denied error. No idea what that could be. There does not seem to be any discussions on this on the web. Any thoughts? Should I abandon the emacs approach on windows and choose a different editor? No, Emacs works perfectly well on Windows. What packages did you install and how did you install them? -- -- 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: Installing Clojure on Windows 7
On Thursday, January 24, 2013 10:22:41 AM UTC-8, Sean Corfield wrote: Having now setup an Emacs-bsaed dev environment on XP and multiple Windows 8 machines, I no longer think it's as difficult as some people make it out to be. Sean, have you been using lein trampoline successfully on Windows? The last time I tried there was a persistent bug that hadn't been tracked down. -- -- 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: EOF when executing lein trampoline cljsbuild repl-listen
On Sunday, December 23, 2012 3:30:53 PM UTC-8, Mark wrote: I figure the reader is trying to load the project.clj but I'm executing from the project's root directory. I'm using lein 2.0 preview 10 on a Windows 7 machine if that matters. This might be a Windows + trampoline problem. See https://groups.google.com/d/msg/clojure/J0imbgVWh5I/lXL8DlvJxAoJ . -- 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] new book: ClojureScript: Up and Running
On Monday, November 19, 2012 8:18:16 PM UTC-8, puzzler wrote: Then, at the command prompt I typed: lein trampoline cljs-build repl-rhino and got the following error message. I'm running on Windows. Any idea what's going wrong? Thanks. These kinds of errors usually mean a file path or constructed command line is misquoted, double-quoted where it shouldn't be, etcetera. For example see issues like this, https://github.com/technomancy/leiningen/issues/674. Not sure myself what the problem is here since it seems like most of these issues have been closed but maybe there's something still there. -- 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] new book: ClojureScript: Up and Running
On Monday, November 19, 2012 9:34:29 PM UTC-8, puzzler wrote: Ugh, I should have guessed. My attempts to do clojurescript several months back were foiled by trampolining problems, but that was on lein 1.7. I was under the impression those problems had been fixed in lein 2.0, so I had expected it to work, but it looks like there is still an issue. Any easy workaround? VirtualBox? :) -- 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
architecture for distributed game server?
hi, apologies if this is slightly off-topic but I'd appreciate advice on something I don't have much experience with. I'm writing a mud (multiplayer text game) where you can write the game logic in different programming languages; for example, the combat system in Ruby and the movement system in Clojure. The different systems communicate over sockets with a central Clojure server which handles player connections. Message queues seem like a good solution for the interprocess communication so I'm looking at brokers like RabbitMQ. My question is, does a message broker like RMQ seem like overkill for what is basically a small-scale application (most muds never run more than a couple dozen game systems and see more than a couple of hundred player connections), and if so, is there is a more lightweight alternative that you would recommend? thanks, George -- 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: newbie question regarding maps
On Monday, September 24, 2012 3:04:42 AM UTC-7, Mond Ray wrote: As you can see the REPL gives me an error stating that the keys must be Integers. Is that right? Or is my call process faulty? I think the problem is that wish-lists is a vector, so you need a key for the vector first (e.g. 0, 1. etc.) in assoc-in. That's what the error is saying. -- 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-clr question
On Sunday, September 9, 2012 5:20:13 PM UTC-7, James Ashley wrote: I don't want to add noise to this group. Is there somewhere more appropriate to ask? (The wiki on the site doesn't seem to fit). No apologies necessary, this is the list according to the clojure-clr readme. -- 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: deployment
On Friday, August 24, 2012 4:03:32 AM UTC-7, David Della Costa wrote: What I ended up feeling like was, these are the options more or less: Thanks David, this plus your github link is a great write-up and exactly what I was hoping to find by posting to the list. Regarding #3, if you're going to run Jetty standalone then Josh's link to Immutant seems like a good choice to consider. There's a couple of other interesting links I've found that might shed some light on .war's, Jetty, and other means of deployment: https://groups.google.com/forum/#!topic/aleph-lib/wyHuMKfle1A https://groups.google.com/forum/#!topic/clj-noir/C9D1Dc02w4Q best, George -- 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
deployment
hi, I'm a Clojure beginner working on a web project and starting to think about deployment. Currently I host my project in a local VM and have a small VPS for public testing. Looking down the road I'd like a more flexible hosting solution. It seems like the hosting landscape is changing fast so I'd like to know -- how do you deploy your projects 'now'? So far I've found stuff like: * A continuum of Clojure support from cloud providers, with some free tiers at AWS, Heroku, Openshift, etc. * tools like lein-beanstalk for hosting apps on Elastic Beanstalk * libraries like appengine-magic for hosting on GAE * libraries like pallet for abstracting deployment to multiple cloud providers * many more tools depending on how much 'more Java' you're willing to incorporate into your project, for example deploying a WAR in a Tomcat container (not even sure I have the lingo right there! :) ) * combining these tools and libraries with CI tools such as Jenkins for a complete automatic develop - build - deploy solution. From what I've seen, and given that (a) I have a small project (probably not more than 5k users eventually) and (b) I'm not a professional programmer, but (c) I'd like to manage this in a professional way, it seems like a strategy could be: 1. use a tool like lein-beanstalk for public deployment and use simple scripts for building 2. in the meantime get familiar with pallet for more flexibility in the future 3. eventually deploy using pallet 4. at this point learn a CI tool to fully automate the process. What do you think? thanks, George -- 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: auxiliary methods like :before and :after for multimethods?
On Friday, July 27, 2012 12:06:33 PM UTC-7, Vinzent wrote: robert-hooke actualy doesn't work with multimethods afaik. You can try my new library (https://github.com/dnaumov/hooks), but it's alpha (no docs yet, sorry). Yes, from the robert-hooke readme, Adding hooks to a defmulti is discouraged as it will make it impossible to add further methods. Hooks are meant to extend functions you don't control; if you own the target function there are obviously better ways to change its behaviour.. What got me thinking about :before and :after was the question of how to add a lightweight rules system to an application. Do you think hooks are appropriate here? -- 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
auxiliary methods like :before and :after for multimethods?
hi, I'm wondering if anyone has extended multimethods with auxiliary methods like CL-style :before and :after, and if not what a suitable substitute might be. thanks, George -- 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
lein-cljsbuild simple example on Windows XP with lein2, Could not locate example/routes__init.class or example/routes.clj on classpath
hi, I'm trying to get lein-cljsbuild running on Windows XP. I copied the simple example at https://github.com/emezeske/lein-cljsbuild/tree/master/example-projects/simple and then did $ lein cljsbuild once $ lein ring server-headless 3000 Which gives the error, C:\george\work\simplelein ring server-headless 3000 Exception in thread main java.io.FileNotFoundException: Could not locate example/routes__init.class or example/routes.clj on classpath: at clojure.lang.RT.load(RT.java:432) at clojure.lang.RT.load(RT.java:400) at clojure.core$load$fn__4890.invoke(core.clj:5415) at clojure.core$load.doInvoke(core.clj:5414) at clojure.lang.RestFn.invoke(RestFn.java:408) at clojure.core$load_one.invoke(core.clj:5227) at clojure.core$load_lib.doInvoke(core.clj:5264) at clojure.lang.RestFn.applyTo(RestFn.java:142) at clojure.core$apply.invoke(core.clj:603) at clojure.core$load_libs.doInvoke(core.clj:5298) at clojure.lang.RestFn.applyTo(RestFn.java:137) at clojure.core$apply.invoke(core.clj:603) at clojure.core$require.doInvoke(core.clj:5381) at clojure.lang.RestFn.invoke(RestFn.java:421) at user$eval1.invoke(NO_SOURCE_FILE:1) at clojure.lang.Compiler.eval(Compiler.java:6511) at clojure.lang.Compiler.eval(Compiler.java:6500) at clojure.lang.Compiler.eval(Compiler.java:6477) at clojure.core$eval.invoke(core.clj:2797) at clojure.main$eval_opt.invoke(main.clj:297) at clojure.main$initialize.invoke(main.clj:316) at clojure.main$null_opt.invoke(main.clj:349) at clojure.main$main.doInvoke(main.clj:427) at clojure.lang.RestFn.invoke(RestFn.java:421) at clojure.lang.Var.invoke(Var.java:419) at clojure.lang.AFn.applyToHelper(AFn.java:163) at clojure.lang.Var.applyTo(Var.java:532) at clojure.main.main(main.java:37) Does anyone know what the problem might be? Another weird thing about this is if I try a lein repl from this project, I get: C:\george\work\simplelein repl nREPL server started on port 1740 Welcome to REPL-y! Clojure 1.4.0 Exit: Control+D or (exit) or (quit) Commands: (user/help) Docs: (doc function-name-here) (find-doc part-of-name-here) Source: (source function-name-here) nil (user/sourcery function-name-here) Javadoc: (javadoc java-object-or-class-here) Examples from clojuredocs.org: [clojuredocs or cdoc] (user/clojuredocs name-here) (user/clojuredocs ns-here name-here) The cursor then freezes on the last line. However doing a lein repl from an empty project made with 'lein new' (and making sure Clojure 1.4 is specified in dependencies) works normally. thanks for any help, George -- 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: lein-cljsbuild simple example on Windows XP with lein2, Could not locate example/routes__init.class or example/routes.clj on classpath
On Sunday, July 15, 2012 12:00:57 AM UTC-7, George Oliver wrote: hi, I'm trying to get lein-cljsbuild running on Windows XP. I copied the simple example at https://github.com/emezeske/lein-cljsbuild/tree/master/example-projects/simple I think I found a fix for this; in the example project.clj there is the option :source-path src-clj I changed this to :source-paths [src-clj] (per https://github.com/technomancy/leiningen/blob/master/sample.project.clj ) And the example project instructions worked. -- 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: lein-cljsbuild simple example on Windows XP with lein2, Could not locate example/routes__init.class or example/routes.clj on classpath
On Sunday, July 15, 2012 1:17:04 PM UTC-7, Evan Mezeske wrote: Since Leiningen 2.x has not yet been released, lein-cljsbuild uses Leiningen 1.x for both the example projects, and building the plugin itself. The problem you ran into is a difference between Leiningen 1.x and 2.x. I created an issue to make sure that this fact is made more clear: https://github.com/emezeske/lein-cljsbuild/issues/107 . Thanks; do you know of a project that uses the latest cljsbuild with lein 2 I could try to test? I was able to launch the ring server in the advanced project, but I'm still failing launching the repl. -- 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: lein-cljsbuild simple example on Windows XP with lein2, Could not locate example/routes__init.class or example/routes.clj on classpath
On Sunday, July 15, 2012 3:15:34 PM UTC-7, Evan Mezeske wrote: Thanks; do you know of a project that uses the latest cljsbuild with lein 2 I could try to test? Not off the top of my head. Unfortunately, github's search tool is junk, otherwise it might be possible to find something there... I had a go with the clojurescript branch of hiccup ( https://github.com/r0man/hiccup/tree/clojurescript ). From its project.clj it looks like it's using lein2 with cljsbuild 0.2.4. However it seems I'm running into the same issue. I've sent it to the lein mailing list -- 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: any advice for translating the book The Joy of Clojure?
On Apr 22, 10:40 am, Zhitong He hez...@gmail.com wrote: Hi, all. I am new to Clojure and feel exciting playing with it. Recently, I read the book The Joy of Clojure, and got a strong feeling toward translating the book from English to Chinese, to introduce Clojure to more programmers in China. I think your best bet is to contact the publisher (Manning) to negotiate the translation rights. -- 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: Newbie's Guide to Learning Clojure
On Mar 28, 10:16 am, Elango Cheran elango.che...@gmail.com wrote: Hi everyone, On Gregg's suggestion, I want to share a writeup about how total beginners can learn Clojure in a minimally painful way. I'd welcome any comments, suggestions, etc. You could add a link to this guide, http://www.unexpected-vortices.com/clojure/brief-beginners-guide/ It covers a lot of the development environment setup a beginner should know. -- 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: Returning Success
On Mar 19, 3:56 am, Narvius narv...@gmail.com wrote: I am writing a game in Clojure, and I often need some functions to return whether they succeeded in doing what they are supposed to do [] I see several ways to achieve what I want, that is to return both the new world state and success status. not, then at least I hope my idea is helpful to someone. :) You might have a fifth option -- don't return the world state, but report what happened (pushing that event onto a queue maybe?). Then have a separate function make state changes. See http://prog21.dadgum.com/26.html: When I first mused over writing a game in a purely functional style, this had me stymied. One simple function ends up possibly changing the entire state of the world? Should that function take the whole world as input and return a brand new world as output? Why even use functional programming, then? A clean alternative is not to return new versions of anything, but to simply return statements about what happened. Using the above example, the movement routine would return a list of any of these side effects: {new_position, Coordinates} {ate_ghost, GhostName} {ate_dot, Coordinates} ate_fruit killed_by_ghost All of a sudden things are a lot simpler. You can pass in the relevant parts of the state of the world, and get back a simple list detailing what happened. Actually handling what happened is a separate step, one that can be done later on in the frame. The advantage here is that changes to core world data don't have to be painstakingly threaded in and out of all functions in the game. -- 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 Errors
On Mar 16, 10:19 pm, John Collins johnben...@gmail.com wrote: 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. You should be able to edit the files, see the changes in your browser and not worry about compiling. In brief what changes did you make to which files and what was the error? -- 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 georgeolive...@gmail.comwrote: 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 [other dependencies here [https://github.com/tapio/unicodetiles.js.git; 8a1922b4977685bc168de147efc2a9c72a958b08]] And I added that to the classpath (not sure if that's necessary): :extra-classpath-dirs [other directories here .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 {other options here :foreign-libs [{:file C:/george/work/great-mystery/.lein- git-deps/unicodetiles.js/unicodetiles/unicodetiles.js :provides [ut.core]}] more options here}) And from a view.cljs file tried to require the namespace: (:require other namespaces here [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 #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.anonymous (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 georgeolive...@gmail.comwrote: 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
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 div id=content div id=game h1 id=headerMy game goes here. /h1 /div /div /_within I edited /public/design.html to add a link: ul lia href=/design/form.htmlForm/a/li lia href=/design/greeting.htmlGreeting/a/li lia href=/design/game.htmlPlay the game/a/li /ul 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: div class=container div id=content/div div id=options/div footer/footer /div !-- /container -- 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
how to restart Clojurescript One repl the right way?
hi, I'm just starting with ClojureScript and ClojureScript One. Sometimes working with One I kill the cljs-repl for whatever reason (something hangs, I make some mistake and can't correct it, etcetera); when I go to restart (by running lein repl again), I then can't restart the cljs-repl. I get, BindException Address already in use: JVM_Bind java.net.PlainSocketImpl.socketBind What's the right way to restart in this situation? 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: Clojurescript One and Websockets
On Mar 1, 7:51 pm, Brian Rowe bripr...@gmail.com 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! hi Brian, if you look back through the list you'll find a few websocket examples, using Aleph and another server (Jetty?). For example this thread, http://groups.google.com/group/aleph-lib/browse_frm/thread/24f7e520c4f02709/2b1b7050c51674c3?#2b1b7050c51674c3 As long as whatever implementation you use is up to date from what I saw the matter looked quite straightforward. I'm in the same boat as you, combining WS and cljs1. Are you going to document your progress anywhere? -- 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: Lack in the documentation
On Feb 14, 9:50 pm, g1i1ch iris.bl...@gmail.com wrote: It seems that to fully learn clojure, you first must know java. You can see it especially in the documentation which is fully java programmer focused. My problem is that I don't know java and I really don't have the time to or the desire to learn java just to learn clojure. I'm a beginner with Clojure (started a few months ago). Before I started I had no desire to learn Java and interop was one of the reasons I had decided -not- to do anything with Clojure before. Basically I avoided Java on principle. This will sound obvious to a lot of people, but just this week I had a real aha moment. It's awesome to be using a lisp in the Java ecosystem. There's a Java library for just about anything and not a half-finished library somebody hacked together for their own needs, but an industrial-strength library that can take anything you throw at it, and so far I don't feel like I need to know more Java to use those libraries than you could pick up in a couple of days. Using Clojure is like riding a 600 cc motorcyle in a city that's been closed to cars. I'd recommend giving Java another chance. -- 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: mini mud-client for within emacs-swank
On Feb 16, 5:03 am, bOR_ boris.sch...@gmail.com wrote: Started playing with getting an within emacs clojure-based mud client, but puzzling a bit with parsing the incoming stream. The below works (for emacs+swank-clojure 1.4.0), but puts a space between every character. When I try to solve that (for example by swapping (print ... with (print (apply str ..., then incoming text is no longer automatically parsed into the repl. I'm a beginner myself, but it looks to me like you're running into a problem with the lazy seq returned by take. Don't you want to collect every character into a buffer and then flush it once you hit an end of line? -- 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
conditional get with feedparser-clj (or another RSS feed parser)?
hi, I'm making a site similar to clojurls.com (a more dynamic version of my old site ifurls.tumblr.com), so I'm working with feedparser-clj [1]. It doesn't look like feedparser currently wraps the conditional get from RomeFetcher [2], so I'm wondering if there is a Clojure library that does provide something similar, or what the best course might be -- wrap it myself, use RomeFetcher directly, or use something else. I'm new to Clojure and Java so I'd like some advice beforehand. thanks, George [1] https://github.com/vgeshel/feedparser-clj [2] http://wiki.java.net/twiki/bin/view/Javawsxml/RomeFetcher -- 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