Re: Having difficulties with compilation in slime, emacs and clojure-project

2010-01-07 Thread Rob Wolfe


Rob Lachlan napisał(a):
 Thanks for the help.  I had initially installed slime, clojure-mode
 and swank following the instructions at 
 http://riddell.us/tutorial/slime_swank/slime_swank.html

 I tried simply installing swank-clojure, but that seemed to conflict
 with what I already had.  So I removed everything -- slime, clojure-
 mode, etc.  and installed swank-clojure using ELPA.

 This in turn installed slime, slime-repl, swank-clojure, and clojure-
 mode.  But now when I try M-x slime, I get:

 Searching for program: no such file or directory, lisp

 Clearly, my emacs-fu is not strong enough.  Any ideas?

First of all make sure that ELPA package.el is loaded before (require
'slime).
It is important for correct initialization of load-path list.
Then check the content of load-path (type load-path in *scratch*
buffer and press C-j).
There should be in this list directories with clojure-mode, slime,
slime-repl, swank-clojure
installed using ELPA.
Check swank-clojure-classpath (there should be clojure.jar, clojure-
contrib.jar
and swank-clojure.jar on this path)
and swank-clojure-java-path (there should be java executable,
which can be found on system PATH).

HTH,
Rob
-- 
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 with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Recommended JVM flags for Clojure

2010-01-07 Thread Gabi
Hello fellow Clojurians,

I got lots of java.lang.OutOfMemoryError: GC overhead limit exceeded
 exceptions ,and after a short investigation added the following
flags (JVM 1.6.0_17):
-XX:+UseConcMarkSweepGC -XX:+CMSIncrementalMode -XX:
+CMSIncrementalPacing

These flags seems to solve the problem, but I am interested in your
experience and best practices regarding JVM flags in clojure.

I know it really depends on the type of the application, but it seems
to me that the gc is working really hard under Clojure (I cannot prove
it, this is just an impression)

Gabi





-- 
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 with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: Understanding the continuation monad's bind operator

2010-01-07 Thread Konrad Hinsen

On 07.01.2010, at 01:56, Steven E. Harris wrote:


I'm interested in what you mean by composite computation, because I
think it's hinting at some concept for monads that I missed. If, as  
you
say, executing the function immediately is not acceptable behavior,  
then
I infer that the goal is to delay evaluation of the monadic function  
'f'

until someone finally passes in a real continuation as, say, by the
`run-cont' function. Is that right?


Right. Consider the following simple example:

(domonad cont-m
[x (m-result 1)
 y (m-result 2)]
(+ x y))

Its result is a function that, when called with a continuation  
argument, calls the continuation with the argument 3. This implies  
that nothing at all is executed when the monadic composition happens.  
All real execution is delayed until the composite function is called.


If so, is it the case with all or most monads that the bind operator  
is

not meant to actually perform computation on the spot, but rather to
compose a delayed computation, or is this delaying particular to the
continuation monad?


No. The state and continuation monads behave like that, but the  
sequence and maybe monads do not. This is not as arbitrary as it may  
seem to be, as there is a simple rule: When the monadic values are  
functions representing computations, monadic composition yields a new  
function but doesn't execute anything. When the monadic values  
represent results of computations, then monadic composition implies  
execution of the computational steps.


Konrad.
-- 
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 with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: Understanding the continuation monad's bind operator

2010-01-07 Thread Konrad Hinsen

On 07.01.2010, at 02:23, Steven E. Harris wrote:


That means that a monadic function has a signature like

 a - m b


RIght.


Say that we're looking to use some normal functions with this
monad. Those functions may have signatures like

 a - b

They clearly don't return the right kind of value. There must be some
way to integrate such functions without writing new wrappers around  
them

by hand. Is this a job for `m-fmap'?


There are various ways to construct monadic values. m-fmap is one of  
them, but it already requires a monadic value as input. The simplest  
way to construct a monadic value is m-result.



Reading the implementation, it
looks like it would take a normal function and allow it to call on  
the

basic value extracted from a monadic value.


Indeed. One way to define m-fmap is

(defn m-fmap [f mv]
(domonad
[x mv]
(f x)))

But note that the second value is already a monadic value.


The lift operator also sounded relevant, but, if I understand it
correctly, it converts a normal function to one that accepts a  
monadic

value and returns a monadic value.


Right. For a function of a single argument, m-lift and m-fmap are  
equivalent.


That's the wrong argument type to be used with bind -- which wants  
to call on a monadic function with a basic value -- so I don't  
understand when one would want to use lift. When
would one be able to call on a lifted function? A simple example  
would

help.


Here is an example taken from clojure.contrib.monads.examples. The  
function pairs take a sequence of values and produces a sequences of  
all pairs of items in the input sequence:


(with-monad sequence-m
   (defn pairs [xs]
  ((m-lift 2 #(list %1 %2)) xs xs)))

Konrad.
-- 
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 with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: [ANN] clj-peg v0.6 released

2010-01-07 Thread Stefan Tilkov
On Jan 5, 2010, at 5:59 PM, Richard Lyman wrote:

 For now I'd rather be compensated if someone were planning on using clj-peg 
 commercially. I'm not sure how much I'd charge for a commercial-friendly 
 license, and I don't have an automated process for handling billing and 
 production of a differently licensed product, so I'm reluctant to move that 
 direction for now.
 
 If you were interested in licensing clj-peg under different terms I'm willing 
 to discuss it outside of this mailing list.
 
 Did that answer your question?
 

Yes, thanks.

Best,
Stefan

 -Rich
 
 
 
 On Tue, Jan 5, 2010 at 8:17 AM, Stefan Tilkov stefan.til...@innoq.com wrote:
 Richard, can you elaborate on the license?
 
 The license page says Permission is granted to use and redistribute this 
 software except for commercial use […]
 
 Stefan
 --
 Stefan Tilkov, http://www.innoq.com/blog/st/
 
 -- 
 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 with your 
 first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en

-- 
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 with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Newbie question on XML processing

2010-01-07 Thread Tzach
Hello
I have a simple task of reading an XML structure, manipulate part of
it and writing it back to XML.
For example, adding 1$ for each book with a year element after 2005 in
the following example:

?xml version=1.0 encoding=UTF-8?
bookstore
  book category=COOKING
title lang=enEveryday Italian/title
authorGiada De Laurentiis/author
year2005/year
price30.00/price
  /book
  book category=CHILDREN
title lang=enHarry Potter/title
authorJ K. Rowling/author
year2006/year
price29.99/price
  /book
/bookstore

clojure.contrib.zip-filter.xml is getting me close to this, but I
still do not see how can I use it (or other library) to modify values.
What would be the idiomatic (and easiest) way to do that?
I apologize in advance if this is too trivial.

Thanks
Tzach
-- 
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 with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: Recommended JVM flags for Clojure

2010-01-07 Thread kyle smith
First, make sure you have -server. If you can spare more heap, use -
Xmx1g . If you're on a 64bit jvm, -XX:+UseCompressedOops adds a
significant boost. A flag that helps quite a bit is -XX:
+DoEscapeAnalysis .  Finally, if you want to play around with the JIT
threshold, use -XX:CompileThreshold=n , where n defaults to 1.
-- 
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 with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: Having difficulties with compilation in slime, emacs and clojure-project

2010-01-07 Thread Phil Hagelberg
Rob Lachlan robertlach...@gmail.com writes:

 Thanks for the help.  I had initially installed slime, clojure-mode
 and swank following the instructions at 
 http://riddell.us/tutorial/slime_swank/slime_swank.html

 I tried simply installing swank-clojure, but that seemed to conflict
 with what I already had.  So I removed everything -- slime, clojure-
 mode, etc.  and installed swank-clojure using ELPA.

 This in turn installed slime, slime-repl, swank-clojure, and clojure-
 mode.  But now when I try M-x slime, I get:

 Searching for program: no such file or directory, lisp

Sounds like you didn't quite remove everything from your old
setup. There must still be some old slime code/configuration lying
around somewhere.

-Phil
-- 
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 with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: SLIME/Swank problem with swank.util.sys/get-pid and RuntimeMXBean

2010-01-07 Thread Phil Hagelberg
Steven E. Harris s...@panix.com writes:

 Here's the stack:

 o swank-clojure
   Git head.

 o SLIME
   Both CVS head and git://git.boinkor.net/slime.git head behave the same
   way, as the offending calls are in swank-clojure.

Could you try installing SLIME via ELPA as recommended in the
swank-clojure readme? CVS head is known to have introduced
incompatibilities with Clojure.

-Phil
-- 
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 with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: Recommended JVM flags for Clojure

2010-01-07 Thread Stuart Sierra
I use -XX:+UseConcMarkSweepGC.  And don't forget -Xmx, just having a
bigger heap can solve some problems.  Some people have found it
necessary to increase the PermGen size, but usually only for programs
that generate a lot of functions dynamically.

-SS


On Jan 7, 4:20 am, Gabi bugspy...@gmail.com wrote:
 Hello fellow Clojurians,

 I got lots of java.lang.OutOfMemoryError: GC overhead limit exceeded
  exceptions ,and after a short investigation added the following
 flags (JVM 1.6.0_17):
 -XX:+UseConcMarkSweepGC -XX:+CMSIncrementalMode -XX:
 +CMSIncrementalPacing

 These flags seems to solve the problem, but I am interested in your
 experience and best practices regarding JVM flags in clojure.

 I know it really depends on the type of the application, but it seems
 to me that the gc is working really hard under Clojure (I cannot prove
 it, this is just an impression)

 Gabi
-- 
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 with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

clojure-contrib 1.1.0 Release Candidate 2

2010-01-07 Thread Stuart Sierra
We have a second Release Candidate for clojure-contrib version 1.1.

This avoids ticket #42, AOT compilation of clojure-contrib.jar
pre-sets logging implementation, by not AOT-compiling logging.clj.

-SS
-- 
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 with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: ANN: 6pm Sat, Jan 9th: Wraith Scheme, Paralell Distributed Clojure at the Hacker Dojo

2010-01-07 Thread nallen05

Whoops, yes, I meant Jan 9, thanks

On Jan 6, 8:02 pm, ajay gopalakrishnan ajgop...@gmail.com wrote:
 It's Jan 9 I guess



 On Wed, Jan 6, 2010 at 10:53 PM, nallen05 nalle...@gmail.com wrote:
  Two very cool presentations this Saturday at the Hacker Dojo in
  Mountain View:

  1. An introduction to Wraith Scheme by Jay Reynolds Freeman
  2. An introduction to parallel and distributed programming with
  Clojure by Amit Rathore

  Go here for more info:http://www.meetup.com/balisp/calendar/12248048/

  Hope to see you there!

  Nick

  --
  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 with
  your first post.
  To unsubscribe from this group, send email to
  clojure+unsubscr...@googlegroups.comclojure%2bunsubscr...@googlegroups.com­
  For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en- Hide quoted text -

 - Show quoted text -
-- 
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 with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: Recommended JVM flags for Clojure

2010-01-07 Thread Gabi
Thanks I'll try those flags. I indeed use 64 bits

On Jan 7, 6:47 pm, kyle smith the1physic...@gmail.com wrote:
 First, make sure you have -server. If you can spare more heap, use -
 Xmx1g . If you're on a 64bit jvm, -XX:+UseCompressedOops adds a
 significant boost. A flag that helps quite a bit is -XX:
 +DoEscapeAnalysis .  Finally, if you want to play around with the JIT
 threshold, use -XX:CompileThreshold=n , where n defaults to 1.
-- 
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 with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: Recommended JVM flags for Clojure

2010-01-07 Thread Albert Cardona
What I use:

-Xincgc  : enable incremental garbage collector. Works great when
there's more than 1 CPU

-Xms4000m -Xmx4000m : set both min and max heap size to the same
amount (4 Gb in this case). Prevents dynamic heap resizing, which at
high loads may result in unexpected out of memory errors and long
pauses.

Albert
--
http://albert.rierol.net
-- 
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 with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

ClojureCLR + Silverlight

2010-01-07 Thread Garth Sheldon-Coulson
Hi All,

Does anyone know if ClojureCLR runs or could run on the Silverlight
CLR? Can one use ClojureCLR to build Silverlight applications?

I am as new as one can be to the .NET/CLR world, but the combination
seems promising for an application I am planning to work on.

Garth
-- 
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 with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: Having difficulties with compilation in slime, emacs and clojure-project

2010-01-07 Thread Rob Lachlan
Thanks Phil and Rob for your help.

I got rid of everything in emacs.d, and tried reinstalling from the
beginning.  For some reason, elpa seems to get stuck halfway through
with this message:

trying to parse HTTP response code in odd buffer: *http tromey.com:80*

But having installed swank-clojure, I get an error:

java.lang.ClassNotFoundException: swank.swank

And I can't find swank-clojure.jar anywhere on my system.  Should I
have built that separately? Anyway, thanks very much for all your
help.

Rob


On Jan 7, 9:05 am, Phil Hagelberg p...@hagelb.org wrote:
 Rob Lachlan robertlach...@gmail.com writes:
  Thanks for the help.  I had initially installed slime, clojure-mode
  and swank following the instructions 
  athttp://riddell.us/tutorial/slime_swank/slime_swank.html

  I tried simply installing swank-clojure, but that seemed to conflict
  with what I already had.  So I removed everything -- slime, clojure-
  mode, etc.  and installed swank-clojure using ELPA.

  This in turn installed slime, slime-repl, swank-clojure, and clojure-
  mode.  But now when I try M-x slime, I get:

  Searching for program: no such file or directory, lisp

 Sounds like you didn't quite remove everything from your old
 setup. There must still be some old slime code/configuration lying
 around somewhere.

 -Phil
-- 
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 with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: SLIME/Swank problem with swank.util.sys/get-pid and RuntimeMXBean

2010-01-07 Thread Steven E. Harris
Phil Hagelberg p...@hagelb.org writes:

 Could you try installing SLIME via ELPA as recommended in the
 swank-clojure readme?

That will be a project I'll have to defer until the weekend, as I've
never used ELPA. I use the CVS SLIME almost daily for Common Lisp work,
so I'm reluctant to give it up. Also, it's not a tenable situation to
fork SLIME for Clojure support.

 CVS head is known to have introduced incompatibilities with Clojure.

Is the git repository at git://git.boinkor.net/slime.git just tracking
the CVS repository, or is that the same as the ELPA-hosted one? I did
try all of this with the git version and found the exact same behavior
as with the CVS version.

-- 
Steven E. Harris

-- 
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 with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: Understanding the continuation monad's bind operator

2010-01-07 Thread Steven E. Harris
Thank you, Konrad. Your explanation was perfect.

-- 
Steven E. Harris

-- 
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 with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: Understanding the continuation monad's bind operator

2010-01-07 Thread Steven E. Harris
Konrad Hinsen konrad.hin...@fastmail.net writes:

 When the monadic values are functions representing computations,
 monadic composition yields a new function but doesn't execute
 anything. When the monadic values represent results of computations,
 then monadic composition implies execution of the computational steps.

Can you recommend a book that covers aspects of monads like these? I'd
like to learn more about the abstract concepts than their implementation
in a particular language.

-- 
Steven E. Harris

-- 
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 with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: SLIME/Swank problem with swank.util.sys/get-pid and RuntimeMXBean

2010-01-07 Thread Phil Hagelberg
Steven E. Harris s...@panix.com writes:

 Could you try installing SLIME via ELPA as recommended in the
 swank-clojure readme?

 That will be a project I'll have to defer until the weekend, as I've
 never used ELPA. I use the CVS SLIME almost daily for Common Lisp work,
 so I'm reluctant to give it up. Also, it's not a tenable situation to
 fork SLIME for Clojure support.

If someone would volunteer to fix it, I'd be thrilled. Nobody who is
interested in using CL and Clojure at the same time has stepped forward
so far, which is why it's currently broken.

 CVS head is known to have introduced incompatibilities with Clojure.

 Is the git repository at git://git.boinkor.net/slime.git just tracking
 the CVS repository, or is that the same as the ELPA-hosted one? I did
 try all of this with the git version and found the exact same behavior
 as with the CVS version.

Yes, that git repo is just a mirror of CVS.

-Phil
-- 
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 with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: Having difficulties with compilation in slime, emacs and clojure-project

2010-01-07 Thread Phil Hagelberg
Rob Lachlan robertlach...@gmail.com writes:

 But having installed swank-clojure, I get an error:

 java.lang.ClassNotFoundException: swank.swank

 And I can't find swank-clojure.jar anywhere on my system.  Should I
 have built that separately? Anyway, thanks very much for all your
 help.

How did you launch it? If you use M-x swank-clojure-project, you'll need
to use a dependency management system to place swank-clojure.jar in
lib/, as it says in the readme.

-Phil
-- 
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 with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: gui repl

2010-01-07 Thread Joseph Smith
This is very interesting, but I cannot seem to get Clojure code to execute in 
it. I have it installed and field thinks it is installed. Do I need to somehow 
switch modes?


---
Joseph Smith
j...@uwcreations.com





On Jan 4, 2010, at 3:42 PM, Marc Downie wrote:

 
 Well, if people are in the mood for fun, hybrid, Clojure REPLs... 
 
 The latest version of Field (a mac-only open source IDE for digital art) 
 secretly supports Clojure as one of its embedded languages (screenshot here, 
 more information about Field here). This means you can write:
 
 # these lines are Python (strictly, Jython)
 xxx =15
 vv = Vector3(1.2,0,1) # Vector3 is actually Java Class
 
 // start-clojure
 
 (defn asum [#^floats xs]
   (areduce xs i ret (float 0)
   (+ ret (aget xs i
 
 (println (asum (float-array [xxx (.x vv) 3])))
 
 // end-closure
 
 # back to Python, in beta 11
 _clojure.asum(array('f', [1,2,3]))
 
 ---
 
 Installation instructions upon request: it's just an undocumented hack right 
 now, but it's a working hack. You can use it to write code against the 
 Field's OpenGL graphics system or Processing libraries. If anybody is excited 
 (rather than repulsed or outraged) by this we could use some Clojure hacking 
 talent to make it real.
 
 best,
 
 Marc.
 
 On Mon, Jan 4, 2010 at 2:17 PM, Brian Goslinga quickbasicg...@gmail.com 
 wrote:
 Nice.  This reminds me of some of the things you can do in CLIM.
 
 --
 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 with your 
 first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en
 
 
 -- 
 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 with your 
 first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en

-- 
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 with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: Recommended JVM flags for Clojure

2010-01-07 Thread Seth
Hi Gabi,

This may not be useful, but have you tried running the Clojure new
branch? Rich implemented fine-grained locals clearing on the new
branch, and it helps avoid holding onto unused data accidentally.

http://groups.google.com/group/clojure/browse_thread/thread/14baed8f26097515/583cd8375a0d446d

Seth
-- 
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 with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

[ANN] CfP: IEEE Software Special Issue: Multiparadigm Programming

2010-01-07 Thread Dean Wampler
Apologies for repeat emails… Note the 1 Feb. deadline!CfP: IEEE Software
Special Issue: Multiparadigm Programming

*Final submissions due: 1 February 2010
Publication date: September/October 2010*

For most of today’s applications, using one language and one paradigm—for
instance, object-oriented programming—is inadequate. Today’s applications
are often polyglot, involving multiple languages, and multiparadigm,
involving a mixture of deployment directives as well as functional,
relational, object-oriented, aspect-oriented, and other paradigms. *IEEE
Software* is soliciting articles for a special issue on multiparadigm
programming, or MPP. It will explore MPP technologies, advantages,
disadvantages, and applications ranging from embedded and IT systems to the
Internet.
Scope

Articles addressing any area of MPP are within this special issue’s scope.
These topics are particularly welcome:

   - A review of *programming technologies* that support a MPP approach to
   system development. This could include discussions of how modern languages
   such as Ruby, Scala, F#, Oslo, etc. mix and match MPP features. Also of
   interest would be approaches for applying MPP in more established languages
   such as Java and C++.
   - *Platforms, tools, and IDEs* designed to support MPP—for example, the
   role of the Java VM and the .NET CLR as integration platforms for code
   written in multiple languages. We would like to include an analysis of the
   rise of integration, configuration, and deployment technologies that have
   become ubiquitous in MPP applications on Web frameworks, IDEs such as
   Eclipse, etc.
   - Analysis of the *advantages, disadvantages, and challenges* of MPP in
   the software development life cycle—e.g., tooling, code complexity and
   succinctness, developer proficiency and productivity, quality, and long-term
   maintenance. Guidelines for MPP with evidence of best practices and
   requirements for tooling would be useful.
   - *Examples of hybrid technologies and applications* that mix paradigms
   and/or languages—for example, articles showing how subsets of technologies
   (e.g., Web content, relational and nonrelational databases, client-server,
   domain-specific languages (DSLs), metaprogramming, modeling, assembler-level
   coding, hardware, GUI building, XML processing, code generation, and
   component assembly) can be mixed.
   - Review of the current *MPP technology landscape*: what languages and
   platforms support MPP, what features do they offer, what are they suitable
   for, and what limitations do they have.
   - *Experience reports* of developing, using, and maintaining systems
   based on multiple languages and paradigms. Particular types of systems might
   include
  - industrial and commercial applications of MPP;
  - implementing and using different languages on virtual machines
  (e.g., the JVM and .NET VM);
  - mixing languages and paradigms for multitier applications (e.g.,
  Internet and enterprise-IT systems);
  - using scripting language “layers” in applications or embedded
  systems for greater productivity and efficiency.
   - A *roadmap of challenges and directions* for language and platform
   technologies driven by the desire to support a MPP-based approach.


-- 
Dean Wampler
coauthor of Programming Scala (O'Reilly)
-  http://programmingscala.com

twitter: @deanwampler, @chicagoscala
blog: http://blog.polyglotprogramming.com
Chicago-Area Scala Enthusiasts (CASE):
-  http://groups.google.com/group/chicagoscala
-  http://www.meetup.com/chicagoscala/ (Meetings)
http://www.linkedin.com/in/deanwampler
http://www.polyglotprogramming.com
http://aquarium.rubyforge.org
http://www.contract4j.org
-- 
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 with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: Newbie question on XML processing

2010-01-07 Thread Sean Devlin
Tzach,
I'd start will clojure.xml.  At a very high level, my program would
look like this

1.  Load the xml file with clojure.xml/parse
2.  Apply your filtering code with something like map-if (see below)

(defn map-if [pred f coll]
   (map #(if (pred %) (f %) %) coll))

3.  Use clojure.contrib.prxml to output the data.

Hope this helps,
Sean

On Jan 7, 11:33 am, Tzach tzach.livya...@gmail.com wrote:
 Hello
 I have a simple task of reading an XML structure, manipulate part of
 it and writing it back to XML.
 For example, adding 1$ for each book with a year element after 2005 in
 the following example:

 ?xml version=1.0 encoding=UTF-8?
 bookstore
   book category=COOKING
     title lang=enEveryday Italian/title
     authorGiada De Laurentiis/author
     year2005/year
     price30.00/price
   /book
   book category=CHILDREN
     title lang=enHarry Potter/title
     authorJ K. Rowling/author
     year2006/year
     price29.99/price
   /book
 /bookstore

 clojure.contrib.zip-filter.xml is getting me close to this, but I
 still do not see how can I use it (or other library) to modify values.
 What would be the idiomatic (and easiest) way to do that?
 I apologize in advance if this is too trivial.

 Thanks
 Tzach
-- 
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 with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: Leiningen uberjar: excluding dev-dependencies; new minus-clojure task

2010-01-07 Thread Saul

On Jan 6, 6:07 pm, Perry Trolard trol...@gmail.com wrote:
 I suppose I could create a leiningen project for my clj script,
 specifying libraries I want as dependencies  then just putting its
 uberjar on the classpath, but this requires that the libraries are
 available in maven repos. Have other leiningen users solved this?

Have you looked at http://clojars.org ? It seems to have solved the
libraries available in maven repos problem.

Saul
-- 
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 with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: Recommended JVM flags for Clojure

2010-01-07 Thread borgees
Have you tried running with escape analysis on?  It might help take
some of the burden off the garbage collector.

-XX:+DoEscapeAnalysis

On Jan 7, 4:20 am, Gabi bugspy...@gmail.com wrote:
 Hello fellow Clojurians,

 I got lots of java.lang.OutOfMemoryError: GC overhead limit exceeded
  exceptions ,and after a short investigation added the following
 flags (JVM 1.6.0_17):
 -XX:+UseConcMarkSweepGC -XX:+CMSIncrementalMode -XX:
 +CMSIncrementalPacing

 These flags seems to solve the problem, but I am interested in your
 experience and best practices regarding JVM flags in clojure.

 I know it really depends on the type of the application, but it seems
 to me that the gc is working really hard under Clojure (I cannot prove
 it, this is just an impression)

 Gabi
-- 
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 with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: SLIME/Swank problem with swank.util.sys/get-pid and RuntimeMXBean

2010-01-07 Thread Cyrus Harmon

I agree with Steven on this. As one who uses emacs and SLIME for both common 
lisp and clojure, I'd like to be able to use the current SLIME HEAD for clojure 
development work. I consider the fact that swank-clojure and the SLIME HEAD 
don't play nicely with each other to be a deficiency of swank-clojure. It may 
be that the right fix is to fix SLIME, but I see recommending a different 
mechanism of installing SLIME (via ELPA) as the fix to be an ugly hack. My 
personal hack-fix-of-choice is to check out version 
3b3f604c396f0c5ceb8bc5a13fa41061bcc96184 from the slime git repo. It's true 
that this is fundamentally no better than what ELPA is doing, but at least I 
know what version of SLIME i need to make things work. It would be great if 
swank-clojure and/or slime were fixed so that the SLIME HEAD worked with 
swank-clojure.

I don't want to have to use ELPA, or maven, or some other configuration 
management thing to get basic tools like an editing environment for the 
language up and running. Perhaps I should just bite the bullet and use the 
crazy configuration/package management things that the clojure community seems 
so enamored of (ELPA, maven, leiningen, etc...), but in the way I'm used to 
doing things, nothing more than the source code and a fairly simple system 
definition tool (like ASDF) are enough to get things done. It's not too say 
that there's room for improvement, but I like it when simple tools get the job 
done and I don't need to rely on a bunch of shell scripts, to have to modify 
classpaths, restart JVMs, etc... to get the code I want loaded. Perhaps I'm 
just ignorant of the proper clojure-y way to do things, so I'll hop off my 
soapbox now.

cyrus


On Jan 7, 2010, at 5:38 PM, Steven E. Harris wrote:

 Phil Hagelberg p...@hagelb.org writes:
 
 Could you try installing SLIME via ELPA as recommended in the
 swank-clojure readme?
 
 That will be a project I'll have to defer until the weekend, as I've
 never used ELPA. I use the CVS SLIME almost daily for Common Lisp work,
 so I'm reluctant to give it up. Also, it's not a tenable situation to
 fork SLIME for Clojure support.
 
 CVS head is known to have introduced incompatibilities with Clojure.
 
 Is the git repository at git://git.boinkor.net/slime.git just tracking
 the CVS repository, or is that the same as the ELPA-hosted one? I did
 try all of this with the git version and found the exact same behavior
 as with the CVS version.
 
 -- 
 Steven E. Harris
 
 -- 
 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 with your 
 first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en

-- 
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 with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: [ANN] clj-peg v0.6 released

2010-01-07 Thread Michał Kwiatkowski
On Mon, Jan 4, 2010 at 11:27 PM, Richard Lyman richard.ly...@gmail.com wrote:
 This project adds support in Clojure for Parsing Expression Grammars.
 You'll be able to write pseudo-ebnfs directly in your Clojure code.

Sounds nice, but where's the source code?

Cheers,
mk
-- 
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 with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: Having difficulties with compilation in slime, emacs and clojure-project

2010-01-07 Thread Joel
Hello,
I have an emacs setup on OSX using elpa with the latest clojure-mode,
swank-clojure, slime, slime-repl all from ELPA. When I upgraded to the
latest swank-clojure in ELPA (swank-clojure-1.1.0), I began to get
this error as well:

 Searching for program: no such file or directory, lisp


I traced it back a bit, and found that the before advice on slime-read-
interactive-args wasn't being called. It apparently wasn't activated.
I evaluated the following form:
(ad-activate 'slime-read-interactive-args)

And now all seems to be working well. I'm not sure why this advice
hasn't been activated. On the prior versions of swank-clojure, I
didn't have this problem. Loading order issue maybe? Anyhow, try
explicitly activating that advice and see if that fixes your problem.

Cheers,
Joel
-- 
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 with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Interesting Clojure job in New York

2010-01-07 Thread Aaron Harnly
Hi folks,

We're looking for someone savvy with Clojuresque ways of thinking, excited by 
phrases like Monte Carlo simulation, Bayesian inference, and combinatorial 
optimization, willing to travel to New York for intense, engaging work, and 
(we hope!) motivated by an interest in education, cognition or just a 
satisfying problem. I come from the Scala side of the object/typing fence 
through the functional-Java countryside — but I come in peace. 

We, a well-established but fast-growing educational technology company, have a 
very cool medium-term (three-to-six-month) project calling for an excellent 
developer. (Of course there's the possibility of staying on for more.) Please 
contact me if you find such things interesting and would like to tell or hear 
more.

~aaron
Aaron Harnly
Wireless Generation
http://www.wirelessgeneration.com


-- 
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 with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: Probability Monad

2010-01-07 Thread joel r
Hi,

I'm new to monads in clojure, and I'm loving them, they're really awesome!

But right now I need some help. Either I'm using dist-m wrong, or it's
a bug I've found.

It can be reproduced with:
clojure commit f4c58e3500b3668a0941ca21f9aa4f444de2c652
clojure-contrib commit 25fec5b5771408c30b802b67dc14a15043446a12

Both commits are for the master branch. These are the latest versions
of clojure and clojure-contrib sources that I just pulled this
morning.

This code doesn't work:

(use 'clojure.contrib.monads)
(use 'clojure.contrib.probabilities.finite-distributions)

(def die (uniform [1 2 3 4 5 6]))

(domonad dist-m
[a die
b die]
[+ a b])

The error that I get:

java.lang.ClassCastException: java.lang.Integer cannot be cast to
java.util.Map$Entry
  [Thrown class java.lang.RuntimeException]

Restarts:
 0: [ABORT] Return to SLIME's top level.
 1: [CAUSE] Throw cause of this exception

Backtrace:
  0: clojure.lang.LazySeq.sval(LazySeq.java:47)
  1: clojure.lang.LazySeq.seq(LazySeq.java:56)
  2: clojure.lang.RT.seq(RT.java:440)
  3: clojure.core$seq__4245.invoke(core.clj:105)
  4: clojure.core$reduce__4500.invoke(core.clj:657)
  5: 
clojure.contrib.probabilities.finite_distributions$fn__6616$m_bind_dist__6620.invoke(finite_distributions.clj:36)
  6: user$eval__97.invoke(NO_SOURCE_FILE:1)
  7: clojure.lang.Compiler.eval(Compiler.java:4642)
  8: clojure.core$eval__5236.invoke(core.clj:2017)
  9: swank.commands.basic$eval_region__22.invoke(basic.clj:40)
 10: swank.commands.basic$eval_region__22.invoke(basic.clj:31)
 11: swank.commands.basic$listener_eval__36.invoke(basic.clj:54)
 12: clojure.lang.Var.invoke(Var.java:359)
 13: user$eval__94.invoke(NO_SOURCE_FILE)
 14: clojure.lang.Compiler.eval(Compiler.java:4642)
 15: clojure.core$eval__5236.invoke(core.clj:2017)
 16: swank.core$eval_in_emacs_package__249.invoke(core.clj:59)
 17: swank.core$eval_for_emacs__326.invoke(core.clj:128)
 18: clojure.lang.Var.invoke(Var.java:367)
 19: clojure.lang.AFn.applyToHelper(AFn.java:179)
 20: clojure.lang.Var.applyTo(Var.java:476)
 21: clojure.core$apply__4370.invoke(core.clj:436)
 22: swank.core$eval_from_control__252.invoke(core.clj:66)
 23: swank.core$eval_loop__255.invoke(core.clj:71)
 24: swank.core$spawn_repl_thread__387$fn__418$fn__420.invoke(core.clj:183)
 25: clojure.lang.AFn.applyToHelper(AFn.java:171)
 26: clojure.lang.AFn.applyTo(AFn.java:164)
 27: clojure.core$apply__4370.invoke(core.clj:436)
 28: swank.core$spawn_repl_thread__387$fn__418.doInvoke(core.clj:180)
 29: clojure.lang.RestFn.invoke(RestFn.java:402)
 30: clojure.lang.AFn.run(AFn.java:37)
 31: java.lang.Thread.run(Thread.java:619)

If I'm using dist-m correctly, I figured the reason might be that
m-bind uses merge-with to merge a collection of vectors, whereas
merge-with works with maps..?

I tried (merge-with + [:a 1] [:b 1]) and got a similar error:

clojure.lang.Keyword cannot be cast to java.util.Map$Entry
  [Thrown class java.lang.ClassCastException]

Restarts:
 0: [ABORT] Return to SLIME's top level.

Backtrace:
  0: clojure.core$key__4739.invoke(core.clj:1036)
  1: clojure.core$merge_with__5186$merge_entry__5188.invoke(core.clj:1932)
  2: clojure.lang.ArrayChunk.reduce(ArrayChunk.java:50)
  3: clojure.core$reduce__4500.invoke(core.clj:666)
  4: clojure.core$merge_with__5186$merge2__5191.invoke(core.clj:1937)
  5: clojure.core$reduce__4500.invoke(core.clj:668)
  6: clojure.core$reduce__4500.invoke(core.clj:659)
  7: clojure.core$merge_with__5186.doInvoke(core.clj:1938)
  8: clojure.lang.RestFn.invoke(RestFn.java:443)
  9: user$eval__140.invoke(NO_SOURCE_FILE:1)
snip

I modified dist-m to evaluate a map instead of a vector, like this:

(defmonad dist2-m
  [m-result (fn m-result-dist [v]
  {v 1})
   m-bind   (fn m-bind-dist [mv f]
  (reduce (partial merge-with +)
  (for [[x p] mv  [y q] (f x)]
{y (* q p)})))
   ])

And now this code:

(domonad dist2-m
   [a die
   b die]
   (+ a b))

yields:

{2 1/36, 3 1/18, 4 1/12, 5 1/9, 6 5/36, 7 1/6, 8 5/36, 9 1/9, 10 1/12,
11 1/18, 12 1/36}

as expected.

Perhaps there's something I'm missing here?

Thanks,

Joel Rosario.
-- 
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 with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: SLIME/Swank problem with swank.util.sys/get-pid and RuntimeMXBean

2010-01-07 Thread Richard Newman
I don't want to have to use ELPA, or maven, or some other  
configuration management thing to get basic tools like an editing  
environment for the language up and running. Perhaps I should just  
bite the bullet and use the crazy configuration/package management  
things that the clojure community seems so enamored of (ELPA, maven,  
leiningen, etc...), but in the way I'm used to doing things, nothing  
more than the source code and a fairly simple system definition tool  
(like ASDF) are enough to get things done. It's not too say that  
there's room for improvement, but I like it when simple tools get  
the job done and I don't need to rely on a bunch of shell scripts,  
to have to modify classpaths, restart JVMs, etc... to get the code I  
want loaded. Perhaps I'm just ignorant of the proper clojure-y way  
to do things, so I'll hop off my soapbox now.


I think I'm pretty familiar with the Clojure-y way to do things, and I  
also close the tab when I see ... using Maven.


My setup is:

* Installing some trivial Emacs stuff through ELPA (but not all: e.g.,  
some packages fail to build). I'm a recent Emacs convert, so this  
seemed easy.

* Building swank-clojure myself.
* Installing the Emacs side myself the old-fashioned way.
* Storing my stuff in git.
* Building jars using ant.
* Launching the appropriate swank server with the right classpath  
using a generic 'swank-clj' script that understands the same .clojure  
files as my 'clj' script.


No Maven, little ELPA, no Clojure project-building scripts, nothing  
swank-related configured through emacs. I don't like libraries which  
want to download their own dependency jars: most projects on which I  
work integrate at least a dozen libraries, many of which share  
dependencies (Commons Logging, for example), and I inevitably need to  
manage those myself. Neither do I want a tool to download a Clojure  
jar for me: I manage that myself, because I want to keep up-to-date,  
and I need to maintain patches against contrib.


Every time I've tried to use Maven I've given up in disgust as it  
downloaded hundreds of megs of jars I already had, and didn't want to  
have to manually re-package for my company's existing deployment  
infrastructure.


Ah, Java.
-- 
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 with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en