Two Way DOM binding in clojurescript

2012-06-13 Thread Murtaza Husain
Hi, I would like to data in atoms to DOM elements in clojurescript. Are there any examples out there that demonstrate this ? Something like what knockout.js or angular.js provide. Thanks, Murtaza -- You received this message because you are subscribed to the Google Groups "Clojure" group. T

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

2012-06-13 Thread Kevin Lynagh
> > 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 requires a full DOM. Node.js is just the JavaScript engine. There are some fake DOM i

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

2012-06-13 Thread Tassilo Horn
"Jim - FooBar();" writes: > On the upside I did not have to change much and now at least it reads > nicer...however, on the down side executing a single move takes > roughly double the time (~ 13ms instead of ~8ms before)... I quickly glanced over your code. Why do you still have `undo`? That

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

2012-06-13 Thread Yoshinori Kohyama
Hi Andy and all, Here's mine with trying to separate steps. You can see each steps with commenting out later steps. (fn [coll] (->> coll ; 1st. Make tails of coll. (#(take-while (comp not nil?) (iterate next %))) ; 2nd. Take only consecutive elements from the head for each

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

2012-06-13 Thread Jacobo Polavieja
El jueves, 14 de junio de 2012 03:18:29 UTC+2, Kevin Lynagh escribió: > > Jacobo, > > Using JavaScript from ClojureScript is very straightforward. > There are a few points where interop is awkward, but that wasn't the main > reason I wrote a new library (in Clojure). > > There were two primary mot

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

2012-06-13 Thread Jacobo Polavieja
El jueves, 14 de junio de 2012 02:28:23 UTC+2, thenwithexpandedwingshesteershisflight escribió: > > > 1. I suppose you can't call any Java library from ClojureScript if you >> want it to compile to JS. Can you call any Clojure library and have it >> translated? >> > > If you want to use existing

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

2012-06-13 Thread Philip Potter
On Jun 12, 2012 7:41 PM, "Alan Malloy" wrote: > > On Jun 12, 5:56 am, "Jim - FooBar();" wrote: > > On 12/06/12 13:53, Jim - FooBar(); wrote: > > > > > On 12/06/12 13:47, Meikel Brandmeyer (kotarak) wrote: > > >> If update-position is a protocol function just call it without the > > >> dot. Just l

Re: Using read-string and macros together

2012-06-13 Thread Sean Corfield
On Wed, Jun 13, 2012 at 8:23 PM, Alan Malloy wrote: > This can't work as a macro - Sean's suggestion is just as broken as yours, Ah yes... I got too focused on the original code (with the literal) instead of trying something more real world... -- Sean A Corfield -- (904) 302-SEAN An Architect's

Calling Clojure from Java and classloader

2012-06-13 Thread Warren Lynn
Ok, I hit a wall and really did not see this coming. Based on what I have read, its really easy for Clojure and Java to work together. So I wrote some test Clojure code with a very simple defrecord (say named as "testrec") and AOT compile it, create a jar file, and add it to a "HelloWorld" java pr

Re: Using read-string and macros together

