Re: NullPointerException on ManagementFactory/getThreadMXBean ???

2016-01-25 Thread piastkrakow
This error is also intermittent. It doesn't happen every time I start the app. I would guess this is some kind of timing issue, but I can't think where the issue of timing comes up. On Monday, January 25, 2016 at 4:04:50 PM UTC-5, piast...@gmail.com wrote: > > I've never had this problem befo

Re: NullPointerException when creating protocol in macro

2013-06-07 Thread Vincent
Thanks everyone for your answers. I must say I'm quite mystified as to why Stuart's version works. I ended up defining a function that has the same signature as the protocol, and whose first argument wraps a function that contains the appropriate code. Vincent On Wednesday, 5 June 2013 23:57:

Re: NullPointerException when creating protocol in macro

2013-06-05 Thread Softaddicts
Legal but comparable to a hidden side effect with all the pitfalls that can derive from this. It's not a compiler issue, more a discipline issue. Having a helper macro like Stuart suggest is acceptable to me if it's called at top level, it's always done. There's less ambiguity. Using def/defn i

Re: NullPointerException when creating protocol in macro

2013-06-05 Thread Stuart Sierra
On Wed, Jun 5, 2013 at 7:35 PM, Colin Fleming wrote: > Given this, are there any forms that are genuinely top-level from the > compiler's point of view? It's never explicitly enforced, just a consequence of how the compiler creates and loads Java classes. Generally, the things which compile dir

Re: NullPointerException when creating protocol in macro

2013-06-05 Thread Colin Fleming
*`defprotocol` is a top-level form...* This is interesting, and it's something I've wondered about. As far as I can tell, there's really no distinction between top-level forms and other forms, for example this is legal and works: (defn define-my-functions [] (defn test-1 [] 1) (defn test-

Re: NullPointerException when creating protocol in macro

2013-06-05 Thread Stuart Sierra
Hi Vincent, `defprotocol` is a top-level form, not really meant to be mixed with value-returning expressions like `fn`. Protocols are always global because of how they compile into Java interfaces. Here's one way to make it work, by defining a symbol instead of returning a function: (defmacro

Re: NullPointerException

2012-05-17 Thread Evan Mezeske
On Thursday, May 17, 2012 1:25:45 PM UTC-7, Armando Blancas wrote: > > -- it's also just plain wrong. Those are not local functions: def always >> operates at top-level. >> >> > Big deal. You see what I mean? Pedantry is contagious. > Well, I guess if "trying not to give newcomers blatantly fals

Re: NullPointerException

2012-05-17 Thread Raoul Duke
On Thu, May 17, 2012 at 1:25 PM, Armando Blancas wrote: >> -- it's also just plain wrong.  Those are not local functions: def always >> operates at top-level. > Big deal. You see what I mean? Pedantry is contagious. er, i should think it *is* a big deal: programming languages really don't give on

Re: NullPointerException

2012-05-17 Thread Armando Blancas
> > -- it's also just plain wrong. Those are not local functions: def always > operates at top-level. > > Big deal. You see what I mean? Pedantry is contagious. -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to cl

Re: NullPointerException

2012-05-17 Thread Evan Mezeske
On Thursday, May 17, 2012 12:52:27 PM UTC-7, Armando Blancas wrote: > > "There's nothing wrong" is a pretty strong statement. > > > LOL. Perhaps as strong as "it is definitely the wrong way to do things"? > Jeez. > > Pedantry is the wrong way to welcome newbies to this board. > Far from being ped

Re: NullPointerException

2012-05-17 Thread Raoul Duke
On Thu, May 17, 2012 at 12:52 PM, Armando Blancas wrote: > Pedantry is the wrong way to welcome newbies to this board. stop with your pedantry about there must be no pedantry? -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, se

Re: NullPointerException

2012-05-17 Thread Armando Blancas
> > "There's nothing wrong" is a pretty strong statement. LOL. Perhaps as strong as "it is definitely the wrong way to do things"? Jeez. Pedantry is the wrong way to welcome newbies to this board. -- You received this message because you are subscribed to the Google Groups "Clojure" group.

Re: NullPointerException

2012-05-17 Thread Moritz Ulrich
It's called Emacs + Paredit :-) On Thu, May 17, 2012 at 8:00 PM, Raoul Duke wrote: > some day we'll have the technology to let the compiler tell us that, > instead of spewing some horrible, pointless, stack trace? -- Moritz Ulrich -- You received this message because you are subscribed to t

Re: NullPointerException

