Re: Applying Java functions

2011-06-18 Thread Lars Rune Nøstdal
Hi, user (definline sqrt [x] `(Math/sqrt ~x)) #'user/sqrt user (map sqrt (range 1 10)) (1.0 1.4142135623730951 1.7320508075688772 2.0 2.23606797749979 2.449489742783178 2.6457513110645907 2.8284271247461903 3.0) -- http://www.nostdal.org/ -- You received this message because you are

Re: Allow Data Structure to Be Called as Function

2011-06-18 Thread Sam Aaron
Is it possible to use this approach to create a callable record which can take a variable number of arguments? I can't get the following to work: (defrecord Foo [a] clojure.lang.IFn (invoke [this args] (println (str a args (def yo (Foo. sam)) (yo 1 2 3 4) ;=

Why should I use emacs instead of netbeans?

2011-06-18 Thread James Keats
Hello all. I'm currently using Netbeans' clojure IDE and I quite like it. It has a REPL. It highlights syntax and matches parentheses. It supports maven and mercurial/git. It provides completion and doc for both clojure and java. It has allows evaluation of forms from source code to repl. It also

Re: What's the best way to test private functions?

2011-06-18 Thread Stuart Halloway
(defn refer-private [ns] (doseq [[symbol var] (ns-interns ns)] (when (:private (meta var)) (intern *ns* symbol var As he says, this is slightly evil, and I would never recommend it for any purpose except unit testing, but there it is. This works, and the

Re: Allow Data Structure to Be Called as Function

2011-06-18 Thread Ken Wesson
On Sat, Jun 18, 2011 at 4:44 AM, Sam Aaron samaa...@gmail.com wrote: Is it possible to use this approach to create a callable record which can take a variable number of arguments? I can't get the following to work: (defrecord Foo [a]  clojure.lang.IFn  (invoke [this args] (println (str a

Re: Why should I use emacs instead of netbeans?

2011-06-18 Thread Ken Wesson
On Sat, Jun 18, 2011 at 7:07 AM, James Keats james.w.ke...@gmail.com wrote: Hello all. I'm currently using Netbeans' clojure IDE and I quite like it. It has a REPL. It highlights syntax and matches parentheses. It supports maven and mercurial/git. It provides completion and doc for both

Re: What's the best way to test private functions?

2011-06-18 Thread Ken Wesson
On Sat, Jun 18, 2011 at 7:16 AM, Stuart Halloway stuart.hallo...@gmail.com wrote: To access a private var, simply deref through the var: @#'some-ns/some-private-var This is in the coding standards doc (http://dev.clojure.org/display/design/Library+Coding+Standards). The doc is pretty short

Re: Why should I use emacs instead of netbeans?

2011-06-18 Thread Andreas Liljeqvist
Never used Cake, but Lein works great. Emacs is all about customization - something bothers you? Just change it The standard keybindings are extremely bad, change them. I use this one: http://xahlee.org/emacs/ergonomic_emacs_keybinding.html Just ignore the controversy around the guy, the

Re: Why should I use emacs instead of netbeans?

2011-06-18 Thread Tassilo Horn
James Keats james.w.ke...@gmail.com writes: Hi James, I'm currently using Netbeans' clojure IDE and I quite like it. So why are you bothering to use something else? but emacs, i find, is unnecessarily arcane compared to a modern java IDE. It's keyboard shortcuts and combinations are based

Detailed Macro Quoting Question

2011-06-18 Thread Jian Liu
Hi Clojure Gurus :) I've a somewhat contrived use-case for macros that I've been struggling with. Let's say there's an interface called EWrapper that I'm trying to implement with methods tickPrice and tickSize, a concrete class EWrapperMsgGenerator that has methods with those names that return

Re: Why should I use emacs instead of netbeans?

2011-06-18 Thread Michael Klishin
James, For working with Clojure, if you are happy with Netbeans, use it. Especially if you are relatively new to Clojure, switching to Emacs won't do groundbreaking changes to your productivity in the short term. As you become more and more savvy with Lisp, Emacs will have more and more to offer

Help organizing code and namespaces

2011-06-18 Thread Matt Mitchell
Hi, I have 3 namespaces, each with functions that relate to the name of the ns: core -- contains config and *server* var query -- contains fn's related to querying update -- contains update/delete fn's I want to be able to use my core ns in my application, and call all of the public fn's in

Re: Allow Data Structure to Be Called as Function

2011-06-18 Thread David Nolen
On Sat, Jun 18, 2011 at 4:44 AM, Sam Aaron samaa...@gmail.com wrote: Is it possible to use this approach to create a callable record which can take a variable number of arguments? I can't get the following to work: (defrecord Foo [a] clojure.lang.IFn (invoke [this args] (println (str a

Re: Detailed Macro Quoting Question

2011-06-18 Thread David Nolen
On Fri, Jun 17, 2011 at 11:51 PM, Jian Liu liuj...@gmail.com wrote: Hi Clojure Gurus :) I've a somewhat contrived use-case for macros that I've been struggling with. Let's say there's an interface called EWrapper that I'm trying to implement with methods tickPrice and tickSize, a concrete

Re: Why should I use emacs instead of netbeans?

2011-06-18 Thread Stefan Kamphausen
Hi, these modern IDEs really do a tremendous job at organizing projects and providing additional information at programming time. It's just, their text-editor components suck. If you are a Java developer, it's probably better to stay away from Emacs. Should you ever get used to it, you're

Re: Detailed Macro Quoting Question

2011-06-18 Thread Jian Liu
Hi David, Yes, the expansion I essentially want, and which runs properly without the macro: (proxy [EWrapper] [] (tickPrice [ args] (println tickPrice (. EWrapperMsgGenerator tickPrice args))) (tickSize [ args] (println tickSize (. EWrapperMsgGenerator tickSize args))) ... other methods )

Re: Detailed Macro Quoting Question

2011-06-18 Thread Jian Liu
So I realized that the method wasn't being found because args# is a single argument, and I actually need it spliced in. At this point I'm rather stuck. For example: (defmacro make-msg-ewrapper [method-names] `(proxy [EWrapper] [] ~@(map (fn [method-name] (let [args

Re: Why should I use emacs instead of netbeans?

2011-06-18 Thread Vincent
I want to know how to do it with netbeans ide ? any nice step by step instructions will be very helpful , as emacs learning curve and setup is taking much time thanks in advance . vincent -- You received this message because you are subscribed to the Google Groups Clojure group. To post to

Re: Why should I use emacs instead of netbeans?

2011-06-18 Thread Sean Corfield
On Sat, Jun 18, 2011 at 4:07 AM, James Keats james.w.ke...@gmail.com wrote: I'm currently using Netbeans' clojure IDE and I quite like it. I'm currently using Eclipse with CCW and I quite like it. Much depends on what you've been used to. I've worked in an Eclipse environment for several years

Re: Why should I use emacs instead of netbeans?

2011-06-18 Thread Mark Engelberg
My main motivation for using Emacs is that it is rock-solid stable. I look forward, however, to the day when the clojure plug-ins for the other IDEs reach that level of maturity and stability, so I can leave Emacs behind. -- You received this message because you are subscribed to the Google