2012-06-13 Thread Alan Malloy
This can't work as a macro - Sean's suggestion is just as broken as yours, in that it needs the form supplied to be a compile-time literal, because macros are expanded at compile-time. You can do this at runtime with eval: something like (defn xr [s] (eval `(fn [] ~(read-string s, though of

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

2012-06-13 Thread Sean Corfield
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 that folks identify will generally get fixed > fair

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

2012-06-13 Thread Sean Corfield
On Wed, Jun 13, 2012 at 6:27 PM, fenton wrote: > I totally understand the value of having a single source of truth (DRY > principle).  My main problem was that to get from 0-60 for doing clojure > development is quite challenging. Which is why the official documentations needs contributions from

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

2012-06-13 Thread Phil Hagelberg
On Wed, Jun 13, 2012 at 6:27 PM, fenton wrote: > Then I head over to > lein: https://github.com/technomancy/leiningen, well this one is better than > most install instructions, but still IMO, isn't as simple to follow as my > instructions.  Which I'd agree I should update to use Lein 2.  However i

Re: Using read-string and macros together

2012-06-13 Thread Sean Corfield
On Wed, Jun 13, 2012 at 7:06 PM, Sean Corfield wrote: > user=> (defmacro xr [f] (list 'fn [] (read-string f))) Or, if you prefer: (defmacro xr [f] `(fn [] ~(read-string f))) -- Sean A Corfield -- (904) 302-SEAN An Architect's View -- http://corfield.org/ World Singles, LLC. -- http://worldsingle

Re: Problems resolving dependencies due to maven central repo fail

2012-06-13 Thread Phil Hagelberg
On Wed, Jun 13, 2012 at 4:57 PM, Stuart Sierra wrote: > I can't reproduce the problem you're seeing. Right now, when I visit > http://repo1.maven.org/maven2/org/clojure/clojure/maven-metadata.xml I get > the the same list as "Article A" in your original post. This was fixed within a day or so of

Re: Why is lein so slow?

2012-06-13 Thread Phil Hagelberg
On Wed, 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: Using read-string and macros together

2012-06-13 Thread Sean Corfield
On Wed, Jun 13, 2012 at 4:29 PM, Rob Harrop wrote: > I'm having problems getting read-string and macros to play nicely, a problem > which can be distilled as below: Try this: user=> (defmacro xr [f] (list 'fn [] (read-string f))) #'user/xr user=> (apply (xr "(println \"hello\")") []) hello nil u

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

2012-06-13 Thread Qiu Xiafei
how about add something about auto completion, it's pretty useful for working around large project or java interop. On Thu, Jun 14, 2012 at 9:27 AM, fenton wrote: > I totally understand the value of having a single source of truth (DRY > principle). My main problem was that to get from 0-60 for

Re: Using read-string and macros together

2012-06-13 Thread Brian Mosley
Doesn't this produce something like: (fn [] (read-string "(println \"hello\")")) which would return the list '(println "hello")? On Wednesday, June 13, 2012 7:29:54 PM UTC-4, Rob Harrop wrote: > > Hi, > > I have a use case where I'd like to load small forms in String format from > a database

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

2012-06-13 Thread fenton
I totally understand the value of having a single source of truth (DRY principle). My main problem was that to get from 0-60 for doing clojure development is quite challenging. Say you want to do what my document describes, that is setup Leiningen, setup emacs, etc..., it took me weeks to get

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

2012-06-13 Thread Kevin Lynagh
Jacobo, Using JavaScript from ClojureScript is very straightforward. There are a few points where interop is awkward, but that wasn't the main reason I wrote a new library (in Clojure). There were two primary motivations for that. 1) We needed a visualization library that would work on the serv

Re: Why is lein so slow?

2012-06-13 Thread Sean Corfield
On Wed, 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: ClojureScript instead of CoffeeScript for complete web app development?

2012-06-13 Thread thenwithexpandedwingshesteershisflight
> 1. I suppose you can't call any Java library from ClojureScript if you > want it to compile to JS. Can you call any Clojure library and have it > translated? > If you want to use existing Java libraries then run those on the server. Clojure code will run either on the client or the server i

Why is lein so slow?

2012-06-13 Thread Warren Lynn
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 you. -- You received this message because you are subsc

Type hint for vector element?

2012-06-13 Thread Warren Lynn
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. -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group

Re: Exclude some dependencies with lein uberjar

2012-06-13 Thread Warren Lynn
> Why does AOT happen after exclusion? Shouldn't exclusion be the last > > step in the process which would hardly break anything and would > > eventually fix the issue? > > Oh, I meant this would be a problem if you used profiles for > separating dependencies. If you use :uberjar-exclusions y

Re: Clojure (Slim 1.4.0) and Azul don't like each other

2012-06-13 Thread Mark
Sorry, I thought it was something simple but obviously not. I don't think I can help On Wednesday, June 13, 2012 1:52:41 PM UTC-7, Edward Z. Yang wrote: > > Here is the full stack trace: > > Caused by: clojure.lang.Compiler$CompilerException: > java.lang.NoSuchFieldException: close, compiling:

Re: clashing methods between 2 different protocols???

2012-06-13 Thread Stuart Sierra
I see you have found that you can override Object.toString in defrecord by including Object in your defrecord. However, Object is a special case, since every Java class extends Object. You *can* have two protocols with the same method name, but they must be in *different* namespaces. Every pr

