Re: Request for improved error reporting

2009-03-29 Thread Rayne
The long list of stuff you get is called a Stack Trace. It will save your life someday. --~--~-~--~~~---~--~~ 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 To

Re: oo

2009-03-29 Thread Meikel Brandmeyer
Hi, Am 29.03.2009 um 08:34 schrieb David Nolen: Not totally following you here as: (proxy [clojure.lang.IMeta clojure.lang.IRef][]) immediately throws an error. I can't think of a situation in Clojure where the type function does not return a usable value. Let me know if I'm wrong, but yo

Re: oo

2009-03-29 Thread Meikel Brandmeyer
Hi, Am 27.03.2009 um 09:25 schrieb Mark Engelberg: I may come along and want to extend test-prefer to a type ::d which derives from ::c and ::e, where ::e provides an alternative implementation. ab (a and b are intended to be hidden from end-user) | | -

Re: What's a convenient way of calling super.method()?

2009-03-29 Thread CuppoJava
Thanks a lot for that David, It works perfectly for me. Are there any circumstances where it doesn't work? I haven't run into any yet, but if there are, I'll design my program around it. -Patrick --~--~-~--~~~---~--~~ You received this message because you are sub

Re: oo

2009-03-29 Thread Konrad Hinsen
On 29.03.2009, at 07:25, mikel wrote: >> Enjoying the thread. Out of curiosity for which Clojure values is >> the return >> value of the type function undefined? > > Try this: > > (type (proxy [clojure.lang.IMeta clojure.lang.IRef][])) > > java.lang.UnsupportedOperationException: meta (NO_SOURC

Re: Request for improved error reporting

2009-03-29 Thread Mark Volkmann
On Sun, Mar 29, 2009 at 4:26 AM, Rayne wrote: > > The long list of stuff you get is called a Stack Trace. It will save > your life someday. Definitely having the ability to see the full stack trace is be useful. I wonder though if that should be the default output. Maybe by default only lines fr

bug in clojure.contrib.math/exact-integer-sqrt

2009-03-29 Thread 이휘재
Hi, all. (clojure.contrib.math/exact-integer-sqrt 1) => [65536 995705032704] due to typo in "integer-length". must be: (clojure.contrib.math/exact-integer-sqrt 1) => [100 0] -- aside, does "integer-sqrt" need to be public? --~--~-~--~~~--

Re: What's a convenient way of calling super.method()?

2009-03-29 Thread David Nolen
Glad to be of help. To be totally honest I hadn't really tested it too much, so I don't know ;) One obvious limitation here is that it doesn't work with multiple inheritance (it only looks at the first item in the parents set). As long you're sticking with a Java-style single inheritance model thi

Re: Request for improved error reporting

2009-03-29 Thread André Thieme
On 29 Mrz., 01:55, Glen Stampoultzis wrote: > Hi, I've been really enjoying getting to know clojure.  It's an awesome > language that has got me very interested in learning more. One thing that > hasn't left me impressed is the error reporting. > [...] > There are a few things wrong here and with

Java code example for loading clojure code

2009-03-29 Thread BerlinBrown
Here is an example for loading clojure code. I had trouble with this before. I believe that once the script is loaded, it is loaded per JVM instance. http://clojure.googlegroups.com/web/TestLoadClojureFromJava.java?gsc=PMri4QsAAABqmMyUtnF_kwfBAZY6oRfS Also, any suggestions are welcome. --~--~-

Re: Request for improved error reporting

2009-03-29 Thread Tassilo Horn
Mark Volkmann writes: Hi Mark, >> The long list of stuff you get is called a Stack Trace. It will save >> your life someday. > > Definitely having the ability to see the full stack trace is be > useful. I wonder though if that should be the default output. Maybe by > default only lines from the

System.loadLibrary() does not work

2009-03-29 Thread Timo Mihaljov
I'm trying to use Clojure to call a library via JNI. Here's a working piece of Java code that I'm trying to convert to Clojure: import libfoo.Foo; // A GlueGen-generated wrapper class Test { static { System.loadLibrary("foo"); // The original library

Re: bug in clojure.contrib.math/exact-integer-sqrt

