Re: Wrong clojure version depending on lein dependencies

2013-03-03 Thread Tassilo Horn
Frank Siebenlist writes: Hi Frank, > clj-ns-browser 1.3.1 is released and addresses this issue by upgrading > the project's dependencies to seesaw 1.4.3. With 1.3.1 I could remove all the :excusions again and it still picked the right clojure version (1.5.0). Thanks, Tassilo -- -- You recei

Re: datomic question

2013-03-03 Thread Jonas
Hi You can use the tempid (http://docs.datomic.com/clojure/index.html#datomic.api/tempid) function to generate new temporary ids. Jonas On Monday, March 4, 2013 8:50:56 AM UTC+2, edw...@kenworthy.info wrote: > > Okay, I think I understand that. > > Does that mean this code could never work as

Re: datomic question

2013-03-03 Thread edward
Okay, I think I understand that. Does that mean this code could never work as intended in a Clojure program, only at the repl (which seems a bit of a limitation) or is there a way to make it work as intended, generating a different id each time? Or is the whole approach taken in this code flawe

Re: (str ()) => "clojure.lang.PersistentList$EmptyList@1"

2013-03-03 Thread Mark Engelberg
On Sun, Mar 3, 2013 at 7:30 PM, Jack Moffitt wrote: > I think you're looking for pr-str. For example: > > (pr-str (take 10 (iterate inc 0))) > ;;=> (0 1 2 3 4 5 6 7 8 9) > Thanks! But that makes me wonder: Why doesn't printf use either pr-str or print-str to handle the %s format strings? (pri

Re: (str ()) => "clojure.lang.PersistentList$EmptyList@1"

2013-03-03 Thread AtKaaZ
=> (str '()) "()" On Mon, Mar 4, 2013 at 6:27 AM, AtKaaZ wrote: > and by that I mean: > adding this toString from ASeq: > public String toString(){ > return RT.printString(this); > } > to the clojure.lang.PersistentList.EmptyList class > > => (.toString '(1)) > "(1)" > => (

Re: (str ()) => "clojure.lang.PersistentList$EmptyList@1"

2013-03-03 Thread AtKaaZ
and by that I mean: adding this toString from ASeq: public String toString(){ return RT.printString(this); } to the clojure.lang.PersistentList.EmptyList class => (.toString '(1)) "(1)" => (.toString '()) "()" On Mon, Mar 4, 2013 at 6:23 AM, AtKaaZ wrote: > => (.toString '

beginner would like help with refactoring some functions in basic echo server

2013-03-03 Thread George Oliver
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 comm

Re: (str ()) => "clojure.lang.PersistentList$EmptyList@1"

2013-03-03 Thread AtKaaZ
=> (.toString '()) "clojure.lang.PersistentList$EmptyList@1" => (.toString '(1)) "(1)" so should be an easy fix ;) On Mon, Mar 4, 2013 at 6:17 AM, AtKaaZ wrote: > I agree, I think the reason is that they are two different classes: > => (class '(1)) > clojure.lang.PersistentList > => (class ())

Re: (str ()) => "clojure.lang.PersistentList$EmptyList@1"

2013-03-03 Thread AtKaaZ
I agree, I think the reason is that they are two different classes: => (class '(1)) clojure.lang.PersistentList => (class ()) clojure.lang.PersistentList$EmptyList On Mon, Mar 4, 2013 at 3:30 AM, Lee Spector wrote: > > > (str ()) > "clojure.lang.PersistentList$EmptyList@1" > > Is that intended

Re: (str ()) => "clojure.lang.PersistentList$EmptyList@1"

2013-03-03 Thread Lee Spector
On Mar 3, 2013, at 10:30 PM, Jack Moffitt wrote: >> I know there have been some recent improvements surrounding reading and >> writing data structures. Is there a way to just say, "Convert this to a >> string that corresponds to the way it prints at the REPL"? > > I think you're looking for pr-s

Re: (str ()) => "clojure.lang.PersistentList$EmptyList@1"

2013-03-03 Thread Lee Spector
On Mar 3, 2013, at 10:26 PM, Mark Engelberg wrote: > I have gotten burned by this, you're not alone. (Although I would expect it > to produce "()", not "" as you expected). > > Similarly, I've had times where I called (str s) on a list, expecting it to > print like a list, but it turned out th

Re: (str ()) => "clojure.lang.PersistentList$EmptyList@1"

2013-03-03 Thread Jack Moffitt
> I know there have been some recent improvements surrounding reading and > writing data structures. Is there a way to just say, "Convert this to a > string that corresponds to the way it prints at the REPL"? I think you're looking for pr-str. For example: (pr-str (take 10 (iterate inc 0))) ;;=>

Re: (str ()) => "clojure.lang.PersistentList$EmptyList@1"

2013-03-03 Thread Mark Engelberg
On Sun, Mar 3, 2013 at 7:06 PM, Lee Spector wrote: > So now I'm just checking for () and handling it specially, and that works. > But still it doesn't seem right that (str ()) => > "clojure.lang.PersistentList$EmptyList@1" and I wouldn't be surprised if > this tripped up others in the future (an

Re: (str ()) => "clojure.lang.PersistentList$EmptyList@1"

2013-03-03 Thread Lee Spector
On Mar 3, 2013, at 9:39 PM, Softaddicts wrote: > Is (apply str '()) what you would want instead ? Well, that does indeed produce "", but for inputs other than () I do indeed want to call str on it, not apply str to it (which would do something else that I don't want). So now I'm just checking

Re: (str ()) => "clojure.lang.PersistentList$EmptyList@1"

2013-03-03 Thread Softaddicts
Is (apply str '()) what you would want instead ? Luc P. > > > (str ()) > "clojure.lang.PersistentList$EmptyList@1" > > Is that intended? I expected it to give "". > > This happens in Clojure 1.3, 1.4, and 1.5. > > -Lee > > -- > -- > You received this message because you are subscribed to

Re: Interesting Light Table post

2013-03-03 Thread vemv
IIRC they're building it in such a way it can be extended via plugins. So just wait :) On Friday, March 1, 2013 6:04:50 PM UTC+1, Charles sanders wrote: > > Is there a way for outsiders to contribute to lighttable ? > > On Fri, Mar 1, 2013 at 9:03 AM, Mark C > > wrote: > >> This release is a big

(str ()) => "clojure.lang.PersistentList$EmptyList@1"

2013-03-03 Thread Lee Spector
> (str ()) "clojure.lang.PersistentList$EmptyList@1" Is that intended? I expected it to give "". This happens in Clojure 1.3, 1.4, and 1.5. -Lee -- -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@goog

Re: Problems building CounterClockwise

2013-03-03 Thread Frank Hale
Interesting. I just checked the Github repo and all seems well there. I'm going to chalk this up as some crazy anomaly that happened during the course of trial and error and my utter confusion with Eclipse when I was trying to build the code. It's seems apparent that I somehow did something that ca

Re: clojure plugin for adobe brackets

2013-03-03 Thread Peter Flynn
Very cool! I've added your extension to the list at https://github.com/adobe/brackets/wiki/Brackets-Extensions -- hope you don't mind. Btw, the shortcut you're using (Ctrl+E / Cmd+E) is normally used by the built-in Quick Edit command. It might be good to choose a different shortcut to avoid

libs and resources for upcoming 7 day roguelike challenge?

2013-03-03 Thread George Oliver
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 la

Re: Clojure 1.5 print-table, org-mode babel, and org-mode HTML gen

2013-03-03 Thread greg r
Here's a little project I worked on: https://github.com/Greg-R/incanterchartcustom I'm just now learning git, so I hope the files are intact in the repository. I cloned to another machine and they appear to be OK. The Incanter chart PDF document shows what is possible with regard to documenti

Re: printing and reading functions

2013-03-03 Thread Dave Sann
Thanks Phil. Is there an Jira issue for this? Is it worth raising one? I noted that my requirement is slightly different from yours. I want to print the function by name (and namespace) only. Serializable-fn prints the full definition. But this difference is only in print-method - if the meta-

Re: datomic question

2013-03-03 Thread MichaƂ Marczyk
#db/id ... is a "tagged literal". It gets read in as an id object with some integer inside. The way this happens is that the reader looks up a "data reader" function associated with the symbol db/id in the map held by the var *data-readers* and passes to it the result of parsing the rest of the lit

Re: Problems building CounterClockwise

2013-03-03 Thread Laurent PETIT
Hello again, 2013/3/3 Frank Hale : > Thank you for the how-to on building but I'm still having issues building > this. I've managed to get it down to one error. > > lang cannot be resolved or is not a field REPLView.java > /ccw.core/src/java/ccw/repl line 385 Java Problem > > the line in question:

datomic question

2013-03-03 Thread edward
So, I am studying a piece of code from the web. I've dissected most of it and am in the process of re-factoring it. What I don't understand is why one version works and the other doesn't. So for both: (ns gcse-results.core (:use [datomic.api :only [q db] :as d]) (:use quil.core)) This doesn

Re: New midje tutorial (and sales pitch) for clojure.test users

2013-03-03 Thread Manuel Paccagnella
Thank you very much for this, Brian! Il giorno sabato 2 marzo 2013 02:31:32 UTC+1, Brian Marick ha scritto: > > Midje is a competitor to clojure.test. Version 1.5 has just entered the > release candidate pipeline. It's a big release, and makes a big jump toward > what's long been a goal of mine:

Re: ANN: Seesaw 1.4.3 release

2013-03-03 Thread Dave Ray
Thanks. It's impress.js [1]. Fortunately, I'm to lazy to really go overboard with it. Dave [1] http://bartaz.github.com/impress.js/ On Sun, Mar 3, 2013 at 1:02 AM, Mayank Jain wrote: > What did you use to create this presentation[1]? > It's so beautiful! > > [1] : http://darevay.com/talks/cloj

Re: Moving ClojureScript to Clojure 1.5.0 & data.json dependency

2013-03-03 Thread Brian Taylor
+1 from me. The additional data.json dependency gave me some pause but I think it's a completely reasonable dependency to add given we're talking about the canonical behavior-to-javascript compiler depending on the canonical data-to-javascript encoder. On Fri, Mar 1, 2013 at 2:41 PM, David Nolen

First Belgian Clojure Meetup - March 2013

2013-03-03 Thread Thomas Goossens
I'm very pleased to announce the first ever #clojure #meetup group in #belgium For the latest information please visit http://lanyrd.com/2013/belgiumclj Follow us on twitter: @b

Re: Problems building CounterClockwise

2013-03-03 Thread Frank Hale
Thank you for the how-to on building but I'm still having issues building this. I've managed to get it down to one error. lang cannot be resolved or is not a field REPLView.java /ccw.core/src/java/ccw/repl line 385 Java Problem the line in question: if (ClojureBuilder.lang.Util.equals(status, "u

Re: printing and reading functions

2013-03-03 Thread Phil Hagelberg
Getting at the var won't work, but you can get fns to print readably with their source using https://github.com/technomancy/serializable-fn Unfortunately you still have the problem that whoever defined it has to opt in. Ohil -- -- You received this message because you are subscribed to the Goo

Re: LEIN_FAST_TRAMPOLINE

2013-03-03 Thread Phil Hagelberg
Fast trampoline only affects the startup time of the trampoline higher-order task. I guess that could be clearer in the docs. -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

ANN: Clojure cheat sheet v9, including some new symbols from Clojure 1.5

2013-03-03 Thread Andy Fingerhut
http://jafingerhut.github.com Note that the doc strings in the tooltips, for those versions of the cheat sheet with tooltips, are from Clojure 1.5. While most doc strings remained the same from Clojure 1.4 to 1.5, a few have changed, and reflect new behavior in Clojure 1.5 that you cannot

Re: printing and reading functions

2013-03-03 Thread Matthias Benkard
Hi, Something like this? (let [f assoc] (first (filter (fn [v] (identical? @v f)) (map second (mapcat ns-publics (all-ns)) Or even this? (let [f assoc] (first (mapcat #(filter (fn [[ns [sym v]]] (identical? @v f)) %) (map (

Re: printing and reading functions

2013-03-03 Thread AtKaaZ
yep, you do have a point the thing is, that at runtime it's nolonger known that symbol y points to symbol x, it's only known that y is a function (just like x is, but without the connection between them), so I really don't see how to actually get the var of the function that some y points-to eventu

Re: printing and reading functions

2013-03-03 Thread Dave Sann
because it is a macro, I am not sure it can work for y. (my macro skills are limited) but in the general case where the data is not available at compile time. I am not sure macros will help. On Sunday, 3 March 2013 23:44:56 UTC+11, AtKaaZ wrote: > > oo, what do we have here? > => (defmacro get-

Re: printing and reading functions

2013-03-03 Thread AtKaaZ
oo, what do we have here? => (defmacro get-lexical-asvar [q] (let [ oem (zipmap (keys &env) (vals &env)) zz (.var (.init (second (find oem q ] `~zz ) ) #'runtime.q/get-lexical-asvar => (let [x assoc y x] (str (get-lexical-as

Re: printing and reading functions

2013-03-03 Thread AtKaaZ
ok you're right, it's impossible to get the var since those x and y are already resolved to the function, and multiple vars could point to the same function anyway. => (let [x assoc y x] (get-lexical-env) ) {x #, y #} for consistency, ignore the following: ;the following is insp

Re: printing and reading functions

2013-03-03 Thread AtKaaZ
that's true but I thought you meant in general basically, I'm looking for a way to get the var... ie. => (let [x assoc y x] *(var y)* ) CompilerException java.lang.RuntimeException: Unable to resolve var: y in this context, compiling:(NO_SOURCE_PATH:3:3) => (let [x assoc

Re: printing and reading functions

2013-03-03 Thread Dave Sann
I think, that will only work if you do it directly. It will not work in the example I gave. Dave On Sunday, 3 March 2013 22:43:14 UTC+11, AtKaaZ wrote: > > > > > On Sun, Mar 3, 2013 at 12:21 PM, Dave Sann > > wrote: > >> This may be a question for clojure dev >> >> I find myself wanting to be

Re: printing and reading functions

2013-03-03 Thread AtKaaZ
On Sun, Mar 3, 2013 at 12:21 PM, Dave Sann wrote: > This may be a question for clojure dev > > I find myself wanting to be able to print data-structures containing > resolvable functions > > e.g. > > (let [x assoc] (str [x :a :b])) > > would be: > > "[#fn clojure.core/assoc :a :b]" > > or simil

printing and reading functions

2013-03-03 Thread Dave Sann
This may be a question for clojure dev I find myself wanting to be able to print data-structures containing resolvable functions e.g. (let [x assoc] (str [x :a :b])) would be: "[#fn clojure.core/assoc :a :b]" or similar, rather than the current: "[# :a :b]" which is unreadable. I ca

Re: Faster lein

2013-03-03 Thread Marko Topolnik
If you specify AOT compilation for your main namespace (which presumably depends on everything else), the compilation resutls will be saved and reused. On Sunday, March 3, 2013 8:40:27 AM UTC+1, Buck Golemon wrote: > > Thanks Luc. > > In summary, the current compile system has no smart way to ca

Re: Wrong clojure version depending on lein dependencies (was: ANN: Clojure 1.5)

2013-03-03 Thread Frank Siebenlist
clj-ns-browser 1.3.1 is released and addresses this issue by upgrading the project's dependencies to seesaw 1.4.3. For docs and code, please see "https://github.com/franks42/clj-ns-browser";. Enjoy, Frank. On Mar 2, 2013, at 10:57 PM, Dave Ray wrote: >>> As i'm responsible for the clj-ns-br

ANN: Clojure Namespace Browser: clj-ns-browser 1.3.1 release

2013-03-03 Thread Frank Siebenlist
Small maintenance release that upgrades project's dependencies to Clojure 1.5 and Seesaw 1.4.3, but works fine with Clojure 1.4 also. As Seesaw's Dave Ray stated it: "The one good reason to upgrade is if you're planning on using Clojure 1.5 and don't feel like being confused by the horrors of M

Re: ANN: Seesaw 1.4.3 release

2013-03-03 Thread Mayank Jain
What did you use to create this presentation[1]? It's so beautiful! [1] : http://darevay.com/talks/clojurewest2012/#/title-slide On Sun, Mar 3, 2013 at 12:34 PM, Dave Ray wrote: > Hi, > > Since it's been a while, thought I'd mention that Seesaw 1.4.3 was > just released. You can find release n

Re: How to generate a serializable java class in Clojure by gen-class?

2013-03-03 Thread Petr Gladkikh
If this question is still actual there is question on stackoverflow http://stackoverflow.com/questions/1584054/declare-member-variables-with-gen-class-in-clojure :state option to genclass is probably what you need http://clojure.github.com/clojure/clojure.core-api.html#clojure.core/gen-class On