Re: ClojureScript instead of CoffeeScript for complete web app development?

2012-06-14 Thread Jacobo Polavieja
El jueves, 14 de junio de 2012 08:39:19 UTC+2, Kevin Lynagh escribió: > > > >> As to your first point and only to clarify, had you made it a wrapper for >> D3 and in a node.js application, there would still be no problem in using >> it server-side, am I right? >> > > Unfortunately, no---D3 requir

Re: Why isn't there a fold-right?

2012-06-14 Thread Tassilo Horn
Tassilo Horn writes: > r-reduce> (let [f1 (apply comp* (take 100 (repeat inc))) > f2 (apply comp (take 100 (repeat inc)))] > (bench (f1 0) :verbose) > (println "---") > (bench (f2 0) :verbose)) Oh, in

Re: Using read-string and macros together

2012-06-14 Thread Rob Harrop
Thanks Sean and Alan, I had noticed the same issue with moving (read-string) inside the macro - it works great for literals, but then why bother. I had almost resigned myself to that fact that this would require eval, but I wanted to exhaust all macro options first. Thanks, Rob On Thursday,

Re: Clojurescript (latest) advanced mode compilation => java.lang.ClassCastException ?

2012-06-14 Thread Dave Sann
It may take some time. I'll see what I can do. D On Thursday, 14 June 2012 00:09:49 UTC+10, David Nolen wrote: > > Does this problem only occur on a specific project? Can you create a > minimal reproducible case? > > Thanks, > David > > On Wed, Jun 13, 2012 at 7:54 AM, > >> So far I can only c

Re: If a protocol creates a Java interface under the covers...

