Hacker Newsnew | past | comments | ask | show | jobs | submit | liebke's commentslogin

I agree, under what conceivable metric could the development of Clojure appear to be stalled?


Mark, you are correct, it does install packages globally. It's designed to complement the project-oriented approach of Leiningen and Maven, not replace it.


Wow, that's ridiculously well timed; my wife and I need to make a decision tomorrow about moving across the country to Portland!


I've enjoyed blogging about statistical programming (http://incanter-blog.org), it's been a great way to dig into subjects that interest me.


These slides are from a talk Mark Volkmann gave at the Strange Loop Conference, he has a more detailed article on Clojure's implementation of STM here: http://java.ociweb.com/mark/stm/article.html


The plots and chi-square tests are a single function each, it's the data preparation that takes up so much space. Alas, most statistical analyses involve a lot of preparatory steps, which are rarely shown in the final write-up.


Since I recently did something similar in R:

   d <- read.csv(file='~/stuff/earlh/Iran_2009.csv', header=T, sep=',')

   lastDigit <- function(v){
   	v - 10*floor(v/10)
   }
   
   digits <- lastDigit( c(d$Ahmadinejad, d$Karroubi, d$Mousavi, d$Rezaee))
   hist(digits, breaks=10)
   
   #chi2 gof
   tab <- table(digits)
   n <- length(digits)
   
   model <- chisq.test(x=tab, p=rep(0.1, 10))
   model
   
   # hand generated -- check our work above
   ts <- 0
   for(i in 1:length(tab)){
   	ts <- ts + ( tab[[i]] - 0.1*n)^2 / (0.1*n)
   }
   qchisq(p=1-0.076, df=9)

and to be more specific:

  (def regions (sel votes :cols "Region"))
  (def ahmadinejad-votes (sel votes :cols "Ahmadinejad"))
  (def mousavi-votes (sel votes :cols "Mousavi"))
  (def rezai-votes (sel votes :cols "Rezai"))
  (def karrubi-votes (sel votes :cols "Karrubi"))
  # -or-
  attach(d)

  (def ahmadinejad (map first-digit ahmadinejad-votes))
  (def mousavi (map first-digit mousavi-votes))
  (def rezai (map first-digit rezai-votes))
  (def karrubi (map first-digit karrubi-votes))
  # -or-
   digits <- lastDigit( c(d$Ahmadinejad, d$Karroubi, d$Mousavi, d$Rezaee))  # not even attached -- could drop d$
etc. While it's obviously a matter of taste, it looks horridly verbose.


It could be done more concisely by using data structures and the (map fn struct) function, but it was expanded for clarty.


Don't mistake explicitness for verbosity. Soon we'll see someone posting a Perl oneliner to do the same, claiming R is also verbose. Conciseness is not a goal, clarity is. if you have to expand the operations in your mind, you may well spend more time thinking about your code then when it's written fully, perhaps factored into a properly named function.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: