Re: Mysterious performance anomalies

2009-01-17 Thread Mark H.
On Jan 16, 6:47 am, e wrote: > Is it much much easier to make byte code than assembly code? I'll chime in too to say that x86 is only king of the desktop / laptop world -- many portable devices are ARM-based (and a lot of Windows apps run on ARM), and there are other architectures used for enter

Re: Macros in interaction with Functions

2009-01-17 Thread Daniel Jomphe
Stuart Sierra wrote: > > - The reader performs a few substitutions, then gives the resulting > > code to the compiler. > > - The compiler starts by expanding macros into their substitution. > > --- Thus, for functions, there's no such thing as macros. > > --- Thus, all that functions see of mac

Re: Synchronization Benchmarks

2009-01-17 Thread Stu Hood
I added a Clojure implementation based on an Atom instead of a Ref, and re-ran the tests (this time on a quad core machine). I also fixed the calculation of the percent change in both tests (ugh). It looks like using an Atom is slightly more performant than a Ref if you are making a single state

Re: fit for contribution to clojure.contrib.ns-utils?

2009-01-17 Thread Dan Larkin
On Jan 17, 2009, at 6:29 PM, Stephen C. Gilardi wrote: > > Hi Dan, > > That's interesting. I've given it some thought and I've come to see > it as a version of resolve that tries harder than the default. > Here's an implementation that makes its capabilities purely a > superset of those of

repl-utils show

2009-01-17 Thread pc
This is very useful. For me it was useful to be able to limit the output to lines that contained a few selected letters. (show String "pper") === public final java.lang.String === [82] toUpperCase : String () [83] toUpperCase : String (Locale) nil I could always C-C C-O to flush the long outpu

Re: fit for contribution to clojure.contrib.ns-utils?

2009-01-17 Thread Stephen C. Gilardi
On Jan 17, 2009, at 4:11 PM, Dan Larkin wrote: (defn require-resolve [id] (let [sym (symbol id) ns-symbol (symbol (namespace sym)) var-symbol (symbol (name sym))] (require ns-symbol) (ns-resolve (find-ns ns-symbol) var-symbol))) The name is terrible,

Re: Common backend project?

2009-01-17 Thread Bill Clementson
Hi Meikel, On Sat, Jan 17, 2009 at 12:47 PM, Meikel Brandmeyer wrote: > Hi Stuart, > > Am 17.01.2009 um 21:16 schrieb Stuart Sierra: > >> SLIME communicates with SWANK via a well-defined >> socket interface, see > > Hmm.. I looked there before, but I could

Re: swank-clojure license

2009-01-17 Thread Matt Revelle
On Jan 17, 2009, at 5:03 PM, Stuart Sierra wrote: > > On Dec 31 2008, 5:16 am, lpetit wrote: >> I re-read my original post, and it seems clear to me : I stated I >> wish >> to embed swank-clojure files into clojure-dev plugin. > > I do not see a conflict here, provided you do not modify swank

Re: swank-clojure license

2009-01-17 Thread Stuart Sierra
On Dec 31 2008, 5:16 am, lpetit wrote: > I re-read my original post, and it seems clear to me : I stated I wish > to embed swank-clojure files into clojure-dev plugin. I do not see a conflict here, provided you do not modify swank-clojure and clearly indicate that it is under a separate license.

Re: Common backend project?

2009-01-17 Thread lpetit
On Jan 17, 10:05 pm, Meikel Brandmeyer wrote: > Salut Laurent, > > Am 17.01.2009 um 21:40 schrieb lpetit: > > > Now that's interesting. It may be easier to share code because you too > > decided to not follow slime/swank which, I guess, imposes as a middle > > language something closer to emacs-l

fit for contribution to clojure.contrib.ns-utils?

2009-01-17 Thread Dan Larkin
(defn require-resolve [id] (let [sym (symbol id) ns-symbol (symbol (namespace sym)) var-symbol (symbol (name sym))] (require ns-symbol) (ns-resolve (find-ns ns-symbol) var-symbol))) The name is terrible, I know. You can pass a symbol or a string

Re: Common backend project?

2009-01-17 Thread Meikel Brandmeyer
Salut Laurent, Am 17.01.2009 um 21:40 schrieb lpetit: Now that's interesting. It may be easier to share code because you too decided to not follow slime/swank which, I guess, imposes as a middle language something closer to emacs-lisp than to clojure for the exchanged data structures. Well. I

