Re: What is Contrib?

2009-05-13 Thread Konrad Hinsen
On 13.05.2009, at 00:04, Phil Hagelberg wrote: > Now that Clojure 1.0 is out, I think it's a good time to take a > look at > contrib. I noticed it didn't get an official 1.0 release along with > Clojure core. I wonder if this is because its role is just not very > well-defined. Several people h

Re: Macros applied to entire programs

2009-05-13 Thread Konrad Hinsen
On 13.05.2009, at 08:32, Konrad Hinsen wrote: > I have done exactly that recently when writing clojure.contrib.macro- > utils, which contains a full macro expansion engine because that's > the only way to implement symbol macros and local macros. It was an > interesting exercice in macro programm

Re: What is Contrib?

2009-05-13 Thread John Newman
I'm a novice, myself, but Clojure got me reading up on Scheme and, what about the PLaneT thing (require (planet blah ... (where dependencies are automatically pulled from a repository?) Maybe it's not applicable here, but I thought it was pretty neat. On Wed, May 13, 2009 at 11:41 AM, Konrad Hi

creator?

2009-05-13 Thread Mark Volkmann
user=> (source list) (def #^{:arglists '([& items]) :doc "Creates a new list containing the items."} list (. clojure.lang.PersistentList creator)) What is creator? -- R. Mark Volkmann Object Computing, Inc. --~--~-~--~~~---~--~~ You received this message

Re: creator?

2009-05-13 Thread Christophe Grand
Mark Volkmann a écrit : > user=> (source list) > (def > #^{:arglists '([& items]) > :doc "Creates a new list containing the items."} > list (. clojure.lang.PersistentList creator)) > > What is creator? > A static field of PersistentList which points to the list function (implemented in

Re: What is Contrib?

2009-05-13 Thread Rich Hickey
Contrib *is* an incubator for things that could become part of Clojure. Contrib is also a *process* we are all going through. Clojure Libraries Clojure shipped with no libraries other than itself. That is an important sentence to consider. Clojure is in many ways a very tiny Lisp used to build a

Re: Clojure Poetry

2009-05-13 Thread Christophe Grand
tmountain a écrit : > Very cool. I actually cleaned up the code a little bit more this > morning trying to speed things up a bit. It's still not as fast as I'd > like, but I'm not up to speed on Closure optimization either, so I > could be missing something. > There are two things that I notic

Re: Macros applied to entire programs

2009-05-13 Thread Christophe Grand
Mark Reid a écrit : > In particular, it seems converting `(+ 1 2 3)` to `(+ 1 (+ > 2 3))` can speed things up. Rich, would you accept a patch to make all arities inlinable for basic math ops? -- Professional: http://cgrand.net/ (fr) On Clojure: http://clj-me.blogspot.com/ (en) --~--~--

Exceptions using vimclojure - please help

2009-05-13 Thread Sigrid
Hi all, after successfully installing vimclojure at home on my mac, I wanted to do the same on my work machine (running Ubuntu), and I set it up in the same way. However, when I want to open a test clojure file, I get lots of exceptions: Fehler beim Ausführen von "function vimclojure#AddComplet

Re: Exceptions using vimclojure - please help

2009-05-13 Thread Laurent PETIT
Thanks for sharing with us what a German stack trace looks like :-) Ok, -> -1, I quit :-) -- laurent 2009/5/13 Sigrid > > Hi all, > > after successfully installing vimclojure at home on my mac, I wanted > to do the same on my work machine (running Ubuntu), and I set it up in > the same way. >

Re: String.getBytes does not translate to byte[]?

2009-05-13 Thread tsuraan
> Well, under the covers the str function applies the java "toString" > method to any passed in object and hence the result could for some > reason be different to the original String object passed in. I think > this could occur if the object subclasses String, but has a different > representation

Re: String.getBytes does not translate to byte[]?

2009-05-13 Thread Boris Mizhen - 迷阵
> Well, under the covers the str function applies the java "toString" > method to any passed in object and hence the result could for some > reason be different to the original String object passed in. I think > this could occur if the object subclasses String, but has a different > representation

