Re: clojure rant

2008-09-13 Thread Apurva Sharan

I am trying out the changes - but this doesn't appear to work as mentioned in 
the README.

This is what I have now in my .emacs:

(require 'clojure-mode)
(require 'clojure-auto)
(require 'swank-clojure-autoload)

(setq swank-clojure-jar-path absolute path to clojure.jar)

When I start emacs - I get an error






- Original Message -
From: Matt Revelle [EMAIL PROTECTED]
To: clojure@googlegroups.com
Sent: Saturday, September 13, 2008 11:33:50 AM GMT +05:30 Chennai, Kolkata, 
Mumbai, New Delhi
Subject: Re: clojure rant



On Sep 13, 2008, at 2:00 AM, Apurva Sharan wrote:


 Hi Alexey,

 I am using Clojure with Emacs+Slime on Ubuntu 8.04 and it works with  
 the latest version of Clojure  Clojure-contrib from SVN.

 I based my setup on the information provided in swank-clojure.clj.  
 The packages are available from: http://clojure.codestuffs.com/

 1. Here is what I have in my .emacs specific to clojure:

 (add-to-list 'load-path path to clojure-extras)
 (add-to-list 'load-path path to swank-clojure)

 (require 'clojure-mode)
 (require 'clojure-auto)
 (require 'swank-clojure)

 (setq inferior-lisp-program clojure)

Don't need to set the inferior-lisp-program.



 (add-hook 'clojure-mode-hook
  '(lambda ()
 (define-key clojure-mode-map \C-c\C-e 'lisp-eval-last- 
 sexp)
 (define-key clojure-mode-map \C-x\C-e 'lisp-eval-last- 
 sexp)))


 2. I have an executable file named clojure in my path and  
 a .clojure.conf in my home directory. This are based off files  
 included in the clojure-extras package.


That external script is no longer needed, though using it will still  
work.  The classpath (and in a moment, java.library.path) can be set  
in your .emacs now.

 Hope this helps ...

 Regards,
 Apurva


 - Original Message -
 From: Alexey Goldin [EMAIL PROTECTED]
 To: Clojure clojure@googlegroups.com
 Sent: Saturday, September 13, 2008 10:34:24 AM GMT +05:30 Chennai,  
 Kolkata, Mumbai, New Delhi
 Subject: Re: clojure rant


 Oh. Thanks, will try right now. I am doing this on Friday night and I
 get answers immediately. Weird.

 On Sep 12, 11:49 pm, Matt Revelle [EMAIL PROTECTED] wrote:
 Hey Alexey,

 On Sep 13, 2008, at 12:41 AM, Alexey Goldin wrote:


 Well, you'll be missing tab completion for a little longer.  It's on
 my todo list but
 not highest priority.

 Please forgive my rant. It is obvious that many people are using it
 with great success and having much fun, so there obviously is a  
 way. I
 just fail to see it :-) Any hint on your clojure configuration is
 appreciated.  Thanks!

 If you swing both ways, Vimclojure is another option.


 No, I am sorry I am not swinging that far. The only thing I know about
 vi(m) is how to exit it if I start it accidentally.


 Thanks a lot!


 




--~--~-~--~~~---~--~~
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 from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~--~~~~--~~--~--~---



Re: clojure rant

2008-09-13 Thread Apurva Sharan

Oops - hit Ctrl-S too soon :( 

The error is:

---
Loading /home/apurva/.emacs-contrib/swank-clojure/swank-clojure.el 
(source)...done

An error has occurred while loading `/home/apurva/.emacs':

error: Error: You must specify a swank-clojure-jar-path. Please see README of 
swank-clojure.
---

When I change the order of (require 'swank-clojure-autoload) to be after 
setting the swank-clojure-jar-path, the emacs initialization goes through. But 
slime still doesn't start:

---
(clojure/require (quote swank))

(swank/ignore-protocol-version 2008-08-31)

(swank/start-server /tmp/slime.7935)

Exception in thread main java.lang.NoClassDefFoundError: 
Caused by: java.lang.ClassNotFoundException: 
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)

Process inferior-lisp exited abnormally with code 1
---

Regards,
Apurva



- Original Message -
From: Apurva Sharan [EMAIL PROTECTED]
To: clojure@googlegroups.com
Sent: Saturday, September 13, 2008 12:09:59 PM GMT +05:30 Chennai, Kolkata, 
Mumbai, New Delhi
Subject: Re: clojure rant

I am trying out the changes - but this doesn't appear to work as mentioned in 
the README.

This is what I have now in my .emacs:

(require 'clojure-mode)
(require 'clojure-auto)
(require 'swank-clojure-autoload)

(setq swank-clojure-jar-path absolute path to clojure.jar)

When I start emacs - I get an error






- Original Message -
From: Matt Revelle [EMAIL PROTECTED]
To: clojure@googlegroups.com
Sent: Saturday, September 13, 2008 11:33:50 AM GMT +05:30 Chennai, Kolkata, 
Mumbai, New Delhi
Subject: Re: clojure rant



On Sep 13, 2008, at 2:00 AM, Apurva Sharan wrote:


 Hi Alexey,

 I am using Clojure with Emacs+Slime on Ubuntu 8.04 and it works with  
 the latest version of Clojure  Clojure-contrib from SVN.

 I based my setup on the information provided in swank-clojure.clj.  
 The packages are available from: http://clojure.codestuffs.com/

 1. Here is what I have in my .emacs specific to clojure:

 (add-to-list 'load-path path to clojure-extras)
 (add-to-list 'load-path path to swank-clojure)

 (require 'clojure-mode)
 (require 'clojure-auto)
 (require 'swank-clojure)

 (setq inferior-lisp-program clojure)

Don't need to set the inferior-lisp-program.



 (add-hook 'clojure-mode-hook
  '(lambda ()
 (define-key clojure-mode-map \C-c\C-e 'lisp-eval-last- 
 sexp)
 (define-key clojure-mode-map \C-x\C-e 'lisp-eval-last- 
 sexp)))


 2. I have an executable file named clojure in my path and  
 a .clojure.conf in my home directory. This are based off files  
 included in the clojure-extras package.


That external script is no longer needed, though using it will still  
work.  The classpath (and in a moment, java.library.path) can be set  
in your .emacs now.

 Hope this helps ...

 Regards,
 Apurva


 - Original Message -
 From: Alexey Goldin [EMAIL PROTECTED]
 To: Clojure clojure@googlegroups.com
 Sent: Saturday, September 13, 2008 10:34:24 AM GMT +05:30 Chennai,  
 Kolkata, Mumbai, New Delhi
 Subject: Re: clojure rant


 Oh. Thanks, will try right now. I am doing this on Friday night and I
 get answers immediately. Weird.

 On Sep 12, 11:49 pm, Matt Revelle [EMAIL PROTECTED] wrote:
 Hey Alexey,

 On Sep 13, 2008, at 12:41 AM, Alexey Goldin wrote:


 Well, you'll be missing tab completion for a little longer.  It's on
 my todo list but
 not highest priority.

 Please forgive my rant. It is obvious that many people are using it
 with great success and having much fun, so there obviously is a  
 way. I
 just fail to see it :-) Any hint on your clojure configuration is
 appreciated.  Thanks!

 If you swing both ways, Vimclojure is another option.


 No, I am sorry I am not swinging that far. The only thing I know about
 vi(m) is how to exit it if I start it accidentally.


 Thanks a lot!


 




--~--~-~--~~~---~--~~
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 from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~--~~~~--~~--~--~---



[PATCH] Make clojure.contrib.sql/with-connection return the body result

2008-09-13 Thread meredydd

Hey all,
The current version of the (with-connection) macro in clojure-
contrib doesn't return the result of its body. (It just returns nil
from the commit() call at the end of the transaction). I attach a
patch to achieve this behaviour, so it can be used in a functional
style.

Meredydd
--

Patch against today's SVN HEAD:

Index: src/clojure/contrib/sql/sql.clj
===
--- src/clojure/contrib/sql/sql.clj (revision 161)
+++ src/clojure/contrib/sql/sql.clj (working copy)
@@ -31,8 +31,9 @@
   `(with-open ~con ~init
  (try
   (.setAutoCommit ~con false))
-  [EMAIL PROTECTED]
-  (.commit ~con)
+  (let [body-result# (do [EMAIL PROTECTED])]
+   (.commit ~con)
+   body-result)
   (catch Exception e#
  (.rollback ~con)
  (throw (Exception. transaction rolled back e#)

--~--~-~--~~~---~--~~
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 from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~--~~~~--~~--~--~---



Re: Make clojure.contrib.sql/with-connection return the body result

2008-09-13 Thread Rich Hickey



On Sep 13, 7:44 am, meredydd [EMAIL PROTECTED] wrote:
 Hey all,
 The current version of the (with-connection) macro in clojure-
 contrib doesn't return the result of its body. (It just returns nil
 from the commit() call at the end of the transaction). I attach a
 patch to achieve this behaviour, so it can be used in a functional
 style.


Just so everyone is clear - patches to clojure-contrib require the
same CA as does Clojure.

Thanks,

Rich

--~--~-~--~~~---~--~~
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 from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~--~~~~--~~--~--~---



Re: clojure rant

2008-09-13 Thread Alexey Goldin

What is the value of variable swank-clojure-jar-path in emacs?

Try to set it by running M-x customize-group swank-clojure , I wonder
if it helps. I got it running finally with Matt advice.

On Sep 13, 1:47 am, Apurva Sharan [EMAIL PROTECTED] wrote:
 Oops - hit Ctrl-S too soon :(

 The error is:

 ---
 Loading /home/apurva/.emacs-contrib/swank-clojure/swank-clojure.el 
 (source)...done

 An error has occurred while loading `/home/apurva/.emacs':

 error: Error: You must specify a swank-clojure-jar-path. Please see README of 
 swank-clojure.

--~--~-~--~~~---~--~~
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 from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~--~~~~--~~--~--~---



Re: clojure rant

2008-09-13 Thread Stuart Sierra

Clojure/SLIME integration may be in flux after the recent API
changes.  But plain old inferior-lisp mode works just fine:
M-x customize-variable RET inferior-lisp-program
...set the path of your Clojure startup script...
M-x inferior-lisp

A simple startup script could be simply:
#!/bin/sh
exec java -cp clojure.jar:clojure-contrib.jar clojure.lang.Repl

Hope this helps,
-Stuart


On Sep 13, 12:41 am, Alexey  Goldin [EMAIL PROTECTED] wrote:
 How people in this group run clojure? I would really prefer slime, but
 failed to get it working after 2 hours on my ubuntu 7.04. (Get rid of
 packaged slime, download latest slime from git, get clojure-mode,
 swank-clojure, configure .emacs, try to run it with clojure-20080612,
 find that it does not work, download svn version, find that I do not
 have maven, apt-get install maven2, apt-get install sun-java6-jdk (I
 had only jre), compile and discover that it chokes on load-resources
 not being defined. Why??? This is latest svn version after all)

 I do not really need latest version. Is there some frozen slime
 +clojure configuration that might work without too much effort that
 would not change much faster then documentation?

 I do not really complain as this is alpha project and I am ready to
 spend some effort to get it working. But this is not the first time I
 approach it and I miserably fail again.

 I guess I could simply run it from command line  but I really would
 miss tab completion and ability to look up documentation with simple
 keystrokes. I really got spoiled by slime.  Any other way to get it
 anywhere close to this capability that really makes learning much
 simpler?

 Please forgive my rant. It is obvious that many people are using it
 with great success and having much fun, so there obviously is a way. I
 just fail to see it :-) Any hint on your clojure configuration is
 appreciated.  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
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~--~~~~--~~--~--~---



Re: [PATCH] Make clojure.contrib.sql/with-connection return the body result

2008-09-13 Thread Stephen C. Gilardi

On Sep 13, 2008, at 7:44 AM, meredydd wrote:

 Hey all,
The current version of the (with-connection) macro in clojure-
 contrib doesn't return the result of its body. (It just returns nil
 from the commit() call at the end of the transaction). I attach a
 patch to achieve this behaviour, so it can be used in a functional
 style.

Hi meredydd,

I like the change. I'll incorporate it as soon as I get the go-ahead  
on the CA.

Thanks,

--Steve


--~--~-~--~~~---~--~~
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 from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~--~~~~--~~--~--~---



Re: Clojure Poll 09/2008

2008-09-13 Thread kyle smith

 What are you doing with Clojure?

I'm trying to write a DSL for molecular dynamics analysis (with
partial success).  Users will be able to compose complex properties
from basic info such as bond lengths/angles, position, velocity, etc.
I'd like to add regression and integrate it with a 3d viewer
eventually.  With some modification, this could allow users to
generate coordinates for complex structures (i.e. bio stuff like dna).
--~--~-~--~~~---~--~~
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 from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~--~~~~--~~--~--~---



clojure.contrib.sql updated

2008-09-13 Thread Stephen C. Gilardi
I've made some changes to clojure.contrib.sql:

- Renamed some functions/macros to shorter names:

get-connection - connection
execute-commands - do-commands
execute-prepared-statement - do-prepared
with-query-results - with-results

- Added create-table, drop-table

- Fixed a bug in with-connection--a prematurely closed try expression.  
(It looks like this was accidentally harmless through an interaction  
with with-open.)

- Changed do-commands/do-prepared so they accept a variable number of  
commands/parameter sets (using a '' argument) rather than an explicit  
sequence.

- moved examples to clojure.contrib.sql.test and updated them to the  
new API.

Comments welcome.

--Steve


--~--~-~--~~~---~--~~
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 from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~--~~~~--~~--~--~---



Re: Clojure Poll 09/2008

2008-09-13 Thread Craig McDaniel

 What are you doing with Clojure?

I work in a fairly conservative environment where they probably
wouldn't approve of my using a language in an alpha state, much less a
variant of Lisp! But since I love the language and the interactive
environment with Emacs, I decided it's easier to beg forgiveness than
ask permission.

1. Wrote a Clojure service that runs on remote thin clients. It
receives Clojure forms that instruct it to download and cache PDF
templates, dynamically fill in form data, overlay logos, etc.., then
print the resulting PDF.
2. I also use it for prototyping and experimentation.

 What 3 features would you most like to see added next?

1. I agree that better stack trace/error information would be nice.

Not really features, but...

2. More thorough documentation and examples: For instance: how to
profile your code and decide where you should use type hints.
3. Can't think of #3.

--~--~-~--~~~---~--~~
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 from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~--~~~~--~~--~--~---



Re: Clojure Poll 09/2008

2008-09-13 Thread Moxley Stratton


On Sep 10, 2008, at 11:40 AM, Rich Hickey wrote:


 What are you doing with Clojure?

Nothing at the moment. I wrote a knowledgebase engine inspired by the  
Cyc project, and I also wrote part of a web application in Compojure  
that lets users create web forms.

 What 3 features would you most like to see added next?

1. I love the language. Nothing to add there.

2. Like many others said, better error reporting.

3. The documentation is not well suited for the masses who are not  
well-versed in Lisp dialects or functional programming. It's more like  
marketing material for those who have already spent a some quality  
time in that world, and are curious to see how this new kid on the  
block compares. I think it does a great job at selling the language to  
those people, but the newbies are left behind. To help newbies, the  
documentation needs to be reorganized, more introductory text needs to  
be written, many more examples need to be shown.

Moxley

--~--~-~--~~~---~--~~
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 from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~--~~~~--~~--~--~---