Re: Entity component system
No i do not mind. A blog is being planned for promotion of my game and sharing. Only have to find a domain name which i like. On 12 Jan., 01:32, Daniel Kersten dkers...@gmail.com wrote: Thanks for sharing! Entity component systems are something I'm very interested in and something I have tinkered with in the past. I hope to (eventually) find some time to play around with them in Clojure too. I would be very interested in hearing more about your solution and would be delighted if you were to choose to open source your project. As an aside, do you mind if I copy your sample code and possibly parts of your email to the clojure-games.org wiki? Thanks, Dan. On 10 January 2011 00:43, justinhj justi...@gmail.com wrote: Thanks for sharing. I've also spent some time building a Common Lisp game engine that uses a component architecture for the game objects. For example in pong the player's paddle is made up of a visual, physical and logical components. (defun make-pong-player(side human sprite-def control-type name) (let ((phys (make-instance '2d-physics :collide-type 'paddle :y *paddle-start-y* :width *paddle- width* :height *paddle-height*)) ; (anim (make-instance 'animated-sprite :sprite-def sprite-def ; :current-frame 'frame-1 :speed 5.0)) (visual (make-instance 'rectangle :w *paddle-width* :h *paddle-height*)) (pong (make-instance 'player-paddle-logic :control-type control-type :side side)) (obj (make-instance 'composite-object :name name))) (add-component obj phys) (add-component obj visual) ; (add-component obj anim) (add-component obj pong) obj)) The objects implement message handlers in order to operate. For example the game engine sends update and draw messages. Users can write their own message types with custom argument lists. I've put the project on google codehttp://code.google.com/p/lisp-game-engine/ Although the pong game works I wouldn't consider this a finished project by any means; it's more an experiment in game programming using CL and the REPL. It would require significant refactoring to make it work with Clojure since I use mutable state a lot, but would certainly be possible. Justin -- 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: ANN: Gloss, a byte-format DSL
It is not. Thanks for the information anyway. The real problem consists of a set of tags, with a type identified by a byte. One of those tags is a compound tag which can contain any number of other tags and is terminated by a \0. This means I need parser behavior, rather than a linear regex-alike behavior. I would totally understand if Gloss does not, and will never provide this type of behavior. If it did, that'd mean you could write an XML parser in Gloss. :) Thanks for your help. While Gloss might not solve this particular problem, I'm sure I'll find lots of other problems to use it for. Pepijn On Jan 10, 11:01 pm, Zach Tellman ztell...@gmail.com wrote: I don't know if your example codec is as simple as your real problem, but here's a codec that will work for the string you provided: (repeated (string :utf-8 :delimiters [\n \n\0]) :delimiters [\n\0] :strip-delimiters? false) This terminates the whole sequence only on \n\0, but doesn't strip out the terminator so that it can be used by the last string as well. Right now this will not properly encode (the last token will be \n\n \0, so there will be a spurious empty string at the end of the list), but I plan on fixing that soon. Zach On Jan 10, 11:47 am, pepijn (aka fliebel) pepijnde...@gmail.com wrote: Oh, right. My code does have a start and an end. I'm using header for the start. So the only way Gloss could do this is with a fn that combines header and repeated into one? On Jan 10, 12:29 pm, Ken Wesson kwess...@gmail.com wrote: On Mon, Jan 10, 2011 at 4:52 AM, pepijn (aka fliebel) pepijnde...@gmail.com wrote: The later. The string in my example is \n terminated, so it should read past the \0, and then the outer list should terminate on the last \0. My point is that I need to parse recursive structures, which of course contain the same terminator as the outer one. What if I wanted to parse null terminated lists of null terminated lists of ... of bytes? Like so: abc\0def\0\0 def\0ghi\0jkl\0\0 \0 Your implementation would just make the outer list read to the first \0 and call it a day. What I need is that it only checks for a terminator on the outer list after reading a full inner list, and keep doing that, until it finds a terminator right after the inner list. That's not going to work unless all leaves are at the same depth and there are no empty lists at any depth. If the leaves are all at the same depth: (defn unflatten ([in-seq sentinel] (unflatten (seq in-seq) sentinel [[]] 0)) ([in-seq sentinel stack height] (if in-seq (let [[f r] in-seq] (if (= f sentinel) (let [h (inc height) l1 (get stack h) l1 (if l1 l1 []) l2 (get stack height) s1 (assoc stack h (conj l1 l2)) s2 (assoc s1 height [])] (recur r sentinel s2 (inc height))) (let [l1 (get stack 0) s1 (assoc stack 0 (conj l1 f))] (recur r sentinel s1 0 (peek stack user= (unflatten [1 2 0 3 4 0 0 5 6 0 7 8 0 0] 0) [[[1 2] [3 4]] [[5 6] [7 8]]] Otherwise you're going to need to have a start-of-list delimiter as well as an end-of-list delimiter: (defn unflatten ([in-seq start-del end-del] (unflatten (seq in-seq) start-del end-del (list []))) ([in-seq s e stack] (if in-seq (let [[f r] in-seq] (condp = f e (let [[x y z] stack] (if y (recur r s e (conj z (conj y x))) (throw (Error. s (recur r s e (conj stack [])) (let [[x y] stack] (recur r s e (conj y (conj x f)) (if ( (count stack) 1) (throw (Error.)) (first stack) user= (unflatten (((ab)(cd))(ef)(g(hi))) \( \)) \a \b] [\c \d]] [\e \f] [\g [\h \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
Re: distributeted computing newby, clojure ...
Hi Nick, You can reach me from this email. If you have a patch, you can send a pull request or email it directly. Regards... -- Nurullah Akkaya http://nakkaya.com On Wed, Jan 12, 2011 at 1:13 AM, Nick Zbinden nick...@gmail.com wrote: I have a simple library that mimics newLISP's net-eval command, which will allow you to evaluate expressions in parallel on remote network nodes, http://nakkaya.com/net-eval.html Regards... Very Nice. I looked at it and its what I need. I tested it sucessfully and I am using it with in my project atm. Will you keep developing this? I will probebly work on it, do you accept patches? (Maybe we can keep talking about this on direct email.) -- 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: Multidimensional Float arrays
This is a much better solution. It's shorter and is easier to read. Thanks for tip! Bill On Jan 10, 11:49 pm, Sunil S Nandihalli sunil.nandiha...@gmail.com wrote: Hi Bill , the following is one way of doing it .. (into-array (map float-array [[1.0 1.0 2.0 2.0] [3.0 2.2 4.0 0.0]])) Sunil. On Mon, Jan 10, 2011 at 8:32 PM, WoodHacker ramsa...@comcast.net wrote: Hi, Can anybody explain to me how to create a multidimensional array of floats such as: [[1.0 1.0 2.0 2.0] [3.0 2.2 4.0 0.0]] Anything I try gives me errors. Bill -- 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.comclojure%2bunsubscr...@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: java 7
If Java 7 gives Clojure significant performance boost (invokedynamic and frields) wouldn't it make sense to have separate versions of Clojure that will be optimized for target JRE version? I suppose that only small part of clojure codebase would be affected, with small improvements to build process. I think that Groovy used to have standard and jdk-1.4 releases, and there are other projects that are doing so. Regards, Marko Kocić -- 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: java 7
A branch is certainly a possibility. But from what I've heard, the primary benefit of invokedynamic is convenience for language implementors. The performance benefits, if any, are modest. -S clojure.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
Re: How do I find implemented protocols in Clojure object?
One way: (ancestors (type the-object)) This will include every interface implemented by the object, including protocols. -S clojure.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
Re: running just one test
Invoking tests as functions doesn't work when the tests use fixtures. -S clojure.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
Re: ANN: clojurejs -- a Clojure (subset) to Javascript translator
On Jan 11, 4:20 pm, Ram Krishnan kriyat...@gmail.com wrote: * Mozilla's JS 1.7 supports a let statement[1] with lexical scoping, ... That's an interesting idea, although I'm not too keen on specializing for any one browser. The other problem is I don't see any reasonable way of providing the alternates from a web server without some form of user-agent sniffing. You're right, any potential benefits could only be reaped under very specific circumstances. Making the codebase more complex to optimize for these limited cases doesn't make sense. I've taken a deeper look yesterday and am positively surprised how much easier to understand the implementation is than expected. Very cool. A few design decisions caught my eye though, and could IMO be improved: Using a ref won't actually improve your concurrency experience with *macros* (provided I understand your code correctly). Since the parsing and emitting is written in an inherently linear style, there will only ever be one transaction altering *macros*. More problematic though is the case where two threads happen to concurrently translate completely independent (js ...) expressions. Since *macros* is global, both threads would share the same macro definitions even if totally different code bases are being translated! This problem could be mitigated by using thread local bindings for *macros*. Refs or atoms are not neccessary in this case; even plain old (set!) would do. Another thing that strikes me as a potentially bad idea is the reliance on imperative behaviour to generate output, i.e. emitting or printing generated code to a stream instead of returning the pieces in a functional way and combining them afterwards. This imperative style could hamper your code's composability in the future. ... What do others think? With all that said -- it's actually quite pleasant to work with right now. If you're interested in patches, I've done some small refactorings to remove duplicate code, added basic docstring support and other small fixes. Please see my fork at: https://github.com/danwerner/clojurejs Daniel -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: Multidimensional Float arrays
On Wed, Jan 12, 2011 at 8:15 AM, WoodHacker ramsa...@comcast.net wrote: This is a much better solution. It's shorter and is easier to read. Thanks for tip! On Jan 10, 11:49 pm, Sunil S Nandihalli sunil.nandiha...@gmail.com wrote: (into-array (map float-array [[1.0 1.0 2.0 2.0] [3.0 2.2 4.0 0.0]])) Why not generalize further? (defn arrayify [array-fn coll] (if (some #(and (not (instance? String %)) (try (seq %) (catch Exception _))) coll) (into-array (map #(arrayify array-fn %) coll)) (array-fn coll))) user= (arrayify float-array [1.2 0.3 4.0]) [1.2, 0.3, 4.0] user= (.getClass (arrayify float-array [1.2 0.3 4.0])) [F (My repl prints arrays nicely, like vectors) user= (arrayify float-array [[1.2 0.3][-2.1 4.0]]) [[1.2, 0.3], [-2.1, 4.0]] user= (.getClass (arrayify float-array [[1.2 0.3][-2.1 4.0]])) [[F user= (arrayify int-array [[[1 0][2 4]][[3 7][9 -1]]]) [[[1, 0], [2, 4]], [[3, 7], [9, -1]]] user= (.getClass (arrayify int-array [[[1 0][2 4]][[3 7][9 -1]]])) [[[I user= (arrayify (partial into-array String) [foo bar]) [foo, bar] user= (.getClass (arrayify (partial into-array String) [foo bar])) [Ljava.lang.String; -- 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: running just one test
On Wed, Jan 12, 2011 at 1:41 AM, ka sancha...@gmail.com wrote: (detest xyz ...) Freudian slip? ;) -- 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 sorted-sets
Yes that compareTo doesn't define a total order on your class. I think you are missing a clause in cond: You're right on. I refactored the toCompare function to meet the requirements outlined in its javadoc, and it worked. I'm a little ashamed I didn't do that before wasting people's time... Thanks, -Travis -- 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 IDEs are you all using?
Hi Mark, Could you elaborate on this part? On Jan 11, 8:40 pm, Mark Engelberg mark.engelb...@gmail.com wrote: well. Lots of little things don't work quite right in emacs (at least on Windows), for example, dragging a file onto emacs to edit it, and copying and pasting between apps. I've been using Emacs on Windows for a while now, and haven't run into issues with either of these (yet). With more detail about the issues you faced, perhaps I could offer some help. -- 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 IDEs are you all using?
On Wed, Jan 12, 2011 at 1:49 AM, Meikel Brandmeyer m...@kotka.de wrote: 2. An easy way to load all the relevant code and dependencies into a REPL. Check. Vim itself does not provide that. But it is easy to use lein, cake or gradle to fire up the backend server. For lein there exists a third-party plugin. For gradle there will be a plugin with the next release of VimClojure, but at the moment it is possible by using a simple custom task. I think you meant the next release of Clojuresque. -- Omnem crede diem tibi diluxisse supremum. -- 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: clojurejs -- a Clojure (subset) to Javascript translator
On Jan 12, 5:56 am, Daniel Werner daniel.d.wer...@googlemail.com wrote: On Jan 11, 4:20 pm, Ram Krishnan kriyat...@gmail.com wrote: * Mozilla's JS 1.7 supports a let statement[1] with lexical scoping, ... That's an interesting idea, although I'm not too keen on specializing for any one browser. The other problem is I don't see any reasonable way of providing the alternates from a web server without some form of user-agent sniffing. You're right, any potential benefits could only be reaped under very specific circumstances. Making the codebase more complex to optimize for these limited cases doesn't make sense. I've taken a deeper look yesterday and am positively surprised how much easier to understand the implementation is than expected. Very cool. A few design decisions caught my eye though, and could IMO be improved: Glad you found the code readable, which is always a concern with Lisp code that has evolved over the course of its author discovering the problem he's setting out to solve :) Using a ref won't actually improve your concurrency experience with *macros* (provided I understand your code correctly). Since the parsing and emitting is written in an inherently linear style, there will only ever be one transaction altering *macros*. More problematic though is the case where two threads happen to concurrently translate completely independent (js ...) expressions. Since *macros* is global, both threads would share the same macro definitions even if totally different code bases are being translated! This problem could be mitigated by using thread local bindings for *macros*. Refs or atoms are not neccessary in this case; even plain old (set!) would do. I agree. Funnily enough, I started out with a thread local binding implementation, and switched to a ref because I needed macro definitions to persist across multiple requests. Consider something like the following: (defroutes my-routes (GET /js/app.js {:content-type text/javascript :body (tojs (resources-path boot.cljs) (resources-path app.cljs))}) (GET /login login-form-handler)) /js/app.js would load and compile the boot.cljs and app.cljs scripts and return the resulting Javascript in one request. If all the Javascript were done this way, there would be no issue with just thread local bindings for *macros*. However, if you had some inline Javascript elsewhere in a different request handler: (defun login-form-handler [] (let [id (gensym)] (html [:div {:id id :title login} [:form {:id login-form} (text-field login-email email) (password-field login-password password)] [:p {:id login-message :class message error} ] (jq-let [dlg-id (str # id)] (defn login [] (.text ($ #login-message) login submit)) (defn do-close [] (.dialog ($ this) close)) (.dialog ($ dlg-id) {:autoOpen false :modal true :height 230 :buttons {login login close do-close}}))]))) The issue is that the clojurejs script within the `jq-let' wouldn't see any of the macros unless they're loaded again, which can get expensive on each request. Ideally, the macro definitions would persist across requests, but in independent namespaces to avoid the collision issue you brought up. I'd like to think a cheap namespace implementation would be a way around this (basically, macro expanders would be kept in a global *namespaces* map with the namespace name as key). This would have to introduce a `ns' top level form, with at least support for :use. Or I'm open to other suggestions ... Another thing that strikes me as a potentially bad idea is the reliance on imperative behaviour to generate output, i.e. emitting or printing generated code to a stream instead of returning the pieces in a functional way and combining them afterwards. This imperative style could hamper your code's composability in the future. ... What do others think? I completely agree. This is one of the bad side-effects (no pun intended) of the ad-hoc origin of this library. Ideally, there should be an intermediate representation which captures all of the Javascript idiosyncracies, and a much simpler emitter. I made the mistake of assuming the s-expression parse tree *was* that representation ... live and learn. The other factor is that I'm a Common Lisp hack still getting used to writing idiomatic Clojure :) With all that said -- it's actually quite pleasant to work with right now. If you're interested in patches, I've done some small refactorings to remove duplicate code, added basic docstring support and other small fixes. Please see my fork at: https://github.com/danwerner/clojurejs Daniel Thanks very much. I'm glad you were able to use and improve the code. I like the refactoring you did, as well as the
Re: which IDEs are you all using?
On 12 Jan, 2011, at 4:21 pm, clojure+nore...@googlegroups.com wrote: My #1 issue with emacs is that I don't know how save my workspace so that I can return to emacs and automatically open the last set of files I was working on, and my places within them. It's always a big hassle when I sit down to work to open up all the files manually and find my places. I have something like this: (setq desktop-dirname /foo/bar desktop-path'(/foo/bar)) (setq-default desktop-path '(/foo/bar)) (add-hook 'kill-emacs-hook (lambda () (desktop-save desktop-dirname))) (require 'desktop) ;; seem to remember there was a reason for the late `require' (desktop-save-mode 1) (require 'desktop-recover) Pardon the scattergun approach, it wasn't very well documented when I set it up. More than likely only some subset of the above is necessary and sufficient. -- Phil Hudson PGP/GnuPG ID: 0x887DCA63 -- 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: java 7
A branch is certainly a possibility. But from what I've heard, the primary benefit of invokedynamic is convenience for language implementors. The performance benefits, if any, are modest. If your language is doing dynamic dispatch a lot, invokedynamic can be game-changing since suddenly the JIT has the potential to optimize in ways similar to invokevirtual. As far as I know, the main issue with clojure is that it is not heavy on dynamic dispatch. Regular function calls and protocols don't benefit from invokedynamic I think, so the performance benefit would seem to be less than for something like groovy/ruby/python/etc. If you're doing normal invokevirtual/invokestatic calls on types of known type, and the performance impact is coming from things like boxing and the fundamental nature of the data structures, I don't believe invokedynamic will be expected to help much in the general case (but I am certainly no expert here). Would not multimethods be the main candidate for invokedynamic? -- / Peter Schuller -- 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 IDEs are you all using?
Hello Wilson, Am 12.01.2011 um 17:18 schrieb Wilson MacGyver: I think you meant the next release of Clojuresque. No. I really meant VimClojure. I think the plugin does not fit to clojuresque, since the latter is independent of one's editor. Sincerely Meikel -- 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 IDEs are you all using?
ah, ok. just wanted to make sure. On Wed, Jan 12, 2011 at 2:22 PM, Meikel Brandmeyer m...@kotka.de wrote: Hello Wilson, Am 12.01.2011 um 17:18 schrieb Wilson MacGyver: I think you meant the next release of Clojuresque. No. I really meant VimClojure. I think the plugin does not fit to clojuresque, since the latter is independent of one's editor. Sincerely Meikel -- 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 -- Omnem crede diem tibi diluxisse supremum. -- 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
[ANN] fs - file system utilities for Clojure
[fs 0.2.0-SNAPSHOT] is out, featuring: abspath Return absolute path basename Return the last part of path copy Copy a file cwd Return the current working directory delete Delete path directory? True if path is a directory dirname Return directory name executable? Check if path is executable exists? Check if path exists file? True if path is a file glob `ls` like operator join Join part to path listdir List files under directory mkdir Create directory mtime File modification time mkdirs Create directory tree normpath Return normalized (canonical) path readable? Check if path is readable rename Rename path separator Path separator size File size split Split path to parts tempdir Create temporary directory tempfile Create temporary file walk Walk over directory structure, calling function on every step writeable? Check if path is writable Have fun, -- Miki -- 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] fs - file system utilities for Clojure
Good stuff, just what I was looking for, can't wait to try... sent from my mobile device On Jan 12, 2011 9:48 PM, Miki miki.teb...@gmail.com wrote: [fs 0.2.0-SNAPSHOT] is out, featuring: abspath Return absolute path basename Return the last part of path copy Copy a file cwd Return the current working directory delete Delete path directory? True if path is a directory dirname Return directory name executable? Check if path is executable exists? Check if path exists file? True if path is a file glob `ls` like operator join Join part to path listdir List files under directory mkdir Create directory mtime File modification time mkdirs Create directory tree normpath Return normalized (canonical) path readable? Check if path is readable rename Rename path separator Path separator size File size split Split path to parts tempdir Create temporary directory tempfile Create temporary file walk Walk over directory structure, calling function on every step writeable? Check if path is writable Have fun, -- Miki -- 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.comclojure%2bunsubscr...@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: How do I find implemented protocols in Clojure object?
On 2011-01-12, at 8:38 AM, Stuart Sierra wrote: One way: (ancestors (type the-object)) This will include every interface implemented by the object, including protocols. This seems to only work if the protocol is mentioned in the defrecord. If it's applied using the extend function it doesn't seem to show the protocol. The functions bases and supers work similarly. Unless I'm doing something really stupid, which is a distinct possibility. Any idea how to tell which of the classes returned by ancestors/bases/supers are protocols? I copied a function from the source that can tell if something is a protocol if written directly in clojure, but does not work on the results from those methods. (defn protocol? [maybe-p] (boolean (:on-interface maybe-p))) Cheers, Bob -S clojure.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 Bob Hutchison Recursive Design Inc. http://www.recursive.ca/ weblog: http://xampl.com/so -- 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: lein-cdt 1.0.0 - a leiningen plugin for the Clojure Debugging Toolkit
Unfortunately I haven't used cake at all, sorry! Travis On Tue, Jan 11, 2011 at 12:15 AM, Sunil S Nandihalli sunil.nandiha...@gmail.com wrote: Hi, Thanks Travis. This is something I have wanted for a long time .. Have you tried using it with cake? would it work with Cake? Sunil. On Mon, Jan 10, 2011 at 9:34 PM, Travis Vachon travis.vac...@gmail.com wrote: Hi folks I'd like to announce the first stable release of lein-cdt, a leiningen plugin that makes running George Jahad's excellent Clojure Debugging Toolkit a little easier. George has been polishing CDT over the past couple weeks and we both hope that this plugin will help others start to use and provide feedback on this tool: https://github.com/travis/lein-cdt http://clojars.org/lein-cdt This release includes: lein cdt - a leiningen task to start a CDT REPL that will automatically connect to a running debug JVM lein cdt-emacs - a leiningen task that will download necessary binary and source dependencies to a central location and print instructions for setting up emacs integration with CDT Nota bene: * The 1.0.0 status of lein-cdt implies that lein-cdt's API is relatively stable - easy to do because it's not a lot of code. It does not imply anything with regards to CDT itself. * Some important limitations are noted on the GitHub page - please be sure to read through these before reporting issues. Comments, questions and contributions welcome! Travis -- 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: which IDEs are you all using?
On Jan 11, 10:40 pm, Mark Engelberg mark.engelb...@gmail.com wrote: lein/emacs - Getting lein to run under Windows has been an ongoing struggle. It sort of works, but there are a lot of little problems. I've made lots of edits to my batch file to try to address the problems, but then it becomes difficult to update to new versions of lein. Some of the problems I've encountered: REPL doesn't use version of Clojure specified in the project file; doesn't use specified jvm flags; tests don't work. From the problems you are seeing it sounds like you are using Leiningen 1.1.0. Have you tried 1.4.2, the latest release? Also, if you have improvements to the batch file, please share them. Of course it's going to be awkward to upgrade if you have personal customizations that aren't submitted upstream, but we could avoid duplicating work if those tweaks were merged. -Phil -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en
Re: How do I find implemented protocols in Clojure object?
You're right, it will only work for protocol implementations defined in-line in a type. -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: which IDEs are you all using?
On Wed, Jan 12, 2011 at 8:13 AM, Benny Tsai benny.t...@gmail.com wrote: Hi Mark, Could you elaborate on this part? The version number is: GNU Emacs 23.1.1 (i386-mingw-nt5.1.2600) When I drag a file onto the emacs icon, it starts up, but instead of showing me the file, it says: command-line-1: Cannot open load file: %userprofile%/Application Data/.emacs.d/init.el The cut-and-paste problems are intermittent; I haven't figured out when or why it happens. Thanks for your interest, Mark -- 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 IDEs are you all using?
On Wed, Jan 12, 2011 at 9:56 AM, Philip Hudson phil.hud...@iname.com wrote: I have something like this: (setq desktop-dirname /foo/bar desktop-path '(/foo/bar)) (setq-default desktop-path '(/foo/bar)) (add-hook 'kill-emacs-hook (lambda () (desktop-save desktop-dirname))) (require 'desktop) ;; seem to remember there was a reason for the late `require' (desktop-save-mode 1) (require 'desktop-recover) Thanks for the tip about saving desktops in emacs. I'll see if I can get that to work, Mark -- 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 IDEs are you all using?
On Wed, Jan 12, 2011 at 3:57 PM, Phil Hagelberg p...@hagelb.org wrote: From the problems you are seeing it sounds like you are using Leiningen 1.1.0. Have you tried 1.4.2, the latest release? I'm on lein 1.3.1. I downloaded, but have not yet tried 1.4.2. I haven't sent you my changes because my batch file-fu is weak, so I usually fix any problems I have with hardcoded paths and flags for my own particular system. But if I need to make some changes to 1.4.2, I'll let you know what I do. Thanks to everyone for the tips and suggestions! -- 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 IDEs are you all using?
Try setting %HOME% to something like c:\home, create the dir if needed, and put your .emacs etc in that folder. I've found that spaces in paths are still often to blame for issues with command line and gnu-esque tools. Thanks, Peter -Original Message- From: Mark Engelberg mark.engelb...@gmail.com Sender: clojure@googlegroups.com Date: Wed, 12 Jan 2011 17:38:00 To: clojure@googlegroups.com Reply-To: clojure@googlegroups.com Subject: Re: which IDEs are you all using? On Wed, Jan 12, 2011 at 8:13 AM, Benny Tsai benny.t...@gmail.com wrote: Hi Mark, Could you elaborate on this part? The version number is: GNU Emacs 23.1.1 (i386-mingw-nt5.1.2600) When I drag a file onto the emacs icon, it starts up, but instead of showing me the file, it says: command-line-1: Cannot open load file: %userprofile%/Application Data/.emacs.d/init.el The cut-and-paste problems are intermittent; I haven't figured out when or why it happens. Thanks for your interest, Mark -- 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
When to use #'
Hi, I find it extremely hard to google this to learn more! I'd like to know some good sources of further information on when to use #' . It is a bit mysterious to me at this point. -- 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: When to use #'
its a reader macro equivalent to the var special form: (var symbol) The symbol must resolve to a var, and the Var object itself (not its value) is returned. The reader macro #'x expands to (var x). from: http://clojure.org/special_forms#var On Wed, Jan 12, 2011 at 9:11 PM, Alex Baranosky alexander.barano...@gmail.com wrote: Hi, I find it extremely hard to google this to learn more! I'd like to know some good sources of further information on when to use #' . It is a bit mysterious to me at this point. -- 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: which IDEs are you all using?
Hi Mark, I don't know much about the error msg you encountered, but I think Peter's onto something with the recommendation to set %HOME% yourself to help emacs find your init file(s). This page has good info on how emacs goes about determining your %HOME% directory: http://www.gnu.org/software/emacs/windows/Installing-Emacs.html I believe 23.2 is the latest stable release. With any luck, the intermittent copy/paste problems won't follow you into the newer version :) On Jan 12, 6:49 pm, buckmeist...@gmail.com wrote: Try setting %HOME% to something like c:\home, create the dir if needed, and put your .emacs etc in that folder. I've found that spaces in paths are still often to blame for issues with command line and gnu-esque tools. Thanks, Peter -Original Message- From: Mark Engelberg mark.engelb...@gmail.com Sender: clojure@googlegroups.com Date: Wed, 12 Jan 2011 17:38:00 To: clojure@googlegroups.com Reply-To: clojure@googlegroups.com Subject: Re: which IDEs are you all using? On Wed, Jan 12, 2011 at 8:13 AM, Benny Tsai benny.t...@gmail.com wrote: Hi Mark, Could you elaborate on this part? The version number is: GNU Emacs 23.1.1 (i386-mingw-nt5.1.2600) When I drag a file onto the emacs icon, it starts up, but instead of showing me the file, it says: command-line-1: Cannot open load file: %userprofile%/Application Data/.emacs.d/init.el The cut-and-paste problems are intermittent; I haven't figured out when or why it happens. Thanks for your interest, Mark -- 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 athttp://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
my newbie question...
So i've used this because I picked it up from numerous tutorials but I've never really understood it, can I get a some decent background information on - and -? I picked them up from compojure tutorials and don't feel anywhere near comfortable enough w/ what is actually going on. Thanks. -Sean- -- 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: my newbie question...
- and -- are macros in clojure.core, both (- one #(two % a) three) (- one #(two a %) three) expands to (three #(two one a)) and (- one #(two %1 %2) three) expands to (three #(two a one)) On Wed, Jan 12, 2011 at 10:40 PM, Sean Allen s...@monkeysnatchbanana.comwrote: So i've used this because I picked it up from numerous tutorials but I've never really understood it, can I get a some decent background information on - and -? I picked them up from compojure tutorials and don't feel anywhere near comfortable enough w/ what is actually going on. Thanks. -Sean- -- 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.comclojure%2bunsubscr...@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: my newbie question...
Oops. Sorry, I'm clearly too tired to post. Thsoe examples aren't quite right. Those are the threading macros. (- one two three) expands to (three (two one)) - and - do the same things, except - threads through the first argument of the functions, and - threads through the second argument. Much better (and correct) examples are here: http://clojuredocs.org/clojure_core/clojure.core/-%3E and here: http://clojuredocs.org/clojure_core/clojure.core/-%3E%3E -- 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: my newbie question...
On Wed, Jan 12, 2011 at 8:04 PM, Alex Baranosky alexander.barano...@gmail.com wrote: - and - do the same things, except - threads through the first argument of the functions, and - threads through the second argument. - threads through the last argument. Both macros are useful for unnesting complex expressions. There's a good example in the comments (from Rich himself) on this blog post: http://www.innoq.com/blog/st/2009/12/clojurelisp_readability.html -- Sean A Corfield -- (904) 302-SEAN Railo Technologies, Inc. -- http://getrailo.com/ An Architect's View -- http://corfield.org/ If you're not annoying somebody, you're not really alive. -- Margaret Atwood -- 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: When to use #'
One common use is for referring to private functions in other namespaces. For example, say you want to write tests for foo.core/p, a privately defined function. It is private in terms of your intent as expressed in your API, but you can still access the var from foo.core-test and call the function in your tests as #'foo.core/p. On Wed, Jan 12, 2011 at 10:29 PM, gaz jones gareth.e.jo...@gmail.comwrote: its a reader macro equivalent to the var special form: (var symbol) The symbol must resolve to a var, and the Var object itself (not its value) is returned. The reader macro #'x expands to (var x). from: http://clojure.org/special_forms#var On Wed, Jan 12, 2011 at 9:11 PM, Alex Baranosky alexander.barano...@gmail.com wrote: Hi, I find it extremely hard to google this to learn more! I'd like to know some good sources of further information on when to use #' . It is a bit mysterious to me at this point. -- 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.comclojure%2bunsubscr...@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.comclojure%2bunsubscr...@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 Quizzes?
On 12 January 2011 14:07, Robert McIntyre r...@mit.edu wrote: You can use the latest version of clojure if you include it as a dependency in your submission, so even though they say they only support clojure1.0 they really support all of them. Are other 3rd-party libs allowed, too? Cheers, Stuart -- 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 Quizzes?
They seem to allow you to include anything in a lib directory that you'd want. I sometimes include apache commons-io and clojure-contrib1.2 without any problems. I also included a sql connection library for one of the problems, so it seems fine :) --Robert McIntyre On Thu, Jan 13, 2011 at 2:00 AM, Stuart Campbell stu...@harto.org wrote: On 12 January 2011 14:07, Robert McIntyre r...@mit.edu wrote: You can use the latest version of clojure if you include it as a dependency in your submission, so even though they say they only support clojure1.0 they really support all of them. Are other 3rd-party libs allowed, too? Cheers, Stuart -- 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