Re: Exceptions using vimclojure - please help

2009-05-13 Thread Sigrid
Je peux le traduire si tu veux :-) On 13 Mai, 16:30, Laurent PETIT wrote: > Thanks for sharing with us what a German stack trace looks like :-) > > Ok, -> -1, I quit :-) > > -- > laurent > > 2009/5/13 Sigrid > > > > > Hi all, > > > after successfully installing vimclojure at home on my mac, I

Re: String.getBytes does not translate to byte[]?

2009-05-13 Thread Christophe Grand
tsuraan a écrit : > I was given a class java.lang.String > Chars are [\h \i \space \t \h \e \r \e] > Given string is 'hi there' > Bytes length is 8 > OtpBinary size is 35 > > with [ inside (str s) ] > > I was given a class java.lang.String > Chars are [\h \i \space \t \h \e \r \e] > Given string

Re: Exceptions using vimclojure - please help

2009-05-13 Thread Laurent PETIT
Nein, danke, Tchuss, ;-) -- Laurent 2009/5/13 Sigrid > > Je peux le traduire si tu veux :-) > > > > On 13 Mai, 16:30, Laurent PETIT wrote: > > Thanks for sharing with us what a German stack trace looks like :-) > > > > Ok, -> -1, I quit :-) > > > > -- > > laurent > > > > 2009/5/13 Sigrid >

Re: Exceptions using vimclojure - please help

2009-05-13 Thread Juergen Gmeiner
Hi Sigrid, I am not really qualified on this one because I am still happily using an old version of vimclojure/gorilla But I suspect that you are using some stripped down Vim that does not have the features required by vimclojure. I do remember some similiary errors on my mac when I tried using

Re: Does ProGuard work with clojure?

2009-05-13 Thread Chas Emerick
I have used proguard to obfuscate clojure in the past. I've not had a chance to attempt to duplicate your specific case, but I do seem to remember that proguard did not appreciate working with classes in the default package (which is where both public and magic are in your example). Additionally

The dreaded "Dont' know how to create ISeq from: Symbol"

2009-05-13 Thread Juergen Gmeiner
Hello everybody, sometimes the error messages from the compiler can be quite cryptic. This is nothing serious or ground-breaking, but I thought maybe it would be a good idea if we got clojure to tell us which symbol is incorrect? So I had a look at the code and it turns out this particular error

Re: String.getBytes does not translate to byte[]?

2009-05-13 Thread tsuraan
> I guess that if you enable reflection warnings, you'll get a warning on > the line where you invoke the constructor. > > I think the reflective dispatch doesn't pick the good constructor and > invokes OtpErlangBitstr(Object) instead of OtpErlangBitstr(byte[]). > Thus your byte[] is serialized an

Re: Exceptions using vimclojure - please help

2009-05-13 Thread Sigrid
Hi Juergen, thanks for your answer. Right now I tried with gvim also (the one from ubuntu), and unfortunately I get the same errors. This is the output of vim --version: VIM - Vi IMproved 7.1 (2007 May 12, compiled Jan 31 2008 12:00:11) Inklusive der Korrekturen: 1-138 Übersetzt von bui...@rothe

Re: String.getBytes does not translate to byte[]?

2009-05-13 Thread tsuraan
> I guess that if you enable reflection warnings, you'll get a warning on > the line where you invoke the constructor. As a bit of an aside, is there a reason that using multimethods with class-based dispatch doesn't add type hints by itself? It seems sort of strange that it's necessary to defin

Re: String.getBytes does not translate to byte[]?

2009-05-13 Thread Christophe Grand
tsuraan a écrit : >> I guess that if you enable reflection warnings, you'll get a warning on >> the line where you invoke the constructor. >> >> I think the reflective dispatch doesn't pick the good constructor and >> invokes OtpErlangBitstr(Object) instead of OtpErlangBitstr(byte[]). >> Thus your

SWT and Clojure through Scala

2009-05-13 Thread Marko Kocić
I was googling looking for the Clojure SWT examples when I found out about some attempts to wrap SWT in Scala. The code seems pretty functional (and functioning) and it seems we can borrow some ideas from there to create some nice SWT DSL in Clojure. Here are the links: - http://johlrogge.wordpre