2012-05-17 Thread Alan Malloy
"There's nothing wrong" is a pretty strong statement. It works, but it is definitely the wrong way to do things. Using a letfn, or external helper functions, is a much better approach. On May 17, 12:19 pm, Armando Blancas wrote: > The redefinition of functions somehow is spooking the compiler. Bu

Re: NullPointerException

2012-05-17 Thread Armando Blancas
The redefinition of functions somehow is spooking the compiler. But if you're at the REPL you should be seeing these warnings (are you doing AOT compile?) WARNING: double already refers to: #'clojure.core/double in namespace: user, being replaced by: #'user/double WARNING: * already refers to: #

Re: NullPointerException

2012-05-17 Thread eniotna
2012/5/17 Raoul Duke > On Thu, May 17, 2012 at 10:55 AM, eniotna wrote: > > Look at your parenthesis. > > You did not close your first function. > > some day we'll have the technology to let the compiler tell us that, > emacs told me. But i'm sure some other editors can tell you that too. inst

Re: NullPointerException

2012-05-17 Thread eniotna
Furthermore, The syntax you're using is not correct. If you want to define functions inside your function ex1_17, use letfn. Something along the line: (defn ex1_17 [] (letfn [(double [x] (+ x x)) (halve [x] (/ x 2)) (mult [a b] (cond (= b 0) 0

Re: NullPointerException

2012-05-17 Thread Raoul Duke
On Thu, May 17, 2012 at 10:55 AM, eniotna wrote: > Look at your parenthesis. > You did not close your first function. some day we'll have the technology to let the compiler tell us that, instead of spewing some horrible, pointless, stack trace? -- You received this message because you are subsc

Re: NullPointerException