2009-03-29 Thread Mark Engelberg
Fixed. Thanks for the report. Aside from being a helper function for sqrt, exact-integer-sqrt is available in some Lisp and Scheme implementations. At first glance, you might think that calling (floor (sqrt n)) is sufficient, and no special function is needed. But for large integers which are

Re: new in contrib.test-is: fixtures

2009-03-29 Thread John D. Hume
On Sat, Mar 28, 2009 at 10:24 PM, Stuart Sierra wrote: >  (defn my-fixture [f] >    ;; Perform setup, establish bindings, whatever. >    (f) ;; Then call the function we were passed. >    ;; Tear-down / clean-up code here. >    ) This is a cool functional way of defining these, but I think I'd p

Fresh Clojure Tutorial

2009-03-29 Thread Curran Kelleher
Hello, I've created an introductory tutorial for Clojure and Emacs here: http://lifeofaprogrammergeek.blogspot.com/2009/03/learning-clojure-and-emacs.html I just wanted to let the community know, maybe it should be linked to in the wiki? Best, Curran --~--~-~--~~~---

Quick slime/emacs questions

2009-03-29 Thread Mark Engelberg
When I have two windows open, and hit C-x-C-b, it pops up a list of buffers in the OTHER window from where the current focus is. Any idea why it's doing that, and how I can alter the behavior so it pops up the list of buffers in the current window? Also, where can I look up the names of various

Re: oo

2009-03-29 Thread mikel
On Mar 29, 1:34 am, David Nolen wrote: > On Sun, Mar 29, 2009 at 1:25 AM, mikel wrote: > > > (type (proxy [clojure.lang.IMeta clojure.lang.IRef][])) > > > java.lang.UnsupportedOperationException: meta (NO_SOURCE_FILE:0) > >  [Thrown class clojure.lang.Compiler$CompilerException] > > > No doubt

Re: Quick slime/emacs questions