Re: Breaking out of infinite loops

2009-05-13 Thread Jason Wolfe
I believe if you update to the newest versions of SLIME, swank- clojure, clojure, and clojure-contrib, ctrl-c ctrl-c should just work out of the box in SLIME without any modifications to your user code. I haven't used clojure-box though. -Jason On May 12, 11:11 pm, Mark Engelberg wrote: > I oft

Re: String.getBytes does not translate to byte[]?

2009-05-13 Thread tsuraan
> It's a type hint, it's not a type coercion. > > Without the type hint, the compiler doesn't know the type of s, so it > can't find the .getBytes method (nor, of course, its return type) and, > in doubt, picks the "broader" constructor: OtpErlangBinary(Object). > With the type hint, the compiler

Re: HTTP clients in clojure

2009-05-13 Thread Phil Hagelberg
Perry Trolard writes: >> Let me know if you find it useful. I would love to get some comments. >> -Phil > > Hi Phil, > > I'm trying out clojure-http-client, & thus far I like the idea of it > quite a bit: a simple but clever wrapper on built-in JDK APIs, so > provides convenience w/o the burden

Re: The dreaded "Dont' know how to create ISeq from: Symbol"

2009-05-13 Thread Stephen C. Gilardi
On May 13, 2009, at 11:57 AM, Juergen Gmeiner wrote: I don't think it would be a good idea to print out the coll in every case - after all, it might be some huge Java collection that somehow is not seq-able. But for java.lang.Named this should be quite safe. Discussion? I like it a lot. --

Re: Exceptions using vimclojure - please help

2009-05-13 Thread Meikel Brandmeyer
Hi, Am 13.05.2009 um 18:06 schrieb Sigrid: thanks for your answer. Right now I tried with gvim also (the one from ubuntu), and unfortunately I get the same errors. This is the output of vim --version: VIM - Vi IMproved 7.1 (2007 May 12, compiled Jan 31 2008 12:00:11) Vim versions < 7.2 are n

Re: The dreaded "Dont' know how to create ISeq from: Symbol"

2009-05-13 Thread J. McConnell
On Wed, May 13, 2009 at 1:09 PM, Stephen C. Gilardi wrote: > > On May 13, 2009, at 11:57 AM, Juergen Gmeiner wrote: > >> I don't think it would be a good idea to print out the coll in every >> case - after all, it might be some >> huge Java collection that somehow is not seq-able.  But for >> jav

Re: Macros applied to entire programs

2009-05-13 Thread Rich Hickey
On May 13, 9:57 am, Christophe Grand wrote: > Mark Reid a écrit : > > > In particular, it seems converting `(+ 1 2 3)` to `(+ 1 (+ > > 2 3))` can speed things up. > > Rich, would you accept a patch to make all arities inlinable for basic > math ops? > What does the patch do? Rich --~--~-

La Clojure plugin for IntelliJ IDEA updated

2009-05-13 Thread Ilya Sergey
Hello, all. I'm happy to announce, that new build of the `La Clojure' plugin for IntelliJ IDEA is uploaded into repository and may be downloaded directly from http://plugins.intellij.net/plugin/?id=4050 or via IntelliJ plugin manager. Among new features I may name code-aware resolve and completion

Re: Clojure Poetry

2009-05-13 Thread Jeremy James
On Apr 24, 10:52 am, tmountain wrote: > Very cool. I actually cleaned up the code a little bit more this > morning trying to speed things up a bit. It's still not as fast as I'd > like, but I'm not up to speed on Closure optimization either, so I > could be missing something. I'm glad you are

Re: Exceptions using vimclojure - please help

2009-05-13 Thread Sigrid
Hi Meikel, thanks for your help! In fact in the meantime I found out that the functions mentioned in the error message were not present in the old ubuntu vim version, so I installed the newest vim from vim.org, and it worked fine! Thanks again, and also congratulations for creating this great cl

Re: Clojure Poetry