Re: Functional way to implement a VM?

2009-01-17 Thread jim
Just saw this thread. It's in my mind to do, but I don't know when I'll get to it. I've got a ton of code to write before I get to that item on my TODO list. However, if there'd be a place to put it on the Clojure page, I'd bump it to the top. Jim On Dec 23 2008, 1:07 am, Konrad Hinsen wrote:

Re: Common backend project?

2009-01-17 Thread Meikel Brandmeyer
Hi Stuart, Am 17.01.2009 um 21:16 schrieb Stuart Sierra: SLIME communicates with SWANK via a well-defined socket interface, see Hmm.. I looked there before, but I couldn't find a definition of the interface protocol. swank-clojure could be a place to

Re: Common backend project?

2009-01-17 Thread lpetit
Now that's interesting. It may be easier to share code because you too decided to not follow slime/swank which, I guess, imposes as a middle language something closer to emacs-lisp than to clojure for the exchanged data structures. And we could indeed also share the whole code of the server side.

Re: A quasiquote for Clojure?

2009-01-17 Thread Jason Wolfe
> That's a good idea. It would nicely complement the other > functions so far. Please find attached a patch. > > 1:1 user=> '~x > (clojure.core/unquote x) > 1:2 user=> '~...@x > (clojure.core/unquote-splicing x) > > Sincerely > Meikel Sweet, thanks Meikel! Rich, what do you think about integrati

Re: swank-clojure license

2009-01-17 Thread hughw
On Dec 31 2008, 6:48 am, lpetit wrote: > OOps, I'm losing memory, I answered twice to the e-mail ;-) > > On 31 déc, 11:16, lpetit wrote: > > > Yes, this is what I remember from LGPL. But anyway, swank-clojure is > > not LGPL, it's GPL. I suspect you can't distribute the swank-clojure files w

Re: How to implement "go to definition" and "find all references"

2009-01-17 Thread Stuart Sierra
On Jan 17, 10:25 am, Peter Wolf wrote: > How is the Clojure compiler tested?  Is there a set Clojure code that > serves as Unit tests?  I need something with all the corner cases both > for syntax and references. The early beginnings of a test suite are in clojure.contrib.test- clojure -Stuart

Re: Common backend project?

2009-01-17 Thread Stuart Sierra
On Jan 17, 2:03 pm, Matt Revelle wrote: > > Tools such as SLIME and (I think) Gorilla, on the other hand, are not > > written in language that makes sharing easy. > > This is not entirely correct.  SLIME works by communicating with the   > running Lisp process (in this case, Clojure), essentially

Re: Common backend project?

2009-01-17 Thread lpetit
On Jan 17, 7:47 pm, Peter Wolf wrote: > Sure, good idea.  I'm in! > > As a first cut, I think we need to separate those tools written in JVM > languages (Clojure/Java) and those written in something else. > > I certainly think the JVM based projects can, and should, share > components.   For sur

Re: Common backend project?

2009-01-17 Thread Meikel Brandmeyer
Hi, Am 17.01.2009 um 20:03 schrieb Matt Revelle: Tools such as SLIME and (I think) Gorilla, on the other hand, are not written in language that makes sharing easy. This is not entirely correct. SLIME works by communicating with the running Lisp process (in this case, Clojure), essentially al

Re: Eval with local bindings