Re: Problems resolving dependencies due to maven central repo fail

2012-06-13 Thread Stuart Sierra
Hi Craig, I can't reproduce the problem you're seeing. Right now, when I visit http://repo1.maven.org/maven2/org/clojure/clojure/maven-metadata.xml I get the the same list as "Article A" in your original post. Is it possible that the maven-metadata-central.xml file in your local Maven cache is

Re: Classpath problem with Java interop and Leiningen

2012-06-13 Thread Denis Vulinovich
Thanks for all the help, guys. Because Laurent's suggesting of calling "sample/bar.clj" instead of "sample.bar.clj" in loadResourceScript() seemed the easiest, I tried that first and it worked. So it looks like in that method you have to specify the path the file, relative to the src directory, ra

ClojureScript instead of CoffeeScript for complete web app development?

2012-06-13 Thread Jacobo Polavieja
Hi all, I've always developed desktop apps with the typical C/C++/C# stack and I was willing to delve into web development. I really don't like Javascript so I thought to give CoffeScript with node.js a chance, but as I love functional programming the idea of using Clojure/Clojurescript for EVE

Using read-string and macros together

2012-06-13 Thread Rob Harrop
Hi, I have a use case where I'd like to load small forms in String format from a database and wrap them in functions. This is to support some basic runtime customisation. I'm having problems getting read-string and macros to play nicely, a problem which can be distilled as below: ; a simple m

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

2012-06-13 Thread Phil Hagelberg
On Wed, Jun 13, 2012 at 1:58 PM, fenton wrote: > Or likely you mean here: > > http://dev.clojure.org/display/doc/Getting+Started+with+Emacs > > I'm not sure I can edit this page???  Seems to only leave comments there. I think that's the best place for an overview. Unfortunately edits are restrict

Re: Exclude some dependencies with lein uberjar

2012-06-13 Thread Phil Hagelberg
On Wed, Jun 13, 2012 at 1:52 PM, Jacek Laskowski wrote: >> If you try to create an uberjar with AOT using a profile that excludes >> the dependencies you don't want in your uberjar then the AOT will fail >> because it tries to references classes that don't exist. > > Why does AOT happen after excl

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

2012-06-13 Thread Jim - FooBar();
Right, so I followed every ones' suggestions and went fully immutable! points are now regular vectors and updating position returns a brand new piece (as does killing a piece, it changes its meta-data). On the upside I did not have to change much and now at least it reads nicer...however, on

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

2012-06-13 Thread fenton
Or likely you mean here: http://dev.clojure.org/display/doc/Getting+Started+with+Emacs I'm not sure I can edit this page??? Seems to only leave comments there. On Wednesday, June 13, 2012 12:33:38 PM UTC-7, fenton wrote: > > > https://github.com/ftravers/PublicDocumentation/blob/master/clojure-

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

2012-06-13 Thread fenton
Sure would love to. Could you point me to the right location? Here: http://clojuredocs.org/ ? or here: http://en.wikibooks.org/wiki/Clojure_Programming ? or somewhere else? On Wednesday, June 13, 2012 1:13:20 PM UTC-7, Phil Hagelberg wrote: > > On Wed, Jun 13, 2012 at 12:33 PM, fenton w

Re: Exclude some dependencies with lein uberjar

2012-06-13 Thread Jacek Laskowski
On Wed, Jun 13, 2012 at 10:47 PM, Phil Hagelberg wrote: > If you try to create an uberjar with AOT using a profile that excludes > the dependencies you don't want in your uberjar then the AOT will fail > because it tries to references classes that don't exist. Why does AOT happen after exclusion

RE: Clojure (Slim 1.4.0) and Azul don't like each other