2009-03-29 Thread Stuart Halloway
describe-key (usually C-h k) followed by a key will tell you what a key is currently bound to. On my setup C-x C-b is bound to ido-switch-buffer--it is not immediately obvious how to make it pop the buffer list in the current window. You might find "What You Can Learn From ido.el" (http://

Re: Fresh Clojure Tutorial

2009-03-29 Thread Krešimir Šojat
Is link broken? blogpost return pagen not found message. -- Krešimir Šojat --~--~-~--~~~---~--~~ 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 To unsubscribe

Re: Fresh Clojure Tutorial

2009-03-29 Thread Andrew Wagner
Excellent tutorial. I pretty much zipped right through it, even though I'm on osx and had to figure out the right way to get a git client for myself. Thanks! On Sun, Mar 29, 2009 at 3:34 PM, Curran Kelleher wrote: > > Hello, > > I've created an introductory tutorial for Clojure and Emacs here: >

Re: Fresh Clojure Tutorial

2009-03-29 Thread Andrew Wagner
Oh, I should point out that it looks like your abs examples, under "Learning basic clojure" got mangled. On Sun, Mar 29, 2009 at 3:34 PM, Curran Kelleher wrote: > > Hello, > > I've created an introductory tutorial for Clojure and Emacs here: > > http://lifeofaprogrammergeek.blogspot.com/2009/03/l

Re: oo

2009-03-29 Thread David Nolen
I see, thanks for the clarification. It does seem like you are purposefully creating a situation in which type will fail since something more likely: (type (proxy [clojure.lang.IRef][])) works fine. I'm wondering if a CLOS-like system would really have to handle such a degenerate (in the technica

Re: oo

2009-03-29 Thread mikel
On Mar 29, 7:22 am, Konrad Hinsen wrote: > On 29.03.2009, at 07:25, mikel wrote: > > >> Enjoying the thread. Out of curiosity for which Clojure values is   > >> the return > >> value of the type function undefined? > > > Try this: > > > (type (proxy [clojure.lang.IMeta clojure.lang.IRef][])) >

Re: oo

2009-03-29 Thread mikel
On Mar 29, 4:40 pm, David Nolen wrote: > I see, thanks for the clarification. It does seem like you are purposefully > creating a situation in which type will fail since something more likely: > (type (proxy [clojure.lang.IRef][])) > > works fine. > > I'm wondering if a CLOS-like system would r

Re: bug in clojure.contrib.math/exact-integer-sqrt

2009-03-29 Thread hjlee
Thank you! And sorry, I made serious typo in last question. I had to write "private" instead of "public". (I want to pull my hairs.) I'm not sure, I think there might be cases the error part not needed. --~--~-~--~~~---~--~~ You received this message because you

Status of Eclipse plug-in and OSGi compatibility

2009-03-29 Thread Frank Gerhardt
Hi *, I just came back from EclipseCON 2009. There was a short talk about Clojure (that I unfortunaltely missed) but the slides are available here http://www.eclipsecon.org/2009/sessions?id=630, click though to gpublication. Interesting, two questions: 1. What is the state of the Eclipse plug-i

Re: bug in clojure.contrib.math/exact-integer-sqrt

2009-03-29 Thread Mark Engelberg
If you don't care about the "leftover" portion that exact-integer-sqrt returns, you can do something like: (let [[floor-sqrt _] (exact-integer-sqrt n)] ...) or (first (exact-integer-sqrt n)) so I didn't want to expose another function which returns only half of the information that this one does.

Does anyone have a simple example of making a JPopupMenu in Clojure?

2009-03-29 Thread Rayne
I'm one of the ones who /didn't/ come from Java to Clojure. I can only get myself so far looking at Java examples. I need to make a context menu that will pop up when I right click inside of a JEditorPane. I'd appreciate it if anyone could whip me up a simple example of doing something like that i

Re: Quick slime/emacs questions

2009-03-29 Thread Victor Rodriguez
On Sun, Mar 29, 2009 at 4:41 PM, Mark Engelberg wrote: > > When I have two windows open, and hit C-x-C-b, it pops up a list of > buffers in the OTHER window from where the current focus is.  Any idea > why it's doing that, and how I can alter the behavior so it pops up > the list of buffers in th

Re: Quick slime/emacs questions

2009-03-29 Thread Mark Triggs
Something like this in your ~/.emacs might do the job: (define-key global-map (kbd "C-x C-b") (lambda () (interactive) (select-window (call-interactively 'list-buffers Cheers, Mark On Mar 30, 7:41 am, Mark Engelberg wrote: > When I have two windows open, and hit C-x-C-b, it

Re: bug in clojure.contrib.math/exact-integer-sqrt

2009-03-29 Thread hjlee
I know I can ignore leftover part, but my concern is that exact- integer-sqrt will calculate leftover if needed or not. Why not 2 public functions? like mzscheme's "integer-sqrt" and "integer-sqrt/remainder" On Mar 30, 9:16 am, Mark Engelberg wrote: > If you don't care about the "leftover" port

Re: Fresh Clojure Tutorial

2009-03-29 Thread Dan Beauchesne
Looks great, thanks a bunch. I'm not coming from a Java background so any swing example I can get my hands on is great. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send e

inconsistency with ref & get

2009-03-29 Thread Allen Rohner
I noticed an inconsistency with refs and get: (def ref-map (ref {:a 1, :b 2})) (ref-map :a) => 1 (get ref-map :a) => nil Now I haven't seen any documentation that getting the value of a ref without a @/deref is supported at all, so maybe this isn't supported. But if those forms are supported,

Suggest patch to math.clj - integer-length

2009-03-29 Thread Hwijae Lee
I changed "integer-length" to use numberOfLeadingZeros or bitLength methods. It reduces execution time a bit. So that of "exact-integer-sqrt" too. ;; test with name integer-length-new (defmulti ;; #^{:private true} integer-length-new class) (defmethod integer-length-new java.lang.Integer [n]

Re: file io

2009-03-29 Thread Korny Sietsma
sweet :) - Korny On Fri, Mar 27, 2009 at 4:34 AM, Victor Rodriguez wrote: > > On Tue, Mar 24, 2009 at 11:05 PM, Korny Sietsma wrote: > > It'd be nice to have a macro that worked more like the first example - > > "spit" is great for one-liners, but the fact that it opens and closes the > > file

Re: Quick slime/emacs questions

2009-03-29 Thread Tassilo Horn
Mark Engelberg writes: Hi Mark, > Also, where can I look up the names of various commands to rebind to > different keys? For example, I want to remap C-s to do what C-x-C-s > currently does, and I wan to remap C-f to do what C-s currently does, > to make behavior more consistent with other pro