Re: on lisp and scheme macros

2011-12-06 Thread Tassilo Horn
"Jose A. Ortega Ruiz" writes: Hi Jose, >> I don't know scheme macros, so could you please explain why they are >> more powerful? What can you do with a syntax-case macro what you >> cannot do with a Common Lisp (or Clojure) macro? > > In general, syntax-case lets you manipulate first-class synt

Counterclockwise nREPL multiple commands

2011-12-06 Thread jlhouchin
Hello, As I work through the Programming Clojure book, I play with the code I enter into the REPL. I just want to say that I am infinitely enjoying using the REPL in Counterclockwise. It does make multi-line code so much nicer. I entered this. (defn whole-numbers [] (iterate inc 1)) (take 10 (for

Re: on lisp and scheme macros

2011-12-06 Thread Jose A. Ortega Ruiz
Hi Tassilo, On Tue, Dec 06 2011, Tassilo Horn wrote: > "Jose A. Ortega Ruiz" writes: > > Hi Jose, > >>> I think that Common Lisp macros are, strictly speaking, more powerful >>> than Scheme macros, but I don't have a citation. >> >> That's only true for syntax-rules macros. syntax-case macros,

no :main namespace specified in project.clj

2011-12-06 Thread jayvandal
I tried to run sqlitetest project in lein.I get this error no :main namespace specified in project.clj Why would i get an error in an example? I first run lein deps. Then i run lein run then comes error?? -- You received this message because you are subscribed to the Google Groups "Clojure" gro

getting inside another dynamic scope?

2011-12-06 Thread Andrew
Is there a way (without swank-cdt) to get inside some other dynamic scope that's blocked in order to evaluate some arbitrary code? Let's say a thread has paused waiting for some UI input. Earlier a dynamic var binding happened. You know the name of that var ... you know that thread is waiting

Re: thank you, clojure hackers

2011-12-06 Thread Ambrose Bonnaire-Sergeant
What are you making? Ambrose On Wed, Dec 7, 2011 at 11:19 AM, Craig Brozefsky wrote: > > I'm about to deploy the first version of a tool I wrote in Clojure, and > I wanted to send out a "thank you" to all the Clojure devs, and the > community that produced this environment, including the packag

thank you, clojure hackers

2011-12-06 Thread Craig Brozefsky
I'm about to deploy the first version of a tool I wrote in Clojure, and I wanted to send out a "thank you" to all the Clojure devs, and the community that produced this environment, including the packages I'm using, including the following packages: tools.logging, tools.cli, data.json, clojure-csv

Re: swank-cdt: Using Slime with the Clojure Debugging Toolkit

2011-12-06 Thread Andrew
Thanks for taking the time Sean! You're right... - I'm on Windows XP - I had to copy tools.jar to my projects lib manually after lein deps (not sure how to change the classpath) - My emacs setup is munged -- I can run M-x eshell but not M-x shell; I have to do lein swank and M-x s

Re: let-else macro

2011-12-06 Thread Sam Ritchie
I had a pattern that kept popping up in code of: (let [x (foo) y (bar)] (when y (let [ ] ))) that check jarred me, so I put this together: https://gist.github.com/1347312. On reflection, discomfort with indentation levels probably isn't near the top of the "to

Re: Building Clojure applications w/ Maven

2011-12-06 Thread Richard Lyman
Can you provide the pom you're using? By 'build' do you mean AOT? -Rich On Tue, Dec 6, 2011 at 3:35 PM, Riccardo wrote: > Hello, I am doing my dissertation project with Clojure and I am using > Maven to build. It works on REPL and it build successfully, but the > JAR file doesn't work, it say

clojurescript on windows (how create goog.jar)...Noob question

2011-12-06 Thread ron
hi everybody...I'm trying install clojurescript on windows...I'm follow the steps but I'm not sure with this specific step: Create a goog.jar file and copy to lib cd closure\library\closure jar cf goog.jar goog copy goog.jar ..\..\..\lib now..I've downloaded clojure, closure and the closure

Building Clojure applications w/ Maven

2011-12-06 Thread Riccardo
Hello, I am doing my dissertation project with Clojure and I am using Maven to build. It works on REPL and it build successfully, but the JAR file doesn't work, it says: "Java Exception" all the time. Any suggestion? -- You received this message because you are subscribed to the Google Groups "Cl

Quartz and Clojure

2011-12-06 Thread Jimmy
Hi, Is there any know Clojure wrapper for the Quartz scheduling service? thanks, Jimmy -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - pleas

let-else macro

2011-12-06 Thread Evan Gamble
I noticed in my code that I often nest a let inside an if-let, or vice- versa, so I wrote a macro let-else that expands into nested lets, except where there's an :else after a binding, in which case that binding expands into an if-let. E.g. (let-else [foo (f1) :else (e) bar (f2)] (b1) (

Re: Surprising behavior with clojure.core/int (and probably other primitive integer functions)

2011-12-06 Thread Cedric Greevey
Thanks. I think this is an area where there will hopefully be a bit more polish in 1.4. Particularly regarding cleanly wrapping code in unchecked on/off ... though a function that just amounts to #(.intValue ^Number %) would save everyone writing such closures over and over again when they need a n

Re: on lisp and scheme macros

2011-12-06 Thread Brian Goslinga
> Does that mean that Clojure's defmacro is aware of the lexical scope as > well and is therefore equally powerful as Scheme's syntax-case? > > Bye, > Tassilo In my implementation of syntax-rules/syntax-case, I did essentially the same thing as syntax-quote (had to reimplement it as there is no pro

Re: swank-cdt: Using Slime with the Clojure Debugging Toolkit

2011-12-06 Thread Sean Corfield
I just created a new project, replaced project.clj with yours, ran lein deps then lein swank and in Emacs M-x slime-connect. Following your step below I was able to view the source of set.clj (and all the compiler Java files as I walked back up the stack). I know that's not much help but it might

ANN: clojuredocs REPL client with off-line mode

2011-12-06 Thread Andy Fingerhut
This is still early, but it might be in a form where someone would like to use it, and I'd appreciate suggestions on what would make it more useful. It is a fork of the clojuredocs client created by Lee Hinman, with some additions so that you can either run it in the default "web mode", where it r

Re: swank-cdt: Using Slime with the Clojure Debugging Toolkit

2011-12-06 Thread Andrew
user> (require 'clojure.set) nil user> (set-bp clojure.set/difference) nil nil user> (clojure.set/difference #{1 2} #{2 3}) CDT buffer appears CDT BreakpointEvent in thread Swank REPL Thread >From here you can: e/eval, v/show source, s/step, x/next, o/exit func Restarts: 0: [QUIT] Quit to t

Re: on lisp and scheme macros

2011-12-06 Thread Tassilo Horn
Stephen Compall writes: > On Tue, 2011-12-06 at 16:09 +0100, Tassilo Horn wrote: >> Wikipedia lists syntax-case as hygienic macro system, which would >> make it less powerful than CL macros, because if that was true, you >> could not write anaphoric macros with it. > > You can write anaphora with

Re: Defrecord Composition Problem

2011-12-06 Thread tmountain
Eh, nevermind, I refactored things a bit, and I'm happier now. Sorry for the noise. ; base (defrecord Entity [id asset location data]) (defrecord Farmer [entity]) (defn get-entity-by-key ([] (fn [this] (:entity this))) ([key] (fn [this] (key this

Re: Using Lein with Local Jars on Heroku

2011-12-06 Thread Matjaz Gregoric
As others have noted, keeping jars together with the source is usually not the best approach... but sometimes it just might be. For those rare occasions, the instructions on how to do this with leiningen are here: http://www.pgrs.net/2011/10/30/using-local-jars-with-leiningen/ Matjaz On Sat, Aug

Re: Type hints for ^map migrating from 1.2 to 1.3

2011-12-06 Thread Alan Malloy
On Dec 6, 10:31 am, Meikel Brandmeyer wrote: > Hi, > > Am 06.12.2011 um 18:31 schrieb Eric in San Diego: > > > I'm migrating some code from 1.2 to 1.3, and one of the things I've > > encountered is that it no longer accepts ^map as a type hint.  It's > > happy if I use ^clojure.lang.PersistentArra

Re: Google chart library

2011-12-06 Thread Gary Trakhman
Note, there is a java api to create the DataTable JSON, it follows some simple rules. http://code.google.com/p/google-visualization-java/ -- 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

Re: swank-cdt: Using Slime with the Clojure Debugging Toolkit

2011-12-06 Thread Sean Corfield
Did you (require 'clojure.set) ? It's not in the instructions for CDT... On Tue, Dec 6, 2011 at 8:51 AM, Andrew wrote: > tried the test drive and when I type v I get this: clojure\set.clj - source > not found. -- You received this message because you are subscribed to the Google Groups "Clojure

Re: No longer able to write a UUID to Postgres with ClojureQL

2011-12-06 Thread Don Jackson
On Dec 6, 2011, at 11:23 AM, Sean Corfield wrote: > On Tue, Dec 6, 2011 at 6:12 AM, Herwig Hochleitner > wrote: >> 2011/12/6 Sean Corfield : >>> So the question is probably: why is ClojureQL assuming all generated >>> keys are integers? >> It shouldn't, and doesn't now: >> https://github.com/Lau

Defrecord Composition Problem

2011-12-06 Thread tmountain
Hi, I'm playing around with protocols and records and trying to implement some ad-hoc type composition. I have a solution that works, but I want to make it more readable. Specifically, if you look at the code below, I'd like to come up with a macro or some other solution to eliminate all the calls

Re: Using Lein with Local Jars on Heroku

2011-12-06 Thread Phil Hagelberg
On Tue, Dec 6, 2011 at 11:12 AM, Robert Levy wrote: > I was wondering the same thing and I came across your un-answered question > here.  The short answer appears to > be http://devcenter.heroku.com/articles/local-maven-dependencies > > As a side note, I could be wrong but I think lein has > nonco

Re: No longer able to write a UUID to Postgres with ClojureQL

2011-12-06 Thread Sean Corfield
On Tue, Dec 6, 2011 at 6:12 AM, Herwig Hochleitner wrote: > 2011/12/6 Sean Corfield : >> So the question is probably: why is ClojureQL assuming all generated >> keys are integers? > It shouldn't, and doesn't now: > https://github.com/LauJensen/clojureql/commit/f7ffe88b166e6f60eccb3b4f46b7db5d69dbc

Re: ANN: Clarity 0.5.1 - New GUI library

2011-12-06 Thread Dave Ray
Stathis, I use the Lazytest watcher partly out of convenience. I happen to use Lazytest for testing so it's usually already running anyway. However, some work has already been done to extract the watch functionality [1]. It might be fun to combine your viewer with it. Maybe have a naming conventio

Re: Using Lein with Local Jars on Heroku

2011-12-06 Thread Robert Levy
I was wondering the same thing and I came across your un-answered question here. The short answer appears to be http://devcenter.heroku.com/articles/local-maven-dependencies I was looking into writing a Clojure web app that I would license to an acquaintance who is starting a business, and I want

Re: ANN: Clarity 0.5.1 - New GUI library

2011-12-06 Thread Stathis Sideris
Hello Dave, > I'll clarify some of Stathis' remarks about Seesaw below. Obviously, > I'm a little biased, but Clarity looks cool and I plan on "borrowing" > some of its features for Seesaw in the next release or two :)  I think > it's great to have multiple projects like this to inspire each other

Re: Type hints for ^map migrating from 1.2 to 1.3

2011-12-06 Thread Meikel Brandmeyer
Hi, Am 06.12.2011 um 18:31 schrieb Eric in San Diego: > I'm migrating some code from 1.2 to 1.3, and one of the things I've > encountered is that it no longer accepts ^map as a type hint. It's > happy if I use ^clojure.lang.PersistentArrayMap, but that's quite a > mouthful. > > Is there a more

Re: [ANN] dj-peg released 0.1.0

2011-12-06 Thread Brent Millare
I've added a little overview in the code, hopefully this should make things clearer. Also I made parse, the main invocation point, extensible to users of the library. -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email

Re: Type hints for ^map migrating from 1.2 to 1.3

2011-12-06 Thread Phil Hagelberg
On Tue, Dec 6, 2011 at 9:31 AM, Eric in San Diego wrote: > I'm migrating some code from 1.2 to 1.3, and one of the things I've > encountered is that it no longer accepts ^map as a type hint.  It's > happy if I use ^clojure.lang.PersistentArrayMap, but that's quite a > mouthful. It's my understand

Re: on lisp and scheme macros

2011-12-06 Thread Stephen Compall
On Tue, 2011-12-06 at 16:09 +0100, Tassilo Horn wrote: > Wikipedia lists syntax-case as hygienic macro system, which would make > it less powerful than CL macros, because if that was true, you could not > write anaphoric macros with it. You can write anaphora with syntax-case. In fact, defmacro i

Type hints for ^map migrating from 1.2 to 1.3

2011-12-06 Thread Eric in San Diego
I'm migrating some code from 1.2 to 1.3, and one of the things I've encountered is that it no longer accepts ^map as a type hint. It's happy if I use ^clojure.lang.PersistentArrayMap, but that's quite a mouthful. Is there a more compact abbreviation I can use? Where are such things documented? T

Re: Ending or closing malformed line in REPL

2011-12-06 Thread Laurent PETIT
2011/12/6 jlhouchin : > On 12/6/2011 12:23 AM, Laurent PETIT wrote: >> 2011/12/6 jlhouchin: >>> On 12/5/2011 7:19 PM, Stephen Compall wrote: On Mon, 2011-12-05 at 09:51 -0800, jlhouchin wrote: > When I entered the closing " and then closing > paren. I was fine. You may also t

Re: swank-cdt: Using Slime with the Clojure Debugging Toolkit

2011-12-06 Thread Andrew
I get the same thing on Windows XP with Leiningen 1.6.2 on Java 1.7.0 Java HotSpot(TM) Client VM - copied tools.jar manually to my lib/ just to see if it would work - it did, and still gave a warning about tools.jar - tried the test drive and when I type v I get this: *clojure\set.clj -

Re: Ending or closing malformed line in REPL

2011-12-06 Thread jlhouchin
On Dec 6, 10:04 am, Stuart Sierra wrote: > The built-in Clojure REPL is bare-bones to minimize external dependencies. > Maybe some day we can have alternate distributions with more full-featured > REPLs. For now, it's easier to use a development environment: Emacs + > inferior-lisp or SLIME, Count

Re: Ending or closing malformed line in REPL

2011-12-06 Thread jlhouchin
On 12/6/2011 12:23 AM, Laurent PETIT wrote: > 2011/12/6 jlhouchin: >> On 12/5/2011 7:19 PM, Stephen Compall wrote: >>> On Mon, 2011-12-05 at 09:51 -0800, jlhouchin wrote: When I entered the closing " and then closing paren. I was fine. >>> >>> You may also try backspace; unusually for a R

Re: Surprising behavior with clojure.core/int (and probably other primitive integer functions)

2011-12-06 Thread Stuart Sierra
As David mentioned, *unchecked-math* is documented as a compile-time flag. The coercion functions are a bit muddled by the changes to primitive math in 1.3. In Clojure 1.2, you could get primitive int inside loop/recur by calling `int` in the loop initialization. You can still do that in 1.3, bu

Re: Surprising behavior with clojure.core/int (and probably other primitive integer functions)

2011-12-06 Thread David Nolen
*unchecked-math* is a compiler flag. On Tue, Dec 6, 2011 at 7:00 AM, Cedric Greevey wrote: > user=> (binding [*unchecked-math* true] (map int [33 77 0x])) > # of range for int: 4294967295> > > The cause of this: > > (defn int > "Coerce to int" > { >:inline (fn [x] `(. clojure.la

Re: Ending or closing malformed line in REPL

2011-12-06 Thread Stuart Sierra
The built-in Clojure REPL is bare-bones to minimize external dependencies. Maybe some day we can have alternate distributions with more full-featured REPLs. For now, it's easier to use a development environment: Emacs + inferior-lisp or SLIME, Counterclockwise + Eclipse, Clooj, LaClojure + Inte

Surprising behavior with clojure.core/int (and probably other primitive integer functions)

2011-12-06 Thread Cedric Greevey
user=> (binding [*unchecked-math* true] (map int [33 77 0x])) # The cause of this: (defn int "Coerce to int" { :inline (fn [x] `(. clojure.lang.RT (~(if *unchecked-math* 'uncheckedIntCast 'intCast) ~x))) :added "1.0"} [x] (. clojure.lang.RT (intCast x))) The inline and non-i

Re: on lisp and scheme macros

2011-12-06 Thread Tassilo Horn
"Jose A. Ortega Ruiz" writes: Hi Jose, >> I think that Common Lisp macros are, strictly speaking, more powerful >> than Scheme macros, but I don't have a citation. > > That's only true for syntax-rules macros. syntax-case macros, which > most schemes provide and are required by R6RS, are, stric

Re: No longer able to write a UUID to Postgres with ClojureQL

2011-12-06 Thread Herwig Hochleitner
2011/12/6 Sean Corfield : > If it helps someone debug this for Don (since he and I discussed this > off-list): > > The stack trace from ClojureQL originates in its function to return > generated keys and it's calling .getInt on the (generated) key which > fails because it's a UUID. > > So the ques