Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

using juxt to run multiple functions.

 
jay vas
Ranch Hand
Posts: 407
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys :

I have a clojure script, the purpose is to do a whole bunch of "stats" on a JSON, just for experimenting with the
flexibility of text analysis stats in Clojure.



I also tried adding "apply" before juxt and that failed.


 
Sean Corfield
Ranch Hand
Posts: 302
10
Clojure Linux Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your opening paren is in the wrong place - remember paren comes before the function, not after it:

You need partial here or an explicit function since you're taking away the last argument (data). It might be cleaner to define each function upfront:

Also note that your parenthesis style is not idiomatic - you're laying out your parens like braces in Java (which is why I think you end up putting them in the wrong place). Try to get used to the more idiomatic layout I'm using where you use small indentation and stack trailing parens on the same line.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic