File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Building Functions

 
mss sanders
Greenhorn
Posts: 2
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi folks!

Question... (very much a Clojure newbie) but, how do I wrap the following in a stand alone function?



My problem (I'm thinking) is that when I attempt to wrap the above in its own function, Clojure seems to insist that I ought to pass arguments to the function. In fact, I want to pass zero arity (no args).
 
mss sanders
Greenhorn
Posts: 2
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I believe I've got it up & running now... The 'trick' was to wrap the empty vector list in their own parenthesis ([]), as shown below:



So for the false alarm there...
 
Hussein Baghdadi
clojure forum advocate
Bartender
Posts: 3479
Clojure Mac Objective C
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Since you are not defining different arities, you can simply drops the parentheses around [ ]
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic