Re: The Website / Wikispaces

2011-10-14 Thread Sean Corfield
On Thu, Oct 13, 2011 at 1:28 PM, Stuart Sierra wrote: > You can see the redirect with: > > wget http://clojure.org/ Ah, session.wikispaces.com .. thanx. -- Sean A Corfield -- (904) 302-SEAN An Architect's View -- http://corfield.org/ World Singles, LLC. -- http://worldsingles.com/ Railo Tec

Re: "Pipe" function

2011-10-14 Thread Sean Corfield
On Fri, Oct 14, 2011 at 5:50 PM, Alan Malloy wrote: > I really liked this one too, though my first draft of it was more like > (defn pipe [test f] >  (fn [value] >    (...))) ... > fix is basically your pipe, except it takes a series of test/f pairs, > and to-fix is my original version, returning

Re: ClojureScript: API documentation

2011-10-14 Thread Devin Walters
+100. Doc, source, ns-publics etc. will drive adoption. Sent via mobile On Oct 14, 2011, at 7:07 PM, David Nolen wrote: > Frank, > > Apologies, ClojureScript at the moment is designed with a bit of a bias > towards people to who already know Clojure. This is unfortunate since there > are man

Re: [ClojureScript]: Breaking change coming WRT object property access syntax

2011-10-14 Thread Devin Walters
Responding to an earlier point in this thread: Now is the time for breaking changes. ClojureScript is alpha. Use in production by enterprising folk should not be discouraged, but at the sa(m|n)e time, I don't believe there have been any mixed messages regarding whether or not cljs is production-

Re: [ClojureScript]: Breaking change coming WRT object property access syntax