2012-06-14 Thread nicolas.o...@gmail.com
> (defn move > "The function responsible for moving Pieces. Each piece knows how to move > itself. If trying? is true, there will be no histiry of the new state of the > board. Returns the new board." >  ^clojure.lang.PersistentVector > [game mappings p coords] > {:pre [(satisfies? Piece p)]}  ;saf

Re: If a protocol creates a Java interface under the covers...

2012-06-14 Thread Jim - FooBar();
On 14/06/12 10:01, nicolas.o...@gmail.com wrote: There should not be any atom in this. The function would be more reusable if it take a board and return a board without changing any atom. (You will still be to express the atom change around it but you could also use to try and build a tree withou

Re: If a protocol creates a Java interface under the covers...

2012-06-14 Thread Jim - FooBar();
On 14/06/12 07:27, Tassilo Horn wrote: I quickly glanced over your code. Why do you still have `undo`? That shouldn't be needed in a fully immutable world. If you make a move just for trying out, then simply don't reset! your atom with the new value of the current board. Undo is still there

Re: If a protocol creates a Java interface under the covers...

2012-06-14 Thread Jim - FooBar();
On 14/06/12 06:38, Philip Potter wrote: Another reason the interface exists is for interoperability - if you want a java class to participate in the protocol, you do it by implementing the corresponding interface. Phil People suggested that I should not consume the interface produced by a

Re: Clojurescript (latest) advanced mode compilation => java.lang.ClassCastException ?

2012-06-14 Thread Dave Sann
I (think) I have tracked it down to the following section of code from jayq.core (simplified) --- (ns jayq.core) (extend-type js/jQuery IIndexed (-nth [this n] (when (< n (count this)) (.slice this n (inc n (-nth [this n not-found] (if (< n (c

'dotimes' will not work inside a 'doto'...

2012-06-14 Thread Jim - FooBar();
(doto foo (.bar x) (.baz y) (dotimes [i 10] (.zab g))) won't work because foo is substituted as the second argument of 'dotimes'! It has to be 'do' instead of 'doto'... very subtle trap... Jim -- You received this message because you are subscribed to the Google Groups "Clojure" group. To

Re: If a protocol creates a Java interface under the covers...

2012-06-14 Thread Philip Potter
On 14 June 2012 11:17, Jim - FooBar(); wrote: > On 14/06/12 06:38, Philip Potter wrote: >> >> >> Another reason the interface exists is for interoperability - if you want >> a java class to participate in the protocol, you do it by implementing the >> corresponding interface. >> >> Phil >> > > Peo

[ANN] Tower, simple i18n library for Clojure

2012-06-14 Thread Peter Taoussanis
Hi all, Just put up an early release of a little i18n library that some of you might find useful. It's on Github (https://github.com/ptaoussanis/tower) and Clojars ( https://clojars.org/tower). Features (taken from the readme): * Consistent, lightweight wrappers for standard Java localization f

Re: ClojureScript instead of CoffeeScript for complete web app development?

2012-06-14 Thread Paul deGrandis
I've been building out substantial ClojureScript apps for a few months now. Previously I had written an HTML5 game engine, so I'm no stranger to lots of JavaScript. My CLJS code base is smaller, easier to organize/maintain, more functional and declarative, and boasts a level of server-side inte

Iterate and stack overflow

2012-06-14 Thread vmargioulas
Can someone explain why ... iterating over a sequence cause a stack overflow (first (drop 1000 (iterate (partial map inc) (range 10 -> java.lang.StackOverflowError ...but iterating over a vector works ok? (first (drop 1000 (iterate (comp vec (partial map inc)) (range 10 - > [1000 1001 1002

Re: Iterate and stack overflow

2012-06-14 Thread Dave Sann
It doesn't overflow for me. user=> (first (drop 1000 (iterate (partial map inc) (range 10 (1000 1001 1002 1003 1004 1005 1006 1007 1008 1009) On Thursday, 14 June 2012 22:52:33 UTC+10, vmargioulas wrote: > > Can someone explain why > ... iterating over a sequence cause a stack overflow >

Re: Iterate and stack overflow

2012-06-14 Thread Dave Sann
ah...but does for 1 On Thursday, 14 June 2012 22:58:58 UTC+10, Dave Sann wrote: > > It doesn't overflow for me. > > > user=> (first (drop 1000 (iterate (partial map inc) (range 10 > (1000 1001 1002 1003 1004 1005 1006 1007 1008 1009) > > > On Thursday, 14 June 2012 22:52:33 UTC+10, vmargi

Re: Iterate and stack overflow

2012-06-14 Thread Dave Sann
I suspect that the answer is the use of partial and the implementation of iterate with (comp vec... you force realisation of the vector without this I think you get (partial map (partial map (partial ) as f is repeatedly applied if you do this, (first (drop 10 (iterate #(apply list (m

Re: Iterate and stack overflow

2012-06-14 Thread Dave Sann
also (first (drop 10 (iterate #(doall (map inc %)) (range 10 so the better answer is probably - because map is lazy On Thursday, 14 June 2012 23:06:27 UTC+10, Dave Sann wrote: > > I suspect that the answer is the use of partial and the implementation of > iterate > > with (comp vec...

Re: Iterate and stack overflow

2012-06-14 Thread vmargioulas
Thanks, this explains the stack overflow On Thursday, June 14, 2012 4:12:28 PM UTC+3, Dave Sann wrote: > > also > > (first (drop 10 (iterate #(doall (map inc %)) (range 10 > > so the better answer is probably - because map is lazy > > > On Thursday, 14 June 2012 23:06:27 UTC+10, Dave Sann

Re: Central screwup

2012-06-14 Thread Stuart Sierra
> Is there anyone on the Clojure/core team with a contact among those > who run Central who could get them to look into this? > I'm on the Sonatype OSSRH mailing list: https://docs.sonatype.org/display/Repository/Sonatype+OSS+Maven+Repository+Usage+Guide (mailing list addresses at the bottom)

Re: ClojureScript instead of CoffeeScript for complete web app development?

2012-06-14 Thread Jacobo Polavieja
El jueves, 14 de junio de 2012 14:42:14 UTC+2, Paul deGrandis escribió: > > > I've been building out substantial ClojureScript apps for a few months now. > Previously I had written an HTML5 game engine, so I'm no stranger to lots > of JavaScript. > > My CLJS code base is smaller, easier to organiz

IllegalStateException "I/O in transaction" in REPL

2012-06-14 Thread Daniil Mirylenka
I'm trying to insert some values into MySQL db, via clojure.java.jdbc. When I call my code from Leiningen REPL, I get: IllegalStateException I/O in transaction clojure.java.jdbc.internal/transaction* (internal.clj:212). The same code runs without exception when executed outside repl (in my ca

Re: A tutorial for how to setup your clojure development environment for: Emacs, Leiningen and Linux.

2012-06-14 Thread David Della Costa
Just saw this thread. I went through something similar recently: I'm a long-time emacs user just getting into Clojure, so naturally I set it up with emacs. I set it up with Leiningen (a 2.0.0 preview version), and while I found it relatively painless, I did have a few problems mostly with Emacs.

Re: Broken "Sequences" screencast

2012-06-14 Thread David Della Costa
Hey folks, I see that this was never answered, but it remains a problem. I've tried viewing the video on blip (http://blip.tv/clojure/clojure-sequences-740581) as well as downloading via iTunes, but no dice--I get about 8 seconds of Rich introducing the topic and then nothing. I'd love to see

Re: How about 'nth' accepts maps?

2012-06-14 Thread hyPiRion
On Tuesday, June 12, 2012 12:54:08 PM UTC+2, Chris Ford wrote: > > I guess the question should then be, should nth call seq on its argument? > This is horrible for performance. For a sequence, nth will run in O(n) time, whereas it for any indexed data structure (vectors, strings, arraylists, etc

Re: A tutorial for how to setup your clojure development environment for: Emacs, Leiningen and Linux.

2012-06-14 Thread John Gabriele
On Jun 13, 10:58 pm, Sean Corfield wrote: > On Wed, Jun 13, 2012 at 7:45 PM, Sean Corfield wrote: > > We definitely need improvements in the official getting started > > documentation. Starting here - > >http://dev.clojure.org/display/doc/Getting+Started- any specific > > problems / improvements

Re: 'dotimes' will not work inside a 'doto'...

2012-06-14 Thread Tassilo Horn
"Jim - FooBar();" writes: > (doto foo > (.bar x) > (.baz y) > (dotimes [i 10] (.zab g))) > > won't work because foo is substituted as the second argument of > 'dotimes'! The docs clearly state that. > It has to be 'do' instead of 'doto'... Then, you need (.bar foo x), (.baz foo y), and (.za

Re: Broken "Sequences" screencast

2012-06-14 Thread Kevin Ilchmann Jørgensen
>From the rss. http://blip.tv/file/get/Richhickey-ClojureSequences284.mov The sound dont get any better thru. /Kevin On Thu, Jun 14, 2012 at 4:11 AM, David Della Costa wrote: > Hey folks, I see that this was never answered, but it remains a problem. > I've tried viewing the video on blip > (htt

Re: 'dotimes' will not work inside a 'doto'...

2012-06-14 Thread Aaron Cohen
On Thu, Jun 14, 2012 at 8:09 AM, Jim - FooBar(); wrote: > (doto foo >  (.bar x) >  (.baz y) >  (dotimes [i 10] (.zab g))) > > won't work because foo is substituted as the second argument of 'dotimes'! > It has to be 'do' instead of 'doto'... > > very subtle trap... > > Jim I think the "trap" here

Re: IllegalStateException "I/O in transaction" in REPL

2012-06-14 Thread Meikel Brandmeyer (kotarak)
Hi, the exception probably stems from the fact that you do the database interaction inside a dosync transaction. Kind regards 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

Re: Clojurescript - Javascript constructor and namespace with the same name problem

2012-06-14 Thread David Nolen
:require now no longer requires :as. :require now also supports :refer (thanks Michal!) which brings us in line with Clojure on the JVM. Still discussing the implications of doing :import (CLJS-312). David On Mon, Jun 11, 2012 at 9:36 PM, Michał Marczyk wrote: > Patch attached to 272 (note it's

Re: 'dotimes' will not work inside a 'doto'...

2012-06-14 Thread Jim - FooBar();
On 14/06/12 15:10, Tassilo Horn wrote: The docs clearly state that. Where? I don't see any warnings...It does say "... calls all of the methods and functions with the value of x supplied at the front of the given arguments" but it wasn't obvious to me at first! user=> (doc dotimes) --

Re: 'dotimes' will not work inside a 'doto'...

2012-06-14 Thread David Nolen
On Thu, Jun 14, 2012 at 10:39 AM, Jim - FooBar(); wrote: > Evaluates x then calls all of the methods and functions with the > value of x supplied at the front of the given arguments > that's in the docstring for doto. but dotimes is not a method or a function is it? :) David -- You received t

Re: 'dotimes' will not work inside a 'doto'...

2012-06-14 Thread Jim - FooBar();
well, no... :-) Jim On 14/06/12 15:52, David Nolen wrote: On Thu, Jun 14, 2012 at 10:39 AM, Jim - FooBar(); mailto:jimpil1...@gmail.com>> wrote: Evaluates x then calls all of the methods and functions with the value of x supplied at the front of the given arguments that's in the do

Is there a reason why 'some' returns "nil" instead o "false"?

2012-06-14 Thread Jacobo Polavieja
Hi! I've just started learning Clojure today. I've started reading "Clojure - Functional Programming for the JVM" ( http://java.ociweb.com/mark/clojure/article.html ). Anyway, on the collections part ( http://java.ociweb.com/mark/cloj

Re: Is there a reason why 'some' returns "nil" instead o "false"?

2012-06-14 Thread David Nolen
not-every? is a predicate (note the ?) some is not. On Thu, Jun 14, 2012 at 11:31 AM, Jacobo Polavieja < jacobopolavi...@gmail.com> wrote: > Hi! > > I've just started learning Clojure today. I've started reading "Clojure - > Functional Programming for the JVM" ( > http://java.ociweb.com/mark/clo

Re: How about 'nth' accepts maps?

2012-06-14 Thread Tassilo Horn
hyPiRion writes: > If you really need nth for your hash map in the way you describe and > don't need to remove elements from the map, then I suggest creating a > new data structure with a vector and a hash map. There's the ordered lib on clojars which provides sets and maps that keep their inser

Re: Is there a reason why 'some' returns "nil" instead o "false"?

2012-06-14 Thread Tassilo Horn
Jacobo Polavieja writes: Hi Jacobo, > (not-every? #(instance? String %) stooges) ; -> false > (some #(instance? Number %) stooges) ; -> nil > > Is there a reason why (some) doesn't return false also? `some` is no predicate (else it would have a ? appended). It simply returns the first truthy (

Re: Is there a reason why 'some' returns "nil" instead o "false"?

2012-06-14 Thread Jacobo Polavieja
Thank you both! I had the epiphany now and realized it is what you both stated. But you had already answered! So quick :). I think I've tried too run too much and have read through too fast. All morning setting up Clojure and learning Clojure. It's fun but my brain may now need some rest... Th

Re: Is there a reason why 'some' returns "nil" instead o "false"?

2012-06-14 Thread Jim - FooBar();
you can always make your own with a little macro but if you just started learning today you may want to stick with some... I, like you, wanted a version that returns true or false a couple of months ago.. here it is: (defmacro in? "Returns true if colle contains elm, false otherwise." [coll

Re: Is there a reason why 'some' returns "nil" instead o "false"?

2012-06-14 Thread David Nolen
Definitely something that should not written as a macro :) David On Thu, Jun 14, 2012 at 1:14 PM, Jim - FooBar(); wrote: > you can always make your own with a little macro but if you just started > learning today you may want to stick with some... > > I, like you, wanted a version that returns

Re: Is there a reason why 'some' returns "nil" instead o "false"?

2012-06-14 Thread Jim - FooBar();
I don't see why not if you really really need to return true/false... Of course as Tassilo said nil is falsey so it is unlikely that you would ever need to do that... Jim On 14/06/12 18:16, David Nolen wrote: Definitely something that should not written as a macro :) David On Thu, Jun 14, 2

Re: Is there a reason why 'some' returns "nil" instead o "false"?

2012-06-14 Thread nicolas.o...@gmail.com
>> (defmacro in? >> "Returns true if colle contains elm, false otherwise." >> [colle elm] >> `(if (some #{~elm} ~colle) true false)) Yes. Should not be a macro. (There is no reason for it to be a macro). On top of that, it is not very often useful to convert nil to false as clojure understands n

Re: Is there a reason why 'some' returns "nil" instead o "false"?

2012-06-14 Thread nicolas.o...@gmail.com
On Thu, Jun 14, 2012 at 6:19 PM, Jim - FooBar(); wrote: > I don't see why not if you really really need to return true/false... > Because it can be written as a function. Macro are only for things that cannot be easily written as functions. (And then it should be backed by functions that are usa

Re: Is there a reason why 'some' returns "nil" instead o "false"?

2012-06-14 Thread Jim - FooBar();
On 14/06/12 18:20, nicolas.o...@gmail.com wrote: (defn to-bool [x] (if x true false)) and use it when necessary. why add the extra overhead of potentially boxing/unboxing x in such a simple case? Its not like the macro is getting out of control...Its a one liner... Jim -- You received t

Re: Is there a reason why 'some' returns "nil" instead o "false"?

2012-06-14 Thread nicolas.o...@gmail.com
> > >> why add the extra overhead of potentially boxing/unboxing x in such a > simple case? Its not like the macro is getting out of control...Its a one > liner... > > Because functions are first class and not macros. Ex: (map to-bool l) -- You received this message because you are subscribed to

Re: A tutorial for how to setup your clojure development environment for: Emacs, Leiningen and Linux.

2012-06-14 Thread Phil Hagelberg
On Wed, Jun 13, 2012 at 8:01 PM, David Della Costa wrote: > I also think that, at present, while coming in through Leiningen is > definitely the most painless way to do things (I'm really loving it > actually, as a Ruby dev it kind of seems like rvm + bundler + rake all > wrapped up in one handy p

Re: Is there a reason why 'some' returns "nil" instead o "false"?

2012-06-14 Thread Jim - FooBar();
I have a functionize macro if I ever want to do that with a macro but I think we are getting off topic here... all I'm saying is that if I want to keep a loop very tight and want to perform a couple of checks inline, why clutter the body of the loop with 'if's or 'some's or whatever...you want

Re: Is there a reason why 'some' returns "nil" instead o "false"?

2012-06-14 Thread Tassilo Horn
"Jim - FooBar();" writes: > (defmacro in? > "Returns true if colle contains elm, false otherwise." > [colle elm] > `(if (some #{~elm} ~colle) true false)) Except for the complains that this doesn't need to be a macro (which I agree with), it is also wrong. user> (in? [nil false] nil)

Re: Is there a reason why 'some' returns "nil" instead o "false"?

2012-06-14 Thread Jim - FooBar();
nice catch and point taken... however the exact same thing would happen if this was a function...it's just wrong ! Jim On 14/06/12 19:32, Tassilo Horn wrote: "Jim - FooBar();" writes: (defmacro in? "Returns true if colle contains elm, false otherwise." [colle elm] `(if (some #{~elm}

Re: Is there a reason why 'some' returns "nil" instead o "false"?

2012-06-14 Thread Stuart Halloway
(doc boolean) Cheers, Stu Stuart Halloway Clojure/core http://clojure.com > >> (defmacro in? > >> "Returns true if colle contains elm, false otherwise." > >> [colle elm] > >> `(if (some #{~elm} ~colle) true false)) > > Yes. Should not be a macro. (There is no reason for it to be a macro). >

Re: Clojure Sticker

2012-06-14 Thread Rich Hickey
No, you are not allowed to reproduce the Clojure logo and put it up for sale. I'd be happy to set up an official way to get stickers/shirts etc. Rich On Jun 11, 2012, at 6:23 PM, Sven Johansson wrote: > I've been trawling the internet for Clojure stickers before and > come up empty. If there'

Re: Clojure Sticker

2012-06-14 Thread Sean Neilan
I'd buy one. On Thu, Jun 14, 2012 at 1:52 PM, Rich Hickey wrote: > No, you are not allowed to reproduce the Clojure logo and put it up for > sale. > > I'd be happy to set up an official way to get stickers/shirts etc. > > Rich > > > On Jun 11, 2012, at 6:23 PM, Sven Johansson wrote: > > > I've b

Re: Clojure Sticker

2012-06-14 Thread Joseph Smith
Excellent. I'd like a sticker for my notebook. :) --- Joseph Smith j...@uwcreations.com @solussd On Jun 14, 2012, at 11:52 AM, Rich Hickey wrote: > No, you are not allowed to reproduce the Clojure logo and put it up for sale. > > I'd be happy to set up an official way to get stickers/shirts e

Re: Clojurescript (latest) advanced mode compilation => java.lang.ClassCastException ?

2012-06-14 Thread David Nolen
Thank you! http://dev.clojure.org/jira/browse/CLJS-315 On Thu, Jun 14, 2012 at 6:43 AM, Dave Sann wrote: > I (think) I have tracked it down to the following section of code from > jayq.core (simplified) > > --- > > (ns jayq.core) > > (extend-type js/jQuery > IIndexe

Re: Clojure Sticker

2012-06-14 Thread Sven Johansson
On Thu, Jun 14, 2012 at 8:52 PM, Rich Hickey wrote: > No, you are not allowed to reproduce the Clojure logo and put it up for > sale. > > I'd be happy to set up an official way to get stickers/shirts etc. > > Thanks - that'd be much preferable! Regards/Sven -- You received this message because

Re: Type hint for vector element?

2012-06-14 Thread Aaron Cohen
On Wed, Jun 13, 2012 at 8:22 PM, Warren Lynn wrote: > It is very common for all elements in a vector to be always of the same > type. Is there any way to hint the type to Clojure? Does such hint can even > improve performance? Thank you. > In general, not through type hints. However, there are im

Re: Clojure Sticker

2012-06-14 Thread Aaron Cohen
On Thu, Jun 14, 2012 at 2:52 PM, Rich Hickey wrote: > No, you are not allowed to reproduce the Clojure logo and put it up for sale. > > I'd be happy to set up an official way to get stickers/shirts etc. > > Rich I just wanted to mention that the American Apparel t-shirt that was given out at Cloj

Re: IllegalStateException "I/O in transaction" in REPL

2012-06-14 Thread dmirylenka
Could you please explain a bit more? I don't have any dosync in my code. Daniil On Thursday, June 14, 2012 4:17:46 PM UTC+2, Meikel Brandmeyer (kotarak) wrote: > > Hi, > > the exception probably stems from the fact that you do the database > interaction inside a dosync transaction. > > Kind re

Re: A tutorial for how to setup your clojure development environment for: Emacs, Leiningen and Linux.

2012-06-14 Thread fenton
I like the idea of taking care of copyright properly, thanks Sean for the links to those pages. I think the black and white split, docs = confluence, code = github, is not so good. I think John's point about the *.md files being a very good place for documentation. I think the right way to d

Re: Clojure Sticker

2012-06-14 Thread Bruce Durling
Rich, On Thu, Jun 14, 2012 at 7:52 PM, Rich Hickey wrote: > No, you are not allowed to reproduce the Clojure logo and put it up for sale. > > I'd be happy to set up an official way to get stickers/shirts etc. +1 for being able to buy an official one. cheers, Bruce -- You received this message

Re: 'dotimes' will not work inside a 'doto'...

2012-06-14 Thread Walter Tetzner
On Thursday, June 14, 2012 8:09:50 AM UTC-4, Jim foo.bar wrote: > > It has to be 'do' instead of 'doto'... > Well, if you want to be able to use doto, you could do something like (doto foo (.bar x) (.baz y) (#(dotimes [i 10] (.zab % g -- You received this message because you are sub

Re: Clojure Sticker

2012-06-14 Thread Jason Lewis
I, for one, would be happy to collaborate on an open-source Clojure ecommerce app, if it meant Rich would sell us stickers sooner. (only half joking) Jason On Jun 14, 2012 5:33 PM, "Bruce Durling" wrote: > Rich, > > On Thu, Jun 14, 2012 at 7:52 PM, Rich Hickey wrote: > > No, you are not allowe

Re: IllegalStateException "I/O in transaction" in REPL

2012-06-14 Thread Meikel Brandmeyer
Hi, Am 14.06.2012 um 22:33 schrieb dmirylenka: > Could you please explain a bit more? > > I don't have any dosync in my code. transaction* contains an io! form which throws such an exception when called in a dosync. How does the code look like, which does not work? Kind regards Meikel -- Yo

Re: Clojure Sticker

2012-06-14 Thread Jim - FooBar();
On 14/06/12 19:52, Rich Hickey wrote: I'd be happy to set up an official way to get stickers/shirts etc. zazzle.com sells t-shirts already...not sure whether its legit or not though... Jim -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post

Re: 'dotimes' will not work inside a 'doto'...

2012-06-14 Thread Andy Fingerhut
On Jun 14, 2012, at 7:59 AM, Jim - FooBar(); wrote: > well, no... :-) > > Jim > > On 14/06/12 15:52, David Nolen wrote: >> >> On Thu, Jun 14, 2012 at 10:39 AM, Jim - FooBar(); >> wrote: >> Evaluates x then calls all of the methods and functions with the >> value of x supplied at the front

Re: 'dotimes' will not work inside a 'doto'...

2012-06-14 Thread Jim - FooBar();
why not even go a bit further and add a tiny warning with regards to evaluating macros as well? I mean I don't know about you guys but I've not been 'burned' before when trying to use macros inside macros and the error message is not immediately obvious what it means...it does say that the argu

Re: A tutorial for how to setup your clojure development environment for: Emacs, Leiningen and Linux.

2012-06-14 Thread Phil Hagelberg
On Thu, Jun 14, 2012 at 2:09 PM, fenton wrote > I'm not going to give up the wonderful prettiness that github does with a > line like: > > ```clojure > (defn myfunc [x] (+ 2 x)) > ``` > > which i can't do with confluence.  This group is about a programming > language, nice colorizing is really gre

Re: Using read-string and macros together

2012-06-14 Thread Stephen Compall
On Thu, 2012-06-14 at 00:49 -0700, Rob Harrop wrote: > I had almost resigned myself to that fact that this would require eval, but > I wanted to exhaust all macro options first. As a compromise, you might consider a limited evaluator, such as used by #=, or a sandboxed evaluator, such as the IRC

Re: IllegalStateException "I/O in transaction" in REPL

2012-06-14 Thread Stephen Compall
On Thu, 2012-06-14 at 13:33 -0700, dmirylenka wrote: > Could you please explain a bit more? > > I don't have any dosync in my code. Look through your backtrace for a call to clojure.lang.LockingTransaction.runInTransaction. Its caller is using dosync. -- Stephen Compall ^aCollection allSatisf

ANN: lambic v. 0.1.0

2012-06-14 Thread Robert Levy
This announcement is more of a call for suggestions (even pull requests if you are moved to do so) as there's not much to it yet, just enough to to demonstrate the concept for simpler transformations. I'm thinking of how best to go about supporting a wider range of sequence transformations. https

Re: 'dotimes' will not work inside a 'doto'...

2012-06-14 Thread Andy Fingerhut
I highly recommend clojuredocs.org for adding examples of pitfalls/traps. I've added several there myself, e.g. for clojure.core/future (and also clojure.core/pmap, clojure.java.shell/sh): http://clojuredocs.org/clojure_core/clojure.core/future It takes only a few minutes to do so. Andy On

Re: Clojurescript (latest) advanced mode compilation => java.lang.ClassCastException ?

2012-06-14 Thread David Nolen
This should be resolved in master - please let us know if you continue to run into problems. On Thu, Jun 14, 2012 at 3:06 PM, David Nolen wrote: > Thank you! http://dev.clojure.org/jira/browse/CLJS-315 > > > On Thu, Jun 14, 2012 at 6:43 AM, Dave Sann wrote: > >> I (think) I have tracked it down

Re: ANN: lambic v. 0.1.0

2012-06-14 Thread kovas boguta
Very cool! I'm working on a very similar thing, but aimed at reference types and with the ability for incremental transformations. Specifying this kind of thing declaratively opens up the door to a lot of possibilities. On Thu, Jun 14, 2012 at 7:44 PM, Robert Levy wrote: > This announcement is

Re: Why is lein so slow?

2012-06-14 Thread sailormoo...@gmail.com
I found lein repl is slower and most of time it just freezes. -- 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

Re: Why is lein so slow?

2012-06-14 Thread thenwithexpandedwingshesteershisflight
me too! And using lein cljsbuild auto takes several seconds to compile, whereas cljsc/build + some file copying for shared code takes under a second. Also, I've found cljsbuild auto sometimes doesn't compile my code completely. I can't figure out the pattern, but I edit something in one place i

Re: A tutorial for how to setup your clojure development environment for: Emacs, Leiningen and Linux.

2012-06-14 Thread Tim Jones
On Thu, Jun 14, 2012 at 10:31:44AM -0700, Phil Hagelberg wrote: > On Wed, Jun 13, 2012 at 8:01 PM, David Della Costa > wrote: > > Similarly, it's easy to > > get lost (as a beginner) between namespace issues with packages and > > how to set things up properly with Leiningen.  It'd be good to have

Re: Why is lein so slow?

2012-06-14 Thread Andy Fingerhut
On Jun 13, 2012, at 5:27 PM, Warren Lynn wrote: > I cannot help notice that leinengen seems quite slow. Even "lein help" takes > 8 seconds to finish printing all the information. I am using version 2 on > Windows 7(that .bat file). Can anyone explain what is going on? Or is it just > me? Thank

Re: so why it has to be so complicated / Longest Increasing Sub-Seq

2012-06-14 Thread Tyler Perkins
Here's what I came up with, a pretty functional approach: (fn [l] (let [lt(partial apply <) pairs (->> (map vector l (rest l)) (partition-by lt) (filter (comp lt first))) max-count (apply max 0 (map count pairs))] (->>

Re: A tutorial for how to setup your clojure development environment for: Emacs, Leiningen and Linux.

2012-06-14 Thread Korny Sietsma
"Yes emacs is very weird for newbies, but most clojurians use it." I tend to think this is an unnecessary barrier for entry - yes, people would be more productive in the long run using emacs, but it has it's own big learning curve, and is definitely not necessary to get started in clojure. It's g

Re: A tutorial for how to setup your clojure development environment for: Emacs, Leiningen and Linux.

2012-06-14 Thread Sean Corfield
On Thu, Jun 14, 2012 at 6:52 PM, Korny Sietsma wrote: >  It's great to have comprehensive instructions for people who want the full > power of emacs - but we should also make sure there are clear "getting > started" instructions for people who are happy with a smart text editor and > a repl. And

clojure.core.cache status?

2012-06-14 Thread Sean Corfield
I'm at a point where I'd like to start using clojure.core.cache (aren't I brave? :) I tried 0.5.0 which is the stable version - and had a bit of a fight with the docs because 0.5.0 has quite a different API to what's described here: http://clojure.github.com/core.cache/#clojure.core.cache/ttl-cac

Re: Broken "Sequences" screencast

2012-06-14 Thread David Della Costa
Kevin, thanks very much! When I went to load that in a browser, I got the message "This video is only available in the Blip player..." but I was successfully able to download the video via curl. You're right, there's a buzzing sound throughout, unfortunately...ah well. Thanks again-- Dave 2012

Re: A tutorial for how to setup your clojure development environment for: Emacs, Leiningen and Linux.

2012-06-14 Thread David Della Costa
Hey Phil, thanks for the response. >> trying to navigate whether to use >> 1.x or 2.x preview is a bit confusing--and the variety of docs >> available for setting things up is confusing. > > Yeah, as of the last release we're pretty much advising everyone to go > with 2.x, but the docs still need

Announcing KR v1.4.2 :: RDF and SPARQL support using clojure data / interfaces

2012-06-14 Thread Kevin Livingston
Hello everyone, I just wanted to announce the open-sourcing of a RDF and SPARQL (and more) library that has been under development and use for quite a while in our lab. It supports the use of clojure symbols and lists as rdf resources and triples, and it can form triple patterns into sparql qu

Re: Central screwup

2012-06-14 Thread Nelson Morris
On Thu, Jun 14, 2012 at 8:38 AM, Stuart Sierra wrote: > >> >> Is there anyone on the Clojure/core team with a contact among those >> who run Central who could get them to look into this? > > > I'm on the Sonatype OSSRH mailing list: > https://docs.sonatype.org/display/Repository/Sonatype+OSS+Maven

Enfocus issues

2012-06-14 Thread Andreas Kostler
Hi everyone, I finally decided to give clojurescript a spin. Unfortunately, the momentum died before I even got the ball running. I'm trying to replicate the canonical example on the enfocus website using lein-cljsbuild [0.2.1] and enfocus [0.9.1-SNAPSHOT]: (ns my.namespace (:require [enfocus.c

Re: Enfocus issues

2012-06-14 Thread David Nolen
On Fri, Jun 15, 2012 at 1:23 AM, Andreas Kostler < andreas.koest...@leica-geosystems.com> wrote: > (set! (.onload js/window) start) Should be (set! (.-onload js/window) start) -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group,

Re: Enfocus issues

2012-06-14 Thread Andreas Kostler
There you go...wrong on the example-page then. Thanks David On 15 June 2012 15:00, David Nolen wrote: > On Fri, Jun 15, 2012 at 1:23 AM, Andreas Kostler < > andreas.koest...@leica-geosystems.com> wrote: > >> (set! (.onload js/window) start) > > > Should be (set! (.-onload js/window) start) > >

Re: Is there a reason why 'some' returns "nil" instead o "false"?

2012-06-14 Thread Tassilo Horn
"Jim - FooBar();" writes: > nice catch and point taken... > > however the exact same thing would happen if this was a > function...it's just wrong ! Yes. A correct version is (defn in? [coll e] (some (partial = e) coll)) Bye, Tassilo -- You received this message because you are su

Re: A tutorial for how to setup your clojure development environment for: Emacs, Leiningen and Linux.

2012-06-14 Thread fenton
What I'd suggest is that there be a git repo for clojure docs, where things can be brought together like the types of articles i'm writing, but tended by the clojure community. So i wouldn't suggest putting: "Getting started with emacs (for clojure) sic." in the clojure-mode repo, but perhaps a

Best practices for named arguments

2012-06-14 Thread David Jacobs
TL;DR: I want to know best practices for designing functions with multiple optional arguments. Okay, so I'm working to build machine learning algorithms in Clojure, and they tend to need many arguments. Being a long-time Ruby dev, I like to provide sensible defaults for almost all potential arg