2009-01-17 Thread Christophe Grand
Greg Harman a écrit : > One solution is to use (binding), which still requires a global var, > but gives each eval it's own binding of that var: > > user=> (def x) > #'user/x > user=> (def expr '(+ x 4)) > #'user/expr > user=> (binding [x 3] (eval expr)) > 7 > user=> x > java.lang.IllegalStateExce

Re: Common backend project?

2009-01-17 Thread lpetit
I downloaded cusp source code and digged into it a little bit once. The problem is, I couldn't figure out quickly the detail of the swank client they implemented, nor did I figure out quickly the detail of the interface between slime and swank. I wished there were already a client for swank writ

Re: Eval with local bindings

2009-01-17 Thread Greg Harman
Nathan, Just to confirm two things in eval-expr: 1. Should seq be seq? 2. It looks like you still need to a. have a global x defined to evaluate eval-expr and b. need to wrap the call to eval-expr with binding in order to get a non-global binding for x (let doesn't seem to do the trick). -Greg

Re: Reading non-printing characters in the reader?

2009-01-17 Thread Tom Faulhaber
Thanks, Steve. I was too lazy to UTSL last night and, as you mention, this isn't in the docs. (It turns out I ended up writing a 10-line function that just does what pr would do by itself :-)) I did learn that I could type ^C into the REPL under emacs by quoting ( \ C-Q C-C ) and then the reader

Re: Eval with local bindings

2009-01-17 Thread Nathan Kitchen
On Sat, Jan 17, 2009 at 11:06 AM, Greg Harman wrote: > > Meta: This thread is a revival and continuation of last month's > discussion at: > http://groups.google.com/group/clojure/browse_thread/thread/e1226810b6ac7bfc/8e0f53c141c26fcc?lnk=gst&q=eval+binding#8e0f53c141c26fcc > > --- > > Nathan, did

Eval with local bindings

2009-01-17 Thread Greg Harman
Meta: This thread is a revival and continuation of last month's discussion at: http://groups.google.com/group/clojure/browse_thread/thread/e1226810b6ac7bfc/8e0f53c141c26fcc?lnk=gst&q=eval+binding#8e0f53c141c26fcc --- Nathan, did you ever come up with a better way to do this than using a global v

Re: Newbie problem

2009-01-17 Thread mbrodersen
Yes that does indeed fix the problem :-) Thanks Shawn! Cheers Morten --~--~-~--~~~---~--~~ 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 fro

Re: Common backend project?

2009-01-17 Thread Matt Revelle
On Jan 17, 2009, at 1:47 PM, Peter Wolf wrote: > > Sure, good idea. I'm in! > > As a first cut, I think we need to separate those tools written in JVM > languages (Clojure/Java) and those written in something else. > > I certainly think the JVM based projects can, and should, share > components.

Re: Common backend project?

2009-01-17 Thread Peter Wolf
Sure, good idea. I'm in! As a first cut, I think we need to separate those tools written in JVM languages (Clojure/Java) and those written in something else. I certainly think the JVM based projects can, and should, share components. BTW the most important JVM project is Clojure itself. The

Re: QT Jambi and the Repl

2009-01-17 Thread chris
I started writing some opengl stuff using QT Jambi and I went through a world of pain. First off, on the Mac, you can't use java 1.6 and QT because 1.6 is a 64 bit JVM and QT doesn't work with the 64 bit cocoa libraries. Second off, QT + JOGL consistently hung when run from the repl. Upon initi

Re: Common backend project? (was: Re: How to implement "go to definition" and "find all references")

2009-01-17 Thread Meikel Brandmeyer
Hi, Am 17.01.2009 um 18:12 schrieb Meikel Brandmeyer: things, like the Parser mentioned above. Or Chouser's or I'm sorry. I meant Chouser's show. Sincerely Meikel smime.p7s Description: S/MIME cryptographic signature

Common backend project? (was: Re: How to implement "go to definition" and "find all references")

2009-01-17 Thread Meikel Brandmeyer
Hi, Am 17.01.2009 um 16:22 schrieb Peter Wolf: I think much of the parser, such as the JFlex lexer is certainly reusable. The recursive descent parser outputs Intellij objects, but with pretty minor changes could be made reuseable. Please feel free to take anything you want. http://code.goog

Re: clojure repl quits after calling static java method

2009-01-17 Thread Matt Revelle
On Jan 16, 2009, at 9:40 PM, larry wrote: > > I'm calling a java static method Play.midi in JMusic from Clojure > REPL. > After it plays the notes and says: "completed MIDI playback", the > Clojure REPL quits. > How do I keep the Clojure REPL from quitting after making this call to > Java? JMus

Re: Newbie problem

2009-01-17 Thread Shawn Hoover
On Sat, Jan 17, 2009 at 9:09 AM, mbrodersen wrote: > > Hi > > I am having fun learning Clojure but have a problem with the following > code. If you run the code with the ;OK removed then it works. If you > run the code with ;ERROR removed then it doesn't. > > The code is my own implementation of s

Re: How to implement "go to definition" and "find all references"

2009-01-17 Thread Peter Wolf
Excellent! How is the Clojure compiler tested? Is there a set Clojure code that serves as Unit tests? I need something with all the corner cases both for syntax and references. Thanks P Stephen C. Gilardi wrote: > > On Jan 17, 2009, at 8:40 AM, Peter Wolf wrote: > >> Actually, the observati

Re: How to implement "go to definition" and "find all references"

2009-01-17 Thread Peter Wolf
Hi Laurent I think much of the parser, such as the JFlex lexer is certainly reusable. The recursive descent parser outputs Intellij objects, but with pretty minor changes could be made reuseable. Please feel free to take anything you want. http://code.google.com/p/clojure-intellij-plugin/so

Newbie problem

2009-01-17 Thread mbrodersen
Hi I am having fun learning Clojure but have a problem with the following code. If you run the code with the ;OK removed then it works. If you run the code with ;ERROR removed then it doesn't. The code is my own implementation of splitting a string into individual words (just a learning exercise

clojure repl quits after calling static java method

2009-01-17 Thread larry
I'm calling a java static method Play.midi in JMusic from Clojure REPL. After it plays the notes and says: "completed MIDI playback", the Clojure REPL quits. How do I keep the Clojure REPL from quitting after making this call to Java? --~--~-~--~~~---~--~~ You rec

Re: How to implement "go to definition" and "find all references"

2009-01-17 Thread lpetit
Hello Peter, As I understand, you've made what I also began to make for clojuredev (clojure dev environment for eclipse me and other folks are working on on our spare time) : a static source code parser. Mine is currently not very tested (and maybe not very usefull as is, because it has not yet b

Re: How to implement "go to definition" and "find all references"

2009-01-17 Thread Stephen C. Gilardi
On Jan 17, 2009, at 8:40 AM, Peter Wolf wrote: Actually, the observation below might be really good news. Does it means that all references are resolved at compile time? Do I ever have to run the code to figure out the context of a reference? Or, does the lexical context give me all the

Re: Reading non-printing characters in the reader?

2009-01-17 Thread Stephen C. Gilardi
On Jan 17, 2009, at 2:37 AM, Tom Faulhaber wrote: Question: How do I read non-printing characters in the reader? From reading src/jvm/clojure/lang/LispReader.java and experimenting, I see that there are at least 3 ways to read such an arbitrary character code with the reader: - Octal ch

Re: How to implement "go to definition" and "find all references"

2009-01-17 Thread Peter Wolf
Actually, the observation below might be really good news. Does it means that all references are resolved at compile time? Do I ever have to run the code to figure out the context of a reference? Or, does the lexical context give me all the information I need? I have already reimplemented t

Re: How to implement "go to definition" and "find all references"

2009-01-17 Thread Stuart Sierra
Hi Peter, On Jan 16, 5:37 pm, Peter Wolf wrote: > Hi and thanks for all the feedback > > How does SLIME handle this case? > > user=> (def foo 1) > #'user/foo > user=> (defn bah [] (let [foo 2] foo)) > #'user/bah > user=> (bah) > 2 SLIME doesn't handle it at all; it just sends strings to the Lis

Re: Macros in interaction with Functions

2009-01-17 Thread Stuart Sierra
Hi Daniel, On Jan 16, 6:54 pm, Daniel Jomphe wrote: > I'll tell you my current understanding of how Clojure works, so you > can correct me where I may be wrong: > > - The compiler has for target a living environment; thus, it's > dynamic. > - There's no interpreter; thus, the following points wi

Re: A quasiquote for Clojure?

2009-01-17 Thread Meikel Brandmeyer
Hi Jason, Am 16.01.2009 um 00:36 schrieb Jason Wolfe: I like this a lot. Any chance of getting the same treatment for unquote-splicing? user> '~x (clojure.core/unquote x) user> '~...@x ; Exception: can't embed object in code ; Desired output: (clojure.core/unquote-splicing x) That's a good

Re: javadoc.clj

2009-01-17 Thread Christophe Grand
pc a écrit : > This is very useful. Thanks for doing it. > You're welcome. > On windows xp find-javadoc-url would not work for local javadocs, > maybe because of window's "c:\xx" syntax. Using (.toURL file) seemed > to fix it. Maybe that will work for the other systems also. > Fixed, thanks