2009-05-13 Thread David Nolen
I notice this code is using lists instead of vectors, this quite a performance hit, on my machine: (def my-vector (vec (range 0 1000))) (def my-list (apply list (range 0 1000))) ;; ~30ms (time (dotimes [x 100] (nth my-vector 999))) ;; ~9000ms (time (dotimes [x 100] (nth my-list 999))) On

Re: Macros applied to entire programs

2009-05-13 Thread Christophe Grand
Rich Hickey a écrit : > > On May 13, 9:57 am, Christophe Grand wrote: > >> Mark Reid a écrit : >> >> >>> In particular, it seems converting `(+ 1 2 3)` to `(+ 1 (+ >>> 2 3))` can speed things up. >>> >> Rich, would you accept a patch to make all arities inlinable for basic >> math

Colored parentheses highlighting for Emacs Clojurians

2009-05-13 Thread David Nolen
This works really well: http://nschum.de/src/emacs/highlight-parentheses/ --~--~-~--~~~---~--~~ 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 f

Re: Google App Engine - best workflow

2009-05-13 Thread David Nolen
Since deployed GAE apps use something that works like Jetty you could just develop against Compojure and make sure you aren't doing anything that launches a new thread. Then do sanity checks against the dev server before deploying. This way you get the speed of REPL style development, and only get

Re: Extending clojure.contrib.json.write/print-json

2009-05-13 Thread Tom Faulhaber
Josip, You might want to look at Dan Larkin's clojure-json library at http://github.com/danlarkin/clojure-json which supports extensions via dispatch as you suggest. Tom On May 12, 6:26 am, Josip Gracin wrote: > Hi! > > I'm querying a DB and getting java.sql.Timestamp in results, among > other

Google App Engine - best workflow

2009-05-13 Thread Kees-Jochem Wehrmeijer
Hi everybody, I started playing with Clojure on Google App Engine. By following the experiences of others (http://elhumidor.blogspot.com/2009/04/clojure- on-google-appengine.html and http://www.fatvat.co.uk/2009/05/clojure-on-google-app-engine.html mostly) I was able to get something running qui

Re: La Clojure plugin for IntelliJ IDEA updated

2009-05-13 Thread Wilson MacGyver
congrats, I just started exploring clojure and I've found "La Clojure" to be a very valuable tool. On Wed, May 13, 2009 at 2:16 PM, Ilya Sergey wrote: > Hello, all. > > I'm happy to announce, that new build of the `La Clojure' plugin for > IntelliJ IDEA is uploaded into repository and may be dow

Re: Extending clojure.contrib.json.write/print-json

2009-05-13 Thread Stuart Sierra
Hi Josip, The latest version of c.c.json dispatches on the "type" function, which in turn uses "class." It should be pretty easily extendible. -Stuart Sierra On May 12, 9:26 am, Josip Gracin wrote: > Hi! > > I'm querying a DB and getting java.sql.Timestamp in results, among > other things.  Whe

tree-utils

2009-05-13 Thread kyle smith
I've uploaded tree-utils.clj to the files section. http://groups.google.com/group/clojure/web/tree-utils.clj Here are some example usages: Subtracting two (or more) trees element-by-element: user=> atree [[1 2] [3 4 5] [6 7]] user=> btree [[2 3] [4 5 6] [7 8]] user=> (tree-reduce - atree btree)

Re: Google App Engine - best workflow

2009-05-13 Thread Victor Rodriguez
On Wed, May 13, 2009 at 5:35 PM, Kees-Jochem Wehrmeijer wrote: > > Hi everybody, > > I started playing with Clojure on Google App Engine. By following the > experiences of others (http://elhumidor.blogspot.com/2009/04/clojure- > on-google-appengine.html and > http://www.fatvat.co.uk/2009/05/cloj

str-utils change proposal, round 2

2009-05-13 Thread Sean Devlin
Hello again everyone, I've added a few new routines to a string library I've been working on. I mentioned it about a month ago, as a proposed change to str- utils. Original Thread: http://groups.google.com/group/clojure/browse_thread/thread/42152add46b851a0# Github: http://github.com/francoisde