2012-05-17 Thread eniotna
Hi, Look at your parenthesis. You did not close your first function. Antoine 2012/5/17 Sargash > Hi! > > I have a problem. With that code: > > ; === > ; ex 1.17 multiply > (defn ex1_17 [] > (defn double [x] (+ x x)) > (defn halve [x] (/ x 2)) > > (defn *

Re: NullPointerException in c.l.Compiler.lookupVar after aot compilation: means what?

2011-11-09 Thread Brian Marick
On Nov 9, 2011, at 4:58 PM, Stuart Halloway wrote: >>> Line 4 of midje.util.report is unusual in several ways: it precedes the ns >>> call, adds a second ns call, does an eval, and uses def forms not at the >>> top level: >> >> Thanks, Stu. That code was a patch that came in when I was new to

Re: NullPointerException in c.l.Compiler.lookupVar after aot compilation: means what?

2011-11-09 Thread Stuart Halloway
>> Line 4 of midje.util.report is unusual in several ways: it precedes the ns >> call, adds a second ns call, does an eval, and uses def forms not at the top >> level: > > Thanks, Stu. That code was a patch that came in when I was new to Clojure, > and I didn't understand it. I think it was a

Re: NullPointerException in c.l.Compiler.lookupVar after aot compilation: means what?

2011-11-09 Thread Brian Marick
On Nov 8, 2011, at 8:47 PM, Alan Malloy wrote: >> (let [ns-obj (the-ns (doto 'clojure.test require)) >> the-var (intern ns-obj 'old-report)] >> (when-not (.hasRoot the-var) >> (intern ns-obj 'old-report clojure.test/report))) >> >> Seems to have the same effect as the defonce in some

Re: NullPointerException in c.l.Compiler.lookupVar after aot compilation: means what?

2011-11-09 Thread Brian Marick
On Nov 8, 2011, at 6:44 PM, Stuart Halloway wrote: > Line 4 of midje.util.report is unusual in several ways: it precedes the ns > call, adds a second ns call, does an eval, and uses def forms not at the top > level: Thanks, Stu. That code was a patch that came in when I was new to Clojure, an

Re: NullPointerException in c.l.Compiler.lookupVar after aot compilation: means what?

2011-11-08 Thread Alan Malloy
On Nov 8, 6:46 pm, Alan Malloy wrote: > On Nov 8, 4:44 pm, Stuart Halloway wrote: > > > This is under clojure 1.2.0, 1.2.1, 1.3.0, though the error messages > > > differ. > > > > Consider a trivial project that `uses` midje: > > > >    (ns midje-aot.core > > >      (:use midje.sweet)) > > > > If

Re: NullPointerException in c.l.Compiler.lookupVar after aot compilation: means what?

2011-11-08 Thread Alan Malloy
On Nov 8, 4:44 pm, Stuart Halloway wrote: > > This is under clojure 1.2.0, 1.2.1, 1.3.0, though the error messages differ. > > > Consider a trivial project that `uses` midje: > > >    (ns midje-aot.core > >      (:use midje.sweet)) > > > If it's aot-compiled, everything appears to go well: > > >  

Re: NullPointerException in c.l.Compiler.lookupVar after aot compilation: means what?

2011-11-08 Thread Stuart Halloway
> This is under clojure 1.2.0, 1.2.1, 1.3.0, though the error messages differ. > > Consider a trivial project that `uses` midje: > >(ns midje-aot.core > (:use midje.sweet)) > > If it's aot-compiled, everything appears to go well: > >1762 $ lein compile >Copying 6 files to /User

Re: NullPointerException on disj

2010-05-27 Thread Allen Johnson
Opened ticket #360 for this. https://www.assembla.com/spaces/clojure/support/tickets/360-nullpointerexception-on-disj Thanks. -- 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 pos

Re: NullPointerException on disj

2010-05-27 Thread Rich Hickey
On May 27, 1:10 am, Allen Johnson wrote: > Hey everyone. I was playing around with the protocols/deftype stuff > and ran into a weird NullPointerException when calling the satisfies? > function. Seems to only happen with a java.lang.Object instance. > > Clojure 1.2.0-master-SNAPSHOT > user=> (de

Re: NullPointerException from #'> et al.

2010-01-14 Thread Timothy Pratley
2010/1/15 C. Florian Ebeling : > I agree. It only looks inconsistent when you assume nil is treated > uniformly by these comparison function, which does not make sense. I quite often wish to compare comparable objects that are not numbers and wrote some simple operators to do that: user=> ( ( ( (

Re: NullPointerException from #'> et al.

2010-01-14 Thread ataggart
Also, it is consistent given that == is the numerical analogue to <=, etc. -- 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: NullPointerException from #'> et al.

2010-01-14 Thread ataggart
On Jan 14, 9:00 am, "C. Florian Ebeling" wrote: > > What do you think should be the boolean result of (> nil 1)? > > > Since the inequality functions only work with Numbers, and nil is not > > a Number.  The only way to make that work would be to impute some > > default numerical value to nil, w

Re: NullPointerException from #'> et al.

2010-01-14 Thread C. Florian Ebeling
> What do you think should be the boolean result of (> nil 1)? > > Since the inequality functions only work with Numbers, and nil is not > a Number.  The only way to make that work would be to impute some > default numerical value to nil, which would probably introduce more > problems than it solve

Re: NullPointerException from #'> et al.

2010-01-14 Thread ataggart
What do you think should be the boolean result of (> nil 1)? Since the inequality functions only work with Numbers, and nil is not a Number. The only way to make that work would be to impute some default numerical value to nil, which would probably introduce more problems than it solved. On Jan

Re: NullPointerException with defmacro and none without?!

2009-09-01 Thread Sir Diddymus
Ah, thanks to both of you for the fast reply - as always, the problem's to be found between chair and keyboard. ;) Greetings from Germany, Sir Diddymus P.S.: Btw, great props to Meikel for vimclojure - now I can use the world's best editor with nice Clojure integration. 8) --~--~-~--

Re: NullPointerException with defmacro and none without?!

2009-09-01 Thread Meikel Brandmeyer
Hi, Am 01.09.2009 um 17:44 schrieb Sir Diddymus: (defmacro RunQt [args & body] `( (try (QApplication/initialize (into-array [~args])) (catch RuntimeException e# (println e#))) ~...@body (QApplication/exec))) You have to wrap the try and QApplication/exec call into a `do`:

Re: NullPointerException with defmacro and none without?!

2009-09-01 Thread Christophe Grand
Hello! On Tue, Sep 1, 2009 at 5:44 PM, Sir Diddymus wrote: > Hi all, > >> (defmacro RunQt [args & body] >>   `( >>     (try >>       (QApplication/initialize (into-array [~args])) >>       (catch RuntimeException e# (println e#))) >>     ~...@body >>     (QApplication/exec))) (defmacro RunQt [ar

Re: NullPointerException in Compiler.java

2009-07-03 Thread Rich Hickey
On Jul 3, 5:27 am, jon wrote: > Hi, could Rich or someone knowledgeable look into this (reflection > related?) NullPointerException in Compiler.java. > I think it's either a bug or at least should provide a better error > message, but I don't have any time to look deeper into it.. > Thanks, Jon