2012-06-13 Thread Edward Yang
Here is the full stack trace: Caused by: clojure.lang.Compiler$CompilerException: java.lang.NoSuchFieldException: close, compiling:(clojure/core.clj:6139) at clojure.lang.Compiler.analyzeSeq(Compiler.java:6462) at clojure.lang.Compiler.analyze(Compiler.java:6262) at clojure.lang.Compiler.analyze(

Re: Exclude some dependencies with lein uberjar

2012-06-13 Thread Phil Hagelberg
On Wed, Jun 13, 2012 at 1:42 PM, Jacek Laskowski wrote: > That's the part I didn't understand. Could you elaborate what wouldn't work? If you try to create an uberjar with AOT using a profile that excludes the dependencies you don't want in your uberjar then the AOT will fail because it tries to

Re: Exclude some dependencies with lein uberjar

2012-06-13 Thread Jacek Laskowski
On Wed, Jun 13, 2012 at 12:55 AM, Phil Hagelberg wrote: > If you don't need AOT then you can include the common lib in > dependencies in the :dev profile. Hi Phil, Thanks for the idea - I blogged about the solution and it worked great! http://blog.japila.pl/2012/06/exclude-dependencies-from-ub

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

2012-06-13 Thread Phil Hagelberg
On Wed, Jun 13, 2012 at 12:33 PM, fenton wrote: > https://github.com/ftravers/PublicDocumentation/blob/master/clojure-development-setup.md Have you considered evaluating the official documentation and improving it so that effort goes to a place in which it can be updated by others in the future?

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

2012-06-13 Thread Andy Coolware
> > (defn lis [coll] >   (or (->> coll >            (partition-between (partial apply >=)) >            (sort-by (comp - count)) >            (filter next) >            (first)) >       [])) Totally agree on decomposing the problem into a single independent steps. This is what I did not like about

How to write XML?

2012-06-13 Thread fenton
For some reason I cannot create an XML node. Sample code here. Any assistance much appreciated. -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.

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

2012-06-13 Thread fenton
https://github.com/ftravers/PublicDocumentation/blob/master/clojure-development-setup.md An index to other clojure tutorials: https://github.com/ftravers/PublicDocumentation/blob/master/clojure-index.md -- You received this message because you are subscribed to the Google Groups "Clojure" group

How can I return the exact value or values

2012-06-13 Thread Joao_Salcedo
Hi All, I am running the following (defn json-response [data & [status]] {:status (or status 200) :headers {"Content-Type" "application/json"} :body (json/generate-string data)}) (GET "/events/s3" [] (let [response (s3files/fetch-data-aws)] (println response) (json-response response

RE: Clojure (Slim 1.4.0) and Azul don't like each other

2012-06-13 Thread Edward Yang
Unfortunately, the full stacktrace is getting swallowed up by all of the other moving parts, so it's not easily accessible. Here is the Azul Java version: -bash-4.1$ java -version java version "1.6.0_29" Java(TM) SE Runtime Environment (build 1.6.0_29-13) Java HotSpot(TM) 64-Bit Tiered VM (build

Re: Clojure (Slim 1.4.0) and Azul don't like each other

2012-06-13 Thread Mark
I'm speaking from ignorance but this kind of error smacks of a version mismatch between the Java runtime library and what Clojure is expecting. What version of Java runtime are you using? Also, is the Azul Java library the same as Sun's? What's the entire stacktrace? On Wednesday, June 13, 2

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

2012-06-13 Thread Alan Malloy
useful has a partition functionpowerful enough to make the "find increasing subsequences" part pretty easy: (defn lis [coll] (or (->> coll (partition-between (partial apply

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

2012-06-13 Thread Jim - FooBar();
Ok after a cup of tea I'm starting to realize i can easily do something like: (let [moved (update-position p coords)] ;no mutation - returns a new piece (filter (complement dead?) (-> board (dissoc (getListPosition p)) ;get rid of the old piece (assoc (getListP

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

2012-06-13 Thread Laurent PETIT
2012/6/12 Andy Coolware > Hi, > > First a quick disclaimer. Those are my first steps in Clojure so I am > not be super accustomed to the language entire landscape and might > miss some basics here. However I was able to solve my first 4clojure > hard problem https://www.4clojure.com/problem/53 and

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

2012-06-13 Thread JuanManuel Gimeno Illa
On Wednesday, June 13, 2012 5:47:55 PM UTC+2, Andy C wrote: > > On Wed, Jun 13, 2012 at 4:05 AM, JuanManuel Gimeno Illa wrote: > > My solution: > > > > (defn lis [s] > > (->> s > >(partition 2 1) > >(partition-by (partial apply <=)) > >(filter (fn [[[a b]]] (< a b)

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

2012-06-13 Thread Jim - FooBar();
On 13/06/12 17:22, nicolas.o...@gmail.com wrote: For example, if your state were a vector [:x :o :x nil :x] (for a board of tic-tac-toe), calling (assoc board 3 :x) will return a new board with the position 3 set to :x. Yes but in tic-tac-toe you are inserting pieces while in chess/checker

Re: Doseq, map-style

2012-06-13 Thread Sean Corfield
On Wed, Jun 13, 2012 at 1:52 AM, Vinzent wrote: > Why do you care about computational expensiveness of pre and post > conditions? They'll be turned off in production anyway. I think that's a philosophical question :) > In clojure, structure of your map is a part of the contract. It's not an > im

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

2012-06-13 Thread nicolas.o...@gmail.com
> you mean making 32 new pieces after each move regardless of whether they > moved or not? how can I identify the ones that are different from the ones > that remain unchanged so i can conj them in a new list? move will eventually > call 'build-board' which has to look somewhere for the current pie

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

2012-06-13 Thread Andy Coolware
On Wed, Jun 13, 2012 at 4:05 AM, JuanManuel Gimeno Illa wrote: > My solution: > > (defn lis [s] >   (->> s >        (partition 2 1) >        (partition-by (partial apply <=)) >        (filter (fn [[[a b]]] (< a b))) >        (reduce (fn [m s] (if (> (count s) (count m)) s m)) []) >        (#(cons

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

2012-06-13 Thread David Nolen
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, Dave Sann wrote: > So far I can only confirm the following. > > It does not occur if I revert to > commit 7b6678bead5a0733d0388ddaa4e78e714b9d6187 but d

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

2012-06-13 Thread Tassilo Horn
"Jim - FooBar();" writes: >> If the things you store in atoms or refs aren't immutable, then the >> guarantees made by those reference types simply don't apply. > > hmmm...I see what you mean. I'll try to rethink my design... In fact, > I was wondering in the beggining of this project whether I n

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

2012-06-13 Thread Dave Sann
So far I can only confirm the following. It does not occur if I revert to commit 7b6678bead5a0733d0388ddaa4e78e714b9d6187 but does from e959e0205a4b42a099c120a77427314d288c965b (Merge branch 'cljs-305-proto-inline') onward. I have been unable to get a stacktrace with the exception - So at the

Re: Exclude some dependencies with lein uberjar

2012-06-13 Thread Jacek Laskowski
On Wed, Jun 13, 2012 at 1:38 AM, Warren Lynn wrote: > If you don't need AOT then you can include the common lib in Could :uberjar-exclusions help in any way? It's a vector of regexps to exclude files from the uberjar. It could be a starting point to try out. Jacek -- Jacek Laskowski Functional

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

2012-06-13 Thread JuanManuel Gimeno Illa
My solution: (defn lis [s] (->> s (partition 2 1) (partition-by (partial apply <=)) (filter (fn [[[a b]]] (< a b))) (reduce (fn [m s] (if (> (count s) (count m)) s m)) []) (#(cons (ffirst %) (map second %) The strategy is (given the vector [3 2 1 2 4 2] -

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

2012-06-13 Thread Jim - FooBar();
On 13/06/12 11:21, Tassilo Horn wrote: I don't get this. If you have your current-board as an atom containing a collection of pieces, and every piece's location can be mutated by (updatePosition piece ...), then doing that does change the world, i.e., the location of piece changed without having

Re: Central screwup

2012-06-13 Thread John Szakmeister
On Wed, Jun 13, 2012 at 5:47 AM, Chas Emerick wrote: > On Jun 12, 2012, at 7:12 PM, Phil Hagelberg wrote: > >> On Mon, Jun 11, 2012 at 1:48 PM, Phil Hagelberg wrote: >>> On Mon, Jun 11, 2012 at 9:36 AM, Phil Hagelberg wrote: These will be removed once Central gets back to working order, but

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

2012-06-13 Thread nicolas.o...@gmail.com
> different positions now or some are nil (dead))... if i make the pieces pure > what comes to mind is resetting or swapping possibly 32 atoms instead.. No, you will have an atom containing a new board with new pieces in their new position. (By the way, you can go a long way writing what you want

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

2012-06-13 Thread Tassilo Horn
"Jim - FooBar();" writes: Hi Jim, > In other words, moves are also records that satisfy the Command > protocol which says there should exist an "execute" and an "undo" > method in all implementors...that way, each move knows how to execute > itself but also how to undo itself and return to the s

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

2012-06-13 Thread Jim - FooBar();
On 13/06/12 10:58, nicolas.o...@gmail.com wrote: And from what I understand of your design, I disagree on a point: I think it is not true a move is a command apply to a piece. A lot of moves involve multiple pieces. So I would try to represent a move as something like: (defprotocol Move

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

2012-06-13 Thread nicolas.o...@gmail.com
On Wed, Jun 13, 2012 at 10:46 AM, nicolas.o...@gmail.com wrote: > that mutation inside piece is >> the only non-functional  detail...everything else I am indeed returning new >> boards, new pieces (promotion, death etc)... >> > And from what I understand of your design, I disagree on a point: I th

Re: Central screwup

2012-06-13 Thread Chas Emerick
On Jun 12, 2012, at 7:12 PM, Phil Hagelberg wrote: > On Mon, Jun 11, 2012 at 1:48 PM, Phil Hagelberg wrote: >> On Mon, Jun 11, 2012 at 9:36 AM, Phil Hagelberg wrote: >>> These will be removed once Central gets back to working order, but >>> they should help stem the flow of catastrophic build fa

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

2012-06-13 Thread nicolas.o...@gmail.com
that mutation inside piece is > the only non-functional  detail...everything else I am indeed returning new > boards, new pieces (promotion, death etc)... > If I were you, I would look into a way to make Pieces pure too. Because their mutability cascades into the whole state and makes the descript

Re: How about 'nth' accepts maps?

2012-06-13 Thread Yoshinori Kohyama
Hi forum, I found that (empty? my-brain) -> true. 'seq' suffices. user=> (def sm (sorted-map 0 {:name "Alice"} 1 {:name "Bob"} 2 {:name "Charlie"})) #'user/sm user=> (loop [[k v :as x] & xs] (seq sm) acc []] (if x (recur xs (conj acc (assoc v :id k)))

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

2012-06-13 Thread Jim - FooBar();
First of all, thanks all of you for your helpful and often enlightening comments On 13/06/12 08:13, Tassilo Horn wrote: But probably that's not a good approach. When mutating the positions in a move, there's no way back. If everything was immutable, i.e., updatePosition would return a ne

Re: Doseq, map-style

2012-06-13 Thread Vinzent
> > I do use pre-conditions where the test condition is simple, ie is this a > string? does the map have a :field-type? however I get a lot of my input > data from http requests as json which have similar structures but different > semantics, so I often do not have preconditions where type is n

defcurried kv reduce

2012-06-13 Thread Tom Jack
Why do the clojure.core.reducers defcurried operators define the kv cases? Is there a way to use these? Since reducers and folders only implement {Coll,I}Reduce, I don't see why they are there. Are there changes coming that make this make sense? -- You received this message because you are sub

Re: How to read an InputStream

2012-06-13 Thread Baishampayan Ghose
> I am trying to read a InputStream that is coming from S3 > I am using clj-aws-s3 library > > When I get the object I get a # com.amazonaws.services.s3.model.S3ObjectInputStream@40d88d2d> > How can I get the content inside this InputStream, any ideas, unfortunately > I do not know how? Take a loo

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

2012-06-13 Thread Tassilo Horn
"Jim - FooBar();" writes: >> What's update-position? Shouldn't that be (updatePosition p coords), >> as you say IPieces have an updatePosition method? And since you use >> that for side effects (you don't use the return value), are your >> IPiece implementors actually deftypes with :volatile-mu

How to read an InputStream

2012-06-13 Thread Joao_Salcedo
HI all, I am trying to read a InputStream that is coming from S3 I am using clj-aws-s3 library When I get the object I get a # How can I get the content inside this InputStream, any ideas, unfortunately I do not know how? Any example code would be great. Cheers JS -- You received this messag