2011-10-14 Thread Mark Rathwell
> Now compare to the proposed change: > (set! (. foo :id) "my-css-id")) > (set! (. ctxt :fillStyle) "rgb(255, 150, 0)") In the original discussion in this list, a couple alternatives similar to the following were suggested for property access to remain closer to the Clojure situation: (set! (.:id

Re: [ClojureScript]: Breaking change coming WRT object property access syntax

2011-10-14 Thread David Nolen
Sorry I didn't copy my perspective over here from clojure-dev as someone who's been working as a JavaScript dev for the past 6 years - The proposed change is not optimal and I think it clashes with the realities of JavaScript interop. (.property foo) Currently gives us a notion of "place",

Re: [ClojureScript]: Breaking change coming WRT object property access syntax

2011-10-14 Thread Jack Moffitt
> Thoughts? I like it. +1 to it going in sooner rather than later. jack. -- 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

Re: : Breaking change coming WRT object property access syntax

2011-10-14 Thread Kevin Lynagh
I agree with you on making breaking changes sooner rather than later. This one seems fine to me; I execute no-arg functions on JavaScript objects more than I directly refer to them, so it'll be nice to not have to write (. obj (m)) anymore. On Oct 14, 12:44 pm, Fogus wrote: > The tickethttp://dev

Re: "Pipe" function

2011-10-14 Thread Alan Malloy
I really liked this one too, though my first draft of it was more like (defn pipe [test f] (fn [value] (...))) I've since expanded and generalized it into three related functions you can see at https://github.com/flatland/useful/blob/develop/src/useful/fn.clj#L16 fix is basically your pipe

Re: ClojureScript: API documentation

2011-10-14 Thread David Nolen
Frank, Apologies, ClojureScript at the moment is designed with a bit of a bias towards people to who already know Clojure. This is unfortunate since there are many people who could use ClojureScript *today* who don't need or want to invest in Clojure on the JVM. Because of the bias some obvious t

Sample (simple!) game on rosettacode.org

2011-10-14 Thread pistacchio
Hi, if your're not aware of rosettacode.org, it is a very interesting wiki where people submit algorithms and short programs in different languages so than it is easy to compare how different languages approach the same problem. To start learning Clojure, I've tried to implement RCRPG, that is a v

Re: Sum on a list of maps

2011-10-14 Thread Jestan Nirojan
I would write like this (defn sum-by-type [coll] (->> coll (map (fn [ {v "Value" t "Type" } ] {t (read-string v) })) (apply (partial merge-with + If the map keyword based, it will be simpler than above (defn sum-by-type [coll] (->> coll (map (fn [ {v :value t :ty

Re: Sum on a list of maps

2011-10-14 Thread Jestan Nirojan
I would write like this (defn sum-by-type [coll] (->> coll (map (fn [ {v "Value" t "Type" } ] {t (read-string v) })) (apply (partial merge-with + If the map is keyword int map, it will be simpler than above (defn sum-by-type [coll] (->> coll (map (fn [ {v :value t :type } ] {t v

Re: Sum on a list of maps

2011-10-14 Thread der
Thanks for all of the useful replies, I'll try them later. Unfortunately I don't control the input list of maps which is the result of a web service. On Oct 14, 10:11 pm, Sean Corfield wrote: > On Fri, Oct 14, 2011 at 10:25 AM, der wrote: > > Given a list of maps of the followign format: ({"Typ

ClojureScript: API documentation

2011-10-14 Thread Curious Fox
Hi, Is there any easy way to discover available functions in ClojureScript REPL? I ended up reading source code and documenting it all in an org-mode file, is it the best strategy? How can I improve it? Am I correct that 'doc and 'find-doc are not available during REPL since it's running on Java

Re: ClojureScript: integration with jQuery

2011-10-14 Thread Curious Fox
Oh, I see. Now I totally get it. Thank you for the detailed explanation. On Oct 14, 10:55 am, Stuart Sierra wrote: > > Honestly, I first did a search by jQuery and came across > > "Alright, fess up, who's unhappy with clojurescript?" > > That's really unfortunate. ClojureScript can be used with

"Pipe" function

2011-10-14 Thread Daniel Bell
One higher-order function I've found useful as I've goofed around with clojure has been one that I made up myself, but it's proved so useful and so simple that I have to believe it's in core somewhere: (defn pipe [test value f] (if (test value) (f value) value)) Is this a core f

Re: Sum on a list of maps

2011-10-14 Thread Baishampayan Ghose
On Sat, Oct 15, 2011 at 3:16 AM, Alan Malloy wrote: > Probably CSV or some other externally-input data. And FWIW I like BG's > solution - it's what I would have written, except it's better. Thanks Alan :-) Regards, BG -- Baishampayan Ghose b.ghose at gmail.com -- You received this message be

Re: Oxjure - Oxford Clojure Group

2011-10-14 Thread Folcon
Hey Everyone, It's been a week since I've posted this and I've gotten back some interest :). I'm just going to ask people who are interested to chime in with a day they would like to have it on or if they are not overly concerned a preference for having meetings during the week or the weekend.

Re: Sum on a list of maps

2011-10-14 Thread Alan Malloy
Probably CSV or some other externally-input data. And FWIW I like BG's solution - it's what I would have written, except it's better. On Oct 14, 2:11 pm, Sean Corfield wrote: > On Fri, Oct 14, 2011 at 10:25 AM, der wrote: > > Given a list of maps of the followign format: ({"Type" "A", "Value" >

Re: Sum on a list of maps

2011-10-14 Thread Sean Corfield
On Fri, Oct 14, 2011 at 10:25 AM, der wrote: > Given a list of maps of the followign format: ({"Type" "A", "Value" > "5"} {"Type" "B", "Value" "4"} {"Type" "A", "Value" "7.2"} {"Type" > "A", "Value" "25.4"} {"Type" "B", "Value" "2.982"}) Folks are posting solutions but I wondered why your map key

Re: Sum on a list of maps

2011-10-14 Thread Baishampayan Ghose
> I'm a Clojure newbie trying to the following simple task: > > Given a list of maps of the followign format: ({"Type" "A", "Value" > "5"} {"Type" "B", "Value" "4"} {"Type" "A", "Value" "7.2"} {"Type" > "A", "Value" "25.4"} {"Type" "B", "Value" "2.982"}) > > I want to compute a list of maps such th

Re: Sum on a list of maps

2011-10-14 Thread Walter van der Laan
You could first turn the Values from String into Double like this: (defn step1 [coll] (map (fn [m] (assoc m "Value" (Double/parseDouble (m "Value" coll)) Next, you can use reduce to calculate the sum per Value: (defn step2 [coll] (reduce (fn [res m] (let [k (m "

Re: lein not configured properly

2011-10-14 Thread Bruce Gordon
found this gem http://www.mepis.org/docs/en/index.php?title=Java_How-tos which contained MEPIS 11 To install the proprietary sun-java6 version (the most current version that exists in the stable debian repositories) and remove the default openjdk-6-jre* java packages & icedtea6-plugin packages,

Re: Sum on a list of maps

2011-10-14 Thread Dave Ray
Someone cleverer than me to post the built-in function that already does exactly what you want, but here's one way: (defn sum-by-type [in] (->> in (group-by #(get % "Type")) (map (fn [[k vs]] {"Type" k "Value" (reduce (fn [acc v] (+ acc (Double/

[ClojureScript]: Breaking change coming WRT object property access syntax

2011-10-14 Thread Fogus
The ticket http://dev.clojure.org/jira/browse/CLJS-89 and the design page http://www.google.com/url?sa=D&q=http://dev.clojure.org/display/design/Unified%2BClojureScript%2Band%2BClojure%2Bfield%2Baccess%2Bsyntax describe the details of the change in ClojureScript. I would like to make this change (

Re: lein not configured properly

2011-10-14 Thread Bruce Gordon
Good thinking. Don't have an answer yet but maven failed with --- Downloading: http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-resources-plugin/2.3/maven-resources-plugin-2.3.pom [WARNING] Unable to get resource 'org.apache.maven.plugins:maven- resources-plugin:pom:2.3' from repos

Re: Reactions to google dart?

2011-10-14 Thread Isaac Gouy
On Oct 11, 7:43 am, Timothy Washington wrote: > I believe this is google's official blog to discuss > and track issues around Dart ... H - "Dart Inside The Unofficial Google Dart Blog" "Dart Inside is an online service from Trifork A/S,

Re: lein not configured properly

2011-10-14 Thread Bruce Gordon
To see if that hypothesis is true I can try some java program that tries to access the network. I have some stand alone java program that is built with Maven. I can install maven, and then see if I can build the program. If yes then java can access the web... On Oct 14, 3:22 pm, Phil Hagelberg wr

Re: clojure newbie collection question

2011-10-14 Thread Meikel Brandmeyer
Hi, cached. Sincerely Meikel -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from

Re: Sum on a list of maps

2011-10-14 Thread Islon Scherer
The best i could think was: (defn calc-types [coll] (let [types (map (fn [m] {:type (get m "Type") :value (Double/parseDouble (get m "Value"))}) coll) ; convert keys to keywords and values to doubles it1 (sort-by :type types) ; sort by type a (atom (:type (first it1)))

Re: lein not configured properly

2011-10-14 Thread Phil Hagelberg
On Fri, Oct 14, 2011 at 12:20 PM, Bruce Gordon wrote: > Is this normal? > > bruce@mepis1:~/cloj2$ mvn > bash: mvn: command not found Yes, you don't need to have Maven installed to use Leiningen. It looks like your JVM simply can't access the network. Could be a variety of issues, including DNS r

Re: lein not configured properly

2011-10-14 Thread Bruce Gordon
Is this normal? bruce@mepis1:~/cloj2$ mvn bash: mvn: command not found On Oct 14, 3:17 pm, Bruce Gordon wrote: > lein repl gives an error! > > > bruce@mepis1:~/cloj2$ lein repl > Downloading: org/clojure/clojure/1.2.1/clojure-1.2.1.pom from central > Downloading

Re: lein not configured properly

2011-10-14 Thread Bruce Gordon
lein repl gives an error! bruce@mepis1:~/cloj2$ lein repl Downloading: org/clojure/clojure/1.2.1/clojure-1.2.1.pom from central Downloading: org/clojure/clojure/1.2.1/clojure-1.2.1.pom from clojars Downloading: org/clojure/clojure/1.2.1/clojure-1.2.1.pom from centr

Re: lein not configured properly

2011-10-14 Thread Mark Rathwell
Run 'lein repl', then copy in and run the code below. Post back whether you get an error (and what it is), or if it finishes without a problem (this is downloading a 50MB file, so give it a few minutes). (import 'java.io.File) (import 'java.net.URL) (require '[clojure.java.io :as io]) (def u (

Re: lein not configured properly

2011-10-14 Thread Bruce Gordon
I am in a VirtualBox VM (running SimplyMepis) hosted in Windows Vista. >From within the vm I can download those files from a browser. On Oct 14, 2:17 pm, Mark Rathwell wrote: > Are you behind a firewall or proxy that would be blocking .zip files? > lein search first makes sure it has an updated i

Faster clojure.data.json

2011-10-14 Thread Stuart Sierra
I spent some time this morning on performance enhancements to clojure.data.json, including a fix for DJSON-1. I just pushed release 0.1.2 to Sonatype; it will reach Maven Central in a few hours. I added a `benchmark` function to clojure.data.json-test for easy comparison. On Clojure 1.3.0, I get t

Re: lein not configured properly

2011-10-14 Thread Mark Rathwell
Are you behind a firewall or proxy that would be blocking .zip files? lein search first makes sure it has an updated index from those repositories, and if not tries to download and unzip those index files: http://repo1.maven.org/maven2/.index/nexus-maven-repository-index.zip http://clojars.org/rep

lein not configured properly

2011-10-14 Thread Bruce Gordon
I first followed the directions at http://riddell.us/ClojureSwankLeiningenWithEmacsOnLinux.html , but then abandoned that effort thanks to irc advice. I then started following the http://dev.clojure.org/display/doc/Getting+Started+with+Leiningen directions. However I suspect I am not configured pr

Re: ClojureScript: integration with jQuery

2011-10-14 Thread Stuart Sierra
> Honestly, I first did a search by jQuery and came across > "Alright, fess up, who's unhappy with clojurescript?" That's really unfortunate. ClojureScript can be used with any JavaScript library. What you won't get, in most cases, is the advanced-mode optimizations of Google's Closure compiler

clojure newbie collection question

2011-10-14 Thread Dennis Haupt
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 if i got it right, filter/remove and map (basically all batch transform functions) return lazy sequences. to convert them to real collections again, i do (vec lazyseq) in case i want the result to be stored in a vector. correct? what happens if i tra

Re: Exception in thread "main" java.lang.Exception: Unable to resolve symbol: PK♥♦¶

2011-10-14 Thread Stuart Sierra
"Unable to resolve symbol: ___ in this context" is a Clojure compiler error thrown when the compiler encounters a symbol which has not been defined. A "symbol" with funky non-ASCII characters in it probably results from trying to load a binary file of some sort. "PK" is the magic number for a Z

Re: ClojureScript: integration with jQuery

2011-10-14 Thread Curious Fox
Thanks! It looks super easy and I'm sure it'll do the trick. Honestly, I first did a search by jQuery and came across "Alright, fess up, who's unhappy with clojurescript?" (http://groups.google.com/ group/clojure/browse_thread/thread/5b0a1c161938e6eb/a714e9e512838e90? lnk=gst&q=jquery#a714e9e5128

Sum on a list of maps

2011-10-14 Thread der
Hi, I'm a Clojure newbie trying to the following simple task: Given a list of maps of the followign format: ({"Type" "A", "Value" "5"} {"Type" "B", "Value" "4"} {"Type" "A", "Value" "7.2"} {"Type" "A", "Value" "25.4"} {"Type" "B", "Value" "2.982"}) I want to compute a list of maps such that each

Re: When to use mutable state

2011-10-14 Thread Michael Gardner
On Oct 14, 2011, at 8:48 AM, Timothy Baldridge wrote: > On Fri, Oct 14, 2011 at 7:58 AM, pistacchio wrote: >> I'm implementing a litte "game" thing in Clojure. So far I'm passing >> around a "world status" object among functions. It is very >> "functional" and I can simulate any moment of the gam

Re: SICP sqrt function generates unexpected NullPointerException

2011-10-14 Thread Alan O'Donnell
Armando, I get the same behavior as you with Clojure 1.2.1. But if I lein dep Clojure 1.3.0, I'm back to NullPointerExceptions. -- 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 po

Re: [ANN] dj 0.1.0 released

2011-10-14 Thread Brent Millare
In master, I added clojurescript support. Note: the clojurescript bootstrap scripts require curl, make sure you have that before installing. dj cljs install installs clojurescript to dj/usr/src/ dj cljs repl starts a cljs repl -- You received this message because you are subscribed to the Go

Re: SICP sqrt function generates unexpected NullPointerException

2011-10-14 Thread Armando Blancas
With 1.3/OSX this code worked up to: user=> (sqrt 1) 100.0 and then hanged here: user=> (sqrt 10) ~ $ On Oct 13, 7:04 pm, "Alan O'Donnell" wrote: > Hi everyone, > > I've encountered an unexpected NullPointerException while translating > some early SICP code into Clo

Re: newbie, installation problem

2011-10-14 Thread Mark Rathwell
> I don't know how to install CLOJURE on Windows but i have > installed it on Ubuntu > Should i have to learn Java first? You don't need to know Java, you just need to have it installed already. Have another look at the Clojure getting started wiki page that Phil linked [1]. Linked from that pag

Re: When to use mutable state

2011-10-14 Thread Timothy Baldridge
On Fri, Oct 14, 2011 at 7:58 AM, pistacchio wrote: > I'm implementing a litte "game" thing in Clojure. So far I'm passing > around a "world status" object among functions. It is very > "functional" and I can simulate any moment of the game my simply > feeding the system with a made-up world state.

Re: newbie, installation problem

2011-10-14 Thread Andrew
Sagar, I had trouble on Windows until Mark Rathwell suggested following the instructions at http://sourceforge.net/apps/wordpress/codesounding/tag/emacs -- 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: Clojure videocast mentioning SuperCSV?

2011-10-14 Thread James Petry
Found it! Stuart Halloway's Clojure in the Field -- 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

When to use mutable state

2011-10-14 Thread pistacchio
I'm implementing a litte "game" thing in Clojure. So far I'm passing around a "world status" object among functions. It is very "functional" and I can simulate any moment of the game my simply feeding the system with a made-up world state. Since Clojure has a very sophisticate system for managing

Re: newbie, installation problem

2011-10-14 Thread Sagar Rakshe
I am totally new to clojure! Would anyone please guide me from where actually i start!! I don't know how to install CLOJURE on Windows but i have installed it on Ubuntu Should i have to learn Java first? On 10/14/11, Phil Hagelberg wrote: > On Thu, Oct 13, 2011 at 4:51 PM, Bruce Gordon > wrote:

SICP sqrt function generates unexpected NullPointerException

2011-10-14 Thread Alan O'Donnell
Hi everyone, I've encountered an unexpected NullPointerException while translating some early SICP code into Clojure 1.3.0. In particular, I'm implementing the iterative sqrt procedure from section 1.1.7. Here's my code: (defn square [x] (* x x)) (defn abs [x] (cond (< x 0) (- x) :els

Re: Reactions to google dart?

2011-10-14 Thread Nicolas
For me the real meaning of this is that support for new features in closure library will stop in its actual form in the years to come. Only bugs will be corrected, no more. This is already the case in a sence I think, because before Dart, GWT was viewed as the new official way to make new web appli