Re: Sequential vs. "divide and conquer" algorithm

2010-03-21 Thread Jarkko Oranen


On Mar 19, 6:53 pm, Andrzej  wrote:
> I've been toying with various implementations of reduce-like
> functions, trying to do something "smarter" than a simple iteration
> over a collection of data. This hasn't worked out very well, my
> implementation is a lot (~50x) slower than a simple loop. Could anyone
> point out any bottlenecks in this algorithm and advise me on possible
> ways of improving it?

Rich has done some work on using the JDK7 ForkJoin Library to
parallelise map and reduce over vectors, since they are already
internally structured as trees. It hasn't been touched in a while, but
as far as I know the code lives in the 'par' branch of the clojure
repository, and works with JDK6 if you install an additional jar.

-- 
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

To unsubscribe from this group, send email to 
clojure+unsubscribegooglegroups.com or reply to this email with the words 
"REMOVE ME" as the subject.


Re: Swank, ELPA and Emacs version do you use?

2010-03-21 Thread Rob Wolfe
alux  writes:

> Okay. So I switched to version 23.1. that had already been installed.
> AFAIK it uses all the things I installed the last days. Or do I have
> to update some other stuff?

I tried to put together all steps needed to install SLIME
for Clojure using ELPA:
http://wiki.github.com/robwolfe/leiningen/clojure-with-emacs-and-slimeswank

You can find there information how to check whether all needed
pieces have been installed in the right place.

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

To unsubscribe from this group, send email to 
clojure+unsubscribegooglegroups.com or reply to this email with the words 
"REMOVE ME" as the subject.


Re: Sequential vs. "divide and conquer" algorithm

2010-03-21 Thread Andrzej
On Sun, Mar 21, 2010 at 6:37 PM, Jarkko Oranen  wrote:
>
> Rich has done some work on using the JDK7 ForkJoin Library to
> parallelise map and reduce over vectors, since they are already
> internally structured as trees. It hasn't been touched in a while, but
> as far as I know the code lives in the 'par' branch of the clojure
> repository, and works with JDK6 if you install an additional jar.

Thank you. I'll keep an eye on it.

Yesterday I looked at the implementation of the PersistentVector
class, trying to figure out how to exploit its internal structure to
decompose the vector. I hit several issues though:

1. The trees are not balanced. So in order to split the vector roughly
in half one would have to deal with the root node _and_ nodes at one
level below it.
2. Node structure doesn't have a "cnt" field but PersistentVector
does. When splitting the vector, length of each part would have to be
calculated, which could be costly. Assuming there are no holes in the
tree it might be enough to look at the depth of the tree and the
number of fully occupied slices in the root node.
3. Apparently PersistentVector doesn't allow an empty tail array (for
lenghts > 0). I.e. tail can have a length of 1 to 32. This would have
to be changed (i.e. 0 to 31) if the partitioning is going to work
fast.
4. Should partitioning stop once the vector is destructured down to a
single chunk (32 values)? Destructuring vectors to single values would
be more convenient to use but would only add overhead without any
reduction in the access time.
5. With all this we can get subvectors with very fast access times
_but_ the destructuring process itself can still trigger a lot of
allocation (each subvector needs at least one new node - a root). So
I'm not sure whether this would give any net performance gain, perhaps
not.

Andrzej

-- 
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

To unsubscribe from this group, send email to 
clojure+unsubscribegooglegroups.com or reply to this email with the words 
"REMOVE ME" as the subject.


Re: How to use Clojure with Robocode

2010-03-21 Thread ubolonton
On Mar 19, 8:19 pm, Jeff Foster  wrote:
> Could you post the source code?
This is the Clojure code

(ns ubolonton.MyRobot
  (:gen-class :extends robocode.Robot))
(defn -run
  [robot]
  (doto robot
(.ahead 100)
(.turnGunRight 360)
(.back  100))
(.turnGunRight 360)
  (recur robot))
(defn -onScannedRobot
  [robot event]
  (doto robot
(.fire 1)))

It should be equivalent to this Java code

public class MyRobot extends Robot
{
public void run() {
while(true) {
ahead(100);
turnGunRight(360);
back(100);
turnGunRight(360);
}
}
public void onScannedRobot(ScannedRobotEvent e) {
fire(1);
}
}

I think Robocode uses ClassLoader to create instances of Robot, which
does not work with classes generated by gen-class

-- 
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

To unsubscribe from this group, send email to 
clojure+unsubscribegooglegroups.com or reply to this email with the words 
"REMOVE ME" as the subject.


Re: How to use Clojure with Robocode

2010-03-21 Thread ubolonton


On Mar 20, 9:46 pm, "Heinz N. Gies"  wrote:
> Hi,
> I hope that in a week or two I am able to release a 'mini game' as a tech 
> demo for something some friends and me are working on, if you're interested 
> in Robocode you might like it. It will be a tournament game where two fleets 
> fight each other. The user will be able to assemble the ships from different 
> modules and script their AI giving them a high level of customizability. Let 
> me know if you're interesting, I'll be offering a few beta logins on the list 
> too :) (the game will be 100% free and open source (at least at some point), 
> no advertising or anything).
I'll be very interested if it's in 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
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

To unsubscribe from this group, send email to 
clojure+unsubscribegooglegroups.com or reply to this email with the words 
"REMOVE ME" as the subject.


Re: Maven clojure:repl

2010-03-21 Thread Mark Derricutt
The plugin is in central, tho you need to declare it in your project as
outlined in the README:


  
com.theoryinpractise
clojure-maven-plugin
1.3.2
  



-- 
Pull me down under...

On Sun, Mar 21, 2010 at 4:55 AM, alux  wrote:

> Well, so I hope there is THE plugin, and not some plugins, and try the
> first google shows:
>
> git clone git://github.com/talios/clojure-maven-plugin
>
> cd clojure-maven-plugin
>
> mvn install
>

-- 
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

To unsubscribe from this group, send email to 
clojure+unsubscribegooglegroups.com or reply to this email with the words 
"REMOVE ME" as the subject.


Re: indexing only some elements of a sequence...

2010-03-21 Thread Douglas Philips

On 2010 Mar 20, at 10:40 AM, Steve Purcell wrote:


Which looks the same as clojure.contrib.seq/reductions to me...



On 20 Mar 2010, at 13:54, Per Vognsen wrote:


Learn to love scan: http://gist.github.com/338682


Thanks Per and Steve! I knew there was catch that I wasn't seeing.
I did see reductions in seq-util (I am using 1.1), but it didn't click.

Not going to get in the middle of what names should be what.

-Doug

--
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

To unsubscribe from this group, send email to clojure+unsubscribegooglegroups.com or 
reply to this email with the words "REMOVE ME" as the subject.


Check my idioms?

2010-03-21 Thread Mark J. Reed
(I'd say something about my own particular idiom, but that's more of a
Python thing.)

Anyway, new to Clojure but not to Lisp or Java.  Writing something to
interoperate with some Perl code that stores a hash in a simple flat
file syntax:

key1value1key2value2...

sorted on the keys.

These are my load and save routines; the load has nothing to handle
misformatted files yet, but I'm just looking to get a feel for
idiomatic Clojure.  Do these look reasonable?  The save routine feels
a little clunky to me.

(defn load-map [filename]
(apply sorted-map (re-seq #"[^\n\t]+" (slurp filename

(defn save-map [the-map filename]
(doto (java.io.FileWriter. filename)
(.write (apply str (interleave (apply concat (seq the-map)
(cycle "\t\n" (.close)))

-- 
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

To unsubscribe from this group, send email to 
clojure+unsubscribegooglegroups.com or reply to this email with the words 
"REMOVE ME" as the subject.


General question: Petri nets and STM in clojure

2010-03-21 Thread Ryan Teo (SG)
Hi everyone,
  I just chanced upon Petri nets and struggling to understand the
theory. However, a knowledge of it seems to help design concurrent
systems and provide a theoretical basis for the points raised by Rich
in the explanation of how time is derived from local causality.

  I think it's somewhat clearer to understand transactions by
referring to slide 14 of this presentation:
http://www.cs.kent.ac.uk/people/staff/cr3/talks/petri.pdf
  http://www.cs.kent.ac.uk/people/staff/cr3/talks/#PetriNets

  Feedback?

Ryan
New to FP and clojure, happy to learn

-- 
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

To unsubscribe from this group, send email to 
clojure+unsubscribegooglegroups.com or reply to this email with the words 
"REMOVE ME" as the subject.


Clojure and JMS - Sample program

2010-03-21 Thread jsrodrigues
I wrote this program to help me explore and understand JMS-Queue
(javax.jms.Queue). I was working with OpenJMS which comes bundled with
the GlassFish application server (running on Windows). In addition to
installing JDK-EE 1.5+GlassFish, you will need to include the
following jars in your Clojure classpath, to get this program to work:

set ssdk_lib=C:\Sun\SDK\lib
set jms_lib=%ssdk_lib%\install\applications\jmsra\imqjmsra.jar;
%ssdk_lib%\appserv-rt.jar;%ssdk_lib%\javaee.jar;%ssdk_lib%\appserv-
admin.jar

You will also need to define the following JMS resources -
"QueueConnectionFactory"(javax.jms.QueueConnectionFactory) and
"TestQueue" (javax.jms.Queue). I call the main function this way:
user=> (jms.jms-test/main)

Next, I will be writing some more code to understand JMS-Topic
(javax.jms.Topic). I will post that as well.

Regards,
John

Here is the code:

(ns jms.jms-test
  (:import (javax.naming InitialContext))
  (:import (java.util Properties))
  (:import (javax.jms Session QueueRequestor
  MessageListener)))

(defn get-initial-context []
  (let [props (Properties.)]
(doto props
  (. setProperty "java.naming.factory.initial"
 "com.sun.enterprise.naming.SerialInitContextFactory")
  (. setProperty "org.omg.CORBA.ORBInitialHost"
 "localhost")
  (. setProperty "org.omg.CORBA.ORBInitialPort"
 "3700"))
(InitialContext. props)))

(defn get-message-text []
  (format "This is a test message: %d" (rand-int (int (* (rand)
1)

(defn send-message-to-queue [qSender qSession]
  (let [message (.createTextMessage qSession)]
(.setText message (get-message-text))
(.send qSender message)))

(defn send-term-message-to-queue [qSender qSession]
  (.send qSender (.createMessage qSession)))

(defn send-n-messages-to-queue [qSender qSession num-messages]
  (loop [n num-messages]
(if (zero? n)
  (do
(send-term-message-to-queue qSender qSession)
(println "*Done putting messages on queue!*"))
  (recur (do
   (send-message-to-queue qSender qSession)
   (dec n))

(defn process-queue-messages [qReceiver qConnection]
  (let [done-processing (ref false)]
(.setMessageListener qReceiver
 (proxy [MessageListener][]
   (onMessage [message]
  (if (instance?
javax.jms.TextMessage message)
(println (format "Read
message: %s" (.getText message)))
(dosync (ref-set done-
processing true))
(.start qConnection)
(while (false? @done-processing)
   (Thread/sleep 1000)))
  (.close qConnection)
  (println "==Read all messages off the queue!!=="))

(defn main []
  (let [ctx (get-initial-context)
qConFactory (.lookup ctx "QueueConnectionFactory")
qConnection (.createQueueConnection qConFactory)
qSession (.createQueueSession qConnection false Session/
AUTO_ACKNOWLEDGE)
queue (.createQueue qSession "TestQueue")
qSender (.createSender qSession queue)
qReceiver (.createReceiver qSession queue)]
(.start (Thread. (fn[] (send-n-messages-to-queue qSender qSession
10
(.start (Thread. (fn[] (process-queue-messages qReceiver
qConnection))

-- 
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

To unsubscribe from this group, send email to 
clojure+unsubscribegooglegroups.com or reply to this email with the words 
"REMOVE ME" as the subject.


Re: Maven clojure:repl

2010-03-21 Thread alux
Thank you Mark,

now I get two new problems.
(I'm still in the testproject, not in incanter.)

clojure:repl
The REPL starts. Now when I type something in, it is not echoed until
I hit enter. So I have to use the REPL blind. Difficult.

clojure:swank
This has already been described as a windows problem somewhere, but I
didnt find a sollution I understood, still.
..
[INFO] [compiler:compile {execution: default-compile}]
[INFO] No sources to compile
[INFO] [clojure:swank {execution: default-cli}]
WARNING: reader macro ^ is deprecated; use meta instead
WARNING: reader macro ^ is deprecated; use meta instead
WARNING: reader macro ^ is deprecated; use meta instead
WARNING: reader macro ^ is deprecated; use meta instead
WARNING: reader macro ^ is deprecated; use meta instead
WARNING: reader macro ^ is deprecated; use meta instead
WARNING: reader macro ^ is deprecated; use meta instead
WARNING: reader macro ^ is deprecated; use meta instead
WARNING: reader macro ^ is deprecated; use meta instead
Exception in thread "main" clojure.lang.LispReader$ReaderException:
java.lang.Nu
mberFormatException: Invalid number: 2009-09-14
at clojure.lang.LispReader.read(LispReader.java:180)
at clojure.core$read__5425.invoke(core.clj:2385)
at clojure.core$read__5425.invoke(core.clj:2383)
at clojure.main$eval_opt__7411.invoke(main.clj:225)
..

I found the date 2009-09-14 in PLUGIN.XML

The complete line is
${clojure.swank.protocolVersion}

But I actually dont understand where this file and date comes from. I
dont see it in the source tree of the plugin.

Thanks for the help and greetings,

alux


Mark Derricutt schrieb:
> The plugin is in central, tho you need to declare it in your project as
> outlined in the README:
>
> 
>   
> com.theoryinpractise
> clojure-maven-plugin
> 1.3.2
>   
> 
>
>
> --
> Pull me down under...
>
> On Sun, Mar 21, 2010 at 4:55 AM, alux  wrote:
>
> > Well, so I hope there is THE plugin, and not some plugins, and try the
> > first google shows:
> >
> > git clone git://github.com/talios/clojure-maven-plugin
> >
> > cd clojure-maven-plugin
> >
> > mvn install
> >

-- 
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

To unsubscribe from this group, send email to 
clojure+unsubscribegooglegroups.com or reply to this email with the words 
"REMOVE ME" as the subject.


Re: Check my idioms?

2010-03-21 Thread Justin Kramer
Check out clojure.contrib.io (Clojure 1.2) or clojure.contrib.duck-
streams (Clojure 1.1):

(use 'clojure.contrib.io)
(defn save-map [f m]
  (write-lines f (for [[k v] m] (str k \tab v

Or, using your code...

(defn save-map [f m]
  (spit f (apply str (interleave (apply concat m) (cycle "\t\n")


Justin

On Mar 20, 8:22 pm, "Mark J. Reed"  wrote:
> (I'd say something about my own particular idiom, but that's more of a
> Python thing.)
>
> Anyway, new to Clojure but not to Lisp or Java.  Writing something to
> interoperate with some Perl code that stores a hash in a simple flat
> file syntax:
>
> key1value1key2value2...
>
> sorted on the keys.
>
> These are my load and save routines; the load has nothing to handle
> misformatted files yet, but I'm just looking to get a feel for
> idiomatic Clojure.  Do these look reasonable?  The save routine feels
> a little clunky to me.
>
> (defn load-map [filename]
>     (apply sorted-map (re-seq #"[^\n\t]+" (slurp filename
>
> (defn save-map [the-map filename]
>     (doto (java.io.FileWriter. filename)
>         (.write (apply str (interleave (apply concat (seq the-map)
> (cycle "\t\n" (.close)))

-- 
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

To unsubscribe from this group, send email to 
clojure+unsubscribegooglegroups.com or reply to this email with the words 
"REMOVE ME" as the subject.


Re: Swank, ELPA and Emacs version do you use?

2010-03-21 Thread alux
Thank you Rob, emacs and slime already works if kept for semselves.
What doesnt work is the maven integration, so I can start the swank
server in a certain project.

Regards, alux

Rob Wolfe schrieb:
> alux  writes:
>
> > Okay. So I switched to version 23.1. that had already been installed.
> > AFAIK it uses all the things I installed the last days. Or do I have
> > to update some other stuff?
>
> I tried to put together all steps needed to install SLIME
> for Clojure using ELPA:
> http://wiki.github.com/robwolfe/leiningen/clojure-with-emacs-and-slimeswank
>
> You can find there information how to check whether all needed
> pieces have been installed in the right place.
>
> 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

To unsubscribe from this group, send email to 
clojure+unsubscribegooglegroups.com or reply to this email with the words 
"REMOVE ME" as the subject.


Re: separating ui and content in clojure

2010-03-21 Thread Josh Stratton
An atom seems appropriate after reading up on it, but documentation
seems a little scarce.  Reading about atoms on the clojure site gives
a very small example using just a {}.  I've tried piecing it together
using a struct but am getting

Exception in thread "main" java.lang.IllegalArgumentException: Key
must be integer (start.clj:0)

Can atoms be only certain types?

let [context (atom (create-context))] ; create-context returns a context object
  (def canvas0 (create-canvas 0 context)) ; passing the atomized
context to a struct
  )


On Sat, Mar 20, 2010 at 8:51 AM, Mike Meyer
 wrote:
> On Sat, 20 Mar 2010 08:11:49 -0700 (PDT)
> strattonbrazil  wrote:
>
>> I'd like to separate my ui Swing/JOGL from the content, so my code is
>> relatively unaware of the UI around it.  For example, I create a
>> global context that holds on my content.  I then make a UI that when
>> the user does some interaction like a mouse click or drag, the UI
>> creates a new context.  My OO instincts would be to create a context
>> and pass it to all my UI objects that receive events and mutate them,
>> but if I'm dealing with an immutable class if I pass it to each UI
>> object, when one UI object makes a new context, it isn't reflected in
>> the other UIs.  Basically I want all UIs pointing to the same context
>> and each UI being able to create a new context that each UI points
>> to.  It seems that when one UI updates the global context reference
>> with a 'def', the others are still using the old one.
>
> You need to update shared data, and that doesn't seem avoidable. In
> clojure, you do that with either a ref or an atom holding the data,
> depending on how you need to update it. This will make it thread safe
> if/when you start running your UI objects in different threads.
>
>     
> --
> Mike Meyer               http://www.mired.org/consulting.html
> Independent Network/Unix/Perforce consultant, email for more information.
>
> O< ascii ribbon campaign - stop html mail - www.asciiribbon.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
>
> To unsubscribe from this group, send email to 
> clojure+unsubscribegooglegroups.com or reply to this email with the words 
> "REMOVE ME" as the subject.
>

-- 
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

To unsubscribe from this group, send email to 
clojure+unsubscribegooglegroups.com or reply to this email with the words 
"REMOVE ME" as the subject.


Re: Maven clojure:repl

2010-03-21 Thread Stuart Sierra
On Mar 20, 7:56 am, alux  wrote:
> mvn clojure:repl
>
> But that doesnt work.
>
> [ERROR] BUILD ERROR
> [INFO]
> 
> [INFO] The plugin 'org.apache.maven.plugins:maven-clojure-plugin' does
> not exist

Those instructions appear to be out-of-date for Incanter's current
source repository.  The Clojure Maven plugin is not specified as a
plugin by the top-level pom.xml.  This may be a bug to take up with
the Incanter developers.

-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

To unsubscribe from this group, send email to 
clojure+unsubscribegooglegroups.com or reply to this email with the words 
"REMOVE ME" as the subject.


Why I have chosen not to employ clojure

2010-03-21 Thread Tim Johnson
I have evaluated clojure for the last couple of days, and it is both my own
professional decision and my recommendation to the professional organizations
that I belong to and report to that clojure is not ready for prime time.

Before any of you think that I am a disgruntled newbie turned troll, know 
the following:

1)As soon as I see the copy of this email in my "clojure mailbox", I will
unsubscribe from this mailing list, delete the clojure mailbox and I will not
be following up in any way.

2)In as much as clojure is a new programming language with a small but
enthusiastic user base and a brilliant developer I confess to a certain deja vu
here. That would be rebol 10 years ago. Brilliantly conceived, brilliantly
designed by one of the best programmers on the planet. Never went anywhere.
I've used rebol for 10 years steadily and made a lot of money with it, but
there is almost 0 demand for rebol programmers out there.

3)Although I may be a noob with it comes to clojure and even more of a noob
when it comes to java, I have been a professional analyst and programmer for 21
years and own my own company. Many seasoned programmers, analysts and system
adminstrators look at a new system as something to "employ". As a front end for
java, I do not consider clojure to be "employable". 

I think that clojure is brilliantly conceived and it is clear from what I have
read of Rich Hickey's words that his vision is right in the same channel with
mine, but that is not the problem. The fact that I respect the developer and
the product is the reason that I have taken this time to write this email.

The reason I choose NOT to employ clojure can be summed up in three words.
---
Install and deploy. 
---

I consider this to be clojure's fatal weakness. Certainly I can get clojure up
and running, but "selling" clojure to a sysadmin is going to be a problem at
this time. There was a time when PHP was NOT present on virtually all 
webservers.
PHP got it's "foot in the door" because it was very easy to deploy.

Consider the two threads that I started up - one is titled "Web programming in
Clojure" - there's the good stuff. Generous reponse, lots of input. 

The other one is titled "Installation issues on slack 13.0 (ant?)". This where
it all falls apart. 

Sadly, this is like the first impression and we all know how lasting first
impressions are. In fact as you can see, the thread ended with no resolution.
I'm sorry to pick on "steve" but his response is a case study

* Steve  [100320 05:24]:
> Reading the getting started page on the website will get you further
> still : http://clojure.org/getting_started

Sadly inadequate! Check out the comparable kawa resources and instructions for
a better example.

> If you do need ant then a more modern distro will make your life much
> easier (eg. apt-get install ant).

Again, so inadequate. I also use ubuntu. Have for years. apt-get is a thing
of beauty. When it works. And bye the way, slackware is much more modern
when it comes to up-to-date build tools. So know I not only have to "sell"
clojure to the sysadmins, I have to sell them ubuntu too? Good luck with
that!

Here's how I installed the flash player on my system.
1)Downloaded install_flash_player_10_linux.tar.gz
2)Unzipped libflashplayer.so
3)Copied to /usr/lib/firefox-3.5.2/plugins/

Make clojure "install and deployment" like the example above and more of us will
EMPLOY clojure and 10 years from now there WILL be a market for clojure
programmers.

Goodby and good luck.
-- 
Tim 
t...@johnsons-web.com
http://www.akwebsoft.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

To unsubscribe from this group, send email to 
clojure+unsubscribegooglegroups.com or reply to this email with the words 
"REMOVE ME" as the subject.


Re: Why I have chosen not to employ clojure

2010-03-21 Thread Fogus
> 1)As soon as I see the copy of this email in my "clojure mailbox", I will
> unsubscribe from this mailing list, delete the clojure mailbox and I will not
> be following up in any way.

Really?  This is not c.l.l and it's not likely that this thread would
have devolved into flaming or worse.  It's unfortunate he feels the
need to take such an extreme measure because I didn't read his post as
a troll and felt that a dialog about his issues might have been
enlightening.

-- 
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

To unsubscribe from this group, send email to 
clojure+unsubscribegooglegroups.com or reply to this email with the words 
"REMOVE ME" as the subject.


Re: Maven clojure:repl

2010-03-21 Thread alux
Hello Stuart,

yes, thats not in. I'm not enough into maven to know where the plugins
have to be specified. I had the hope that maven searches its
repository, when I call a specific goal of the form xxx:yyy - so this
hope was in vain?

Thank you for the comment.

Regards, alux


Stuart Sierra schrieb:
> On Mar 20, 7:56 am, alux  wrote:
> > mvn clojure:repl
> >
> > But that doesnt work.
> >
> > [ERROR] BUILD ERROR
> > [INFO]
> > 
> > [INFO] The plugin 'org.apache.maven.plugins:maven-clojure-plugin' does
> > not exist
>
> Those instructions appear to be out-of-date for Incanter's current
> source repository.  The Clojure Maven plugin is not specified as a
> plugin by the top-level pom.xml.  This may be a bug to take up with
> the Incanter developers.
>
> -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

To unsubscribe from this group, send email to 
clojure+unsubscribegooglegroups.com or reply to this email with the words 
"REMOVE ME" as the subject.


Question about overriding print-method for deftypes

2010-03-21 Thread Mark Engelberg
Consider the following deftype:
(deftype Piece [#^int number #^char letter])

(def piece (Piece 1 \A))

Now, when I evaluate piece at the REPL, I want it to print:
1A
rather than
#:Piece{:number 1, :letter \A}

similarly, I would like (str piece) to yield "1A".

A while back, I was told on this list that the key to this was to override
print-method, but I can't quite figure out how to do it:

(defmethod clojure.core/print-method ::Piece [piece writer] ???what goes
here???)

I have tried things like:
(defmethod clojure.core/print-method ::Piece [piece writer] (do (pr (:number
piece) writer) (pr (:letter piece) writer)))
but it doesn't work.

What's the trick?  Thanks,

Mark

-- 
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

To unsubscribe from this group, send email to 
clojure+unsubscribegooglegroups.com or reply to this email with the words 
"REMOVE ME" as the subject.


Question about overriding print-method for deftypes

2010-03-21 Thread Mark Engelberg
Consider the following deftype:
(deftype Piece [#^int number #^char letter])

(def piece (Piece 1 \A))

Now, when I evaluate piece at the REPL, I want it to print:
1A
rather than
#:Piece{:number 1, :letter \A}

similarly, I would like (str piece) to yield "1A".

A while back, I was told on this list that the key to this was to override
print-method, but I can't quite figure out how to do it:

(defmethod clojure.core/print-method ::Piece [piece writer] ???what goes
here???)

I have tried things like:
(defmethod clojure.core/print-method ::Piece [piece writer] (do (pr (:number
piece) writer) (pr (:letter piece) writer)))
but it doesn't work.

What's the trick?  Thanks,

Mark

-- 
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

To unsubscribe from this group, send email to 
clojure+unsubscribegooglegroups.com or reply to this email with the words 
"REMOVE ME" as the subject.


Re: Question about overriding print-method for deftypes

2010-03-21 Thread Michał Marczyk
On 21 March 2010 20:10, Mark Engelberg  wrote:
> I have tried things like:
> (defmethod clojure.core/print-method ::Piece [piece writer] (do (pr (:number
> piece) writer) (pr (:letter piece) writer)))
> but it doesn't work.

You need to replace pr with print-method inside the do. pr doesn't
accept the writer argument.

That'll only take are of printing, though; I'm not sure if there is a
way to override .toString on a deftype, since I believe that's a
method of the Object class and not an interface/protocol... :-(

All the best,
Michał

-- 
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

To unsubscribe from this group, send email to 
clojure+unsubscribegooglegroups.com or reply to this email with the words 
"REMOVE ME" as the subject.


Re: For loop question

2010-03-21 Thread Michał Marczyk
On 20 March 2010 17:17, David Nolen  wrote:
> You can do what you want with the following:
>
> (doseq [[x y] (for [y (range 4) x (range 4)] [x y])]
>   (println x y))

Or just

(doseq [y (range 4)
x (range 4)]
  (println x y))

doseq really has exactly the same syntax as for (including support for
multiple variable name / input sequence pairs and :let, :when, :while)
and employs the same "looping order".

:-)

Michał

-- 
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

To unsubscribe from this group, send email to 
clojure+unsubscribegooglegroups.com or reply to this email with the words 
"REMOVE ME" as the subject.


Re: Question about overriding print-method for deftypes

2010-03-21 Thread Fogus
> (defmethod clojure.core/print-method ::Piece [piece writer] ???what goes
> here???)

(defmethod clojure.core/print-method ::Piece
  [piece writer]
  (.write writer (str (:number piece) (:letter piece)) 0 2))

Extending Piece to provide a str method can replace that ugly bit in
the middle.
-m

-- 
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

To unsubscribe from this group, send email to 
clojure+unsubscribegooglegroups.com or reply to this email with the words 
"REMOVE ME" as the subject.


Re: Question about overriding print-method for deftypes

2010-03-21 Thread Mark Engelberg
Speaking of overriding methods, what am I doing wrong here:
(deftype Piece [#^int number #^char letter]
  Comparable
  (compareTo [x y]
(let [c1 (compare (:number x) (:number y))]
  (if (zero? c1) (compare (:letter x) (:letter y)) c1

What other interesting things can be overridden for a deftype?


On Sun, Mar 21, 2010 at 12:34 PM, Fogus  wrote:

> > (defmethod clojure.core/print-method ::Piece [piece writer] ???what goes
> > here???)
>
> (defmethod clojure.core/print-method ::Piece
>  [piece writer]
>   (.write writer (str (:number piece) (:letter piece)) 0 2))
>
> Extending Piece to provide a str method can replace that ugly bit in
> the middle.
> -m
>

-- 
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

To unsubscribe from this group, send email to 
clojure+unsubscribegooglegroups.com or reply to this email with the words 
"REMOVE ME" as the subject.


Re: Question about overriding print-method for deftypes

2010-03-21 Thread Michał Marczyk
On 21 March 2010 20:34, Fogus  wrote:
> Extending Piece to provide a str method can replace that ugly bit in
> the middle.

But how would one go about that? str calls .toString on its arguments,
which is in turn a method of Object, thus not present in any
interface, whereas deftype / extend only allow one to implement
interface or protocol methods...

Sincerely,
Michał

-- 
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

To unsubscribe from this group, send email to 
clojure+unsubscribegooglegroups.com or reply to this email with the words 
"REMOVE ME" as the subject.


Re: Question about overriding print-method for deftypes

2010-03-21 Thread Michał Marczyk
On 21 March 2010 20:40, Mark Engelberg  wrote:
> Speaking of overriding methods, what am I doing wrong here:
> (deftype Piece [#^int number #^char letter]
>   Comparable
>   (compareTo [x y]
>     (let [c1 (compare (:number x) (:number y))]
>   (if (zero? c1) (compare (:letter x) (:letter y)) c1

deftype expects method definitions *not* to accept an explicit "self"
argument. You need to do something like this instead:

(deftype Piece [#^int number #^char letter]
  Comparable
  (compareTo
   [x]
   (let [c1 (compare number (:number x))]
 (if (zero? c1) (compare letter (:letter x)) c1

Note that own fields can be accessed by name. If you do need a "self"
argument, you can create an implicit self available to all method
bodies by passing

:as some-symbol

to the deftype right after the fields vector.

Sincerely,
Michał

-- 
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

To unsubscribe from this group, send email to 
clojure+unsubscribegooglegroups.com or reply to this email with the words 
"REMOVE ME" as the subject.


Re: Swank, ELPA and Emacs version do you use?

2010-03-21 Thread Cosmin Stejerean
On Sat, Mar 20, 2010 at 2:46 PM, alux  wrote:

> Sorry to have so many questions.
>
> I lookes at swank at github, it says it supports Emacs 23 and up; and
> I should use ELPA to install it.
>
> The ELPA install page, explains how to install stuff for Emacs 21 and
> 22.
>
> As far as I understand, the Emacs init files dont support the usage of
> different EMacs versions. So which Emacs version do you use?
>
>
I've used swank with Emacs 22 without any problems so far. Emacs 22 is
installed by default on my Mac and I haven't bothered upgrading to 23 yet.
If you have a choice you should probably start with 23.

-- 
Cosmin Stejerean
http://offbytwo.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

To unsubscribe from this group, send email to 
clojure+unsubscribegooglegroups.com or reply to this email with the words 
"REMOVE ME" as the subject.


Re: Question about overriding print-method for deftypes

2010-03-21 Thread Mark Engelberg
I'm kind of surprised that *print-dup* behavior isn't automatically enabled
for deftypes.  Is there a standard way to add this in for a specific
deftype?

-- 
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

To unsubscribe from this group, send email to 
clojure+unsubscribegooglegroups.com or reply to this email with the words 
"REMOVE ME" as the subject.


Re: Sequential vs. "divide and conquer" algorithm

2010-03-21 Thread Michał Marczyk
On 20 March 2010 18:29, Andrzej  wrote:
> Thanks, that's what I was going to do next. You're certainly right
> about using fewer, more coarse-grained partitions. BTW, you can check
> the number of available processors using (.. Runtime getRuntime
> availableProcessors) (that's how pmap is doing it) but ultimately it
> might be better to let the user or a system administrator decide about
> it.

Thanks, I remembered seeing that availableProcessors property in
Clojure code somewhere, turns out it was right under my nose...
Anyway, I'm hoping to use a Grand Central Dispatch-using ThreadPool or
some such thing in the future; for now pmap is doing fine when handed
sufficiently coarse chunks of data for processing.

> I was just looking for this presentation! Thank you.

Through happy coincidence I was just browsing the slides deck. :-)

And now I'm tempted to play with "PersistentConc" in Clojure...

All the best,
Michał

-- 
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

To unsubscribe from this group, send email to 
clojure+unsubscribegooglegroups.com or reply to this email with the words 
"REMOVE ME" as the subject.


Re: Why I have chosen not to employ clojure

2010-03-21 Thread Cosmin Stejerean
On Sun, Mar 21, 2010 at 1:47 PM, Fogus  wrote:

> > 1)As soon as I see the copy of this email in my "clojure mailbox", I will
> > unsubscribe from this mailing list, delete the clojure mailbox and I will
> not
> > be following up in any way.
>
> Really?  This is not c.l.l and it's not likely that this thread would
> have devolved into flaming or worse.  It's unfortunate he feels the
> need to take such an extreme measure because I didn't read his post as
> a troll and felt that a dialog about his issues might have been
> enlightening.
>
>

I don't understand the complaints about installing Clojure. As far as I know
there's nothing required to 'install' Clojure beyond downloading the
clojure.jar, other than I guess having a working Java installation.

Similarly, I don't understand the difficulties in deploying Clojure
applications. At least as far as web applications go, I really like the one
WAR file deployment of Java applications. It's certainly far easier in
general than deploying Python applications for example.

-- 
Cosmin Stejerean
http://offbytwo.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

To unsubscribe from this group, send email to 
clojure+unsubscribegooglegroups.com or reply to this email with the words 
"REMOVE ME" as the subject.


Re: Why I have chosen not to employ clojure

2010-03-21 Thread Quzanti

Reading his post I got the impression he was a bit of an egocentric (a
bit more information about himself than was relevant), those sorts
tend to overreact.

However I can imagine the whole just bung the jar file on your
classpath thing wouldn't make much sense for a java newbie. It may
highlight the need for some special 'getting started' documentation
for Lisp programmers who have never used java, which I understand to
be one target audience of clojure.

>
> I don't understand the complaints about installing Clojure. As far as I know
> there's nothing required to 'install' Clojure beyond downloading the
> clojure.jar, other than I guess having a working Java installation.
>

-- 
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

To unsubscribe from this group, send email to 
clojure+unsubscribegooglegroups.com or reply to this email with the words 
"REMOVE ME" as the subject.


Re: Sequential vs. "divide and conquer" algorithm

2010-03-21 Thread Michał Marczyk
On 21 March 2010 13:29, Andrzej  wrote:
> Yesterday I looked at the implementation of the PersistentVector
> class, trying to figure out how to exploit its internal structure to
> decompose the vector. I hit several issues though:

One thing that comes to my mind after reading through your list is
that when this sort of "tree parallelisation" is actually worth while,
with large datasets and computationally expensive commutative
operations, it probably doesn't matter much whether the chunks are of
equal size or not, as long as they're roughly comparable. Even with
equal sized chunks, with some interesting operations there is no
guarantee that any two chunks will take roughly the same amount of
time to process; even something simple like multiplication through the
Clojure built-in * will take no time at all with small arguments and
take forever when dealing with huge BigIntegers.

Ultimately, in the general case, one needs to make sure that the
number of chunks is large enough for differences in actual workload
from chunk to chunk not to become problematic, yet small enough for
bookkeeping overhead to stay significantly smaller then the expense of
performing the main computation. Clearly there is room here for
user-supplied parameters.

Not sure if I want to draw any particular conclusion from this...
Probably not, since I'm not yet done wondering to which degree I might
be correct in thinking it. :-) I do want to stress once again the need
for benchmarking with expensive tasks, though. Addition is so cheap
that it's guaranteed not to be worth the bookkeeping cost of fancy
work splitting solutions.

All the best,
Michał

-- 
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

To unsubscribe from this group, send email to 
clojure+unsubscribegooglegroups.com or reply to this email with the words 
"REMOVE ME" as the subject.


Re: Why I have chosen not to employ clojure

2010-03-21 Thread Laurent PETIT
Yeah,

too bad he removed his entry, 'cause as you said, installing clojure
isn't harder than installing anything java based. I don't know of a
sysadmin nowadays which had not to deal with java stuff in a way or
another ? And ant is around the place *for years*. So more input from
him may have helped more clearly identify the root problem.

2010/3/21 Cosmin Stejerean :
>
>
> On Sun, Mar 21, 2010 at 1:47 PM, Fogus  wrote:
>>
>> > 1)As soon as I see the copy of this email in my "clojure mailbox", I
>> > will
>> > unsubscribe from this mailing list, delete the clojure mailbox and I
>> > will not
>> > be following up in any way.
>>
>> Really?  This is not c.l.l and it's not likely that this thread would
>> have devolved into flaming or worse.  It's unfortunate he feels the
>> need to take such an extreme measure because I didn't read his post as
>> a troll and felt that a dialog about his issues might have been
>> enlightening.
>>
>
> I don't understand the complaints about installing Clojure. As far as I know
> there's nothing required to 'install' Clojure beyond downloading the
> clojure.jar, other than I guess having a working Java installation.
> Similarly, I don't understand the difficulties in deploying Clojure
> applications. At least as far as web applications go, I really like the one
> WAR file deployment of Java applications. It's certainly far easier in
> general than deploying Python applications for example.
> --
> Cosmin Stejerean
> http://offbytwo.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
>
> To unsubscribe from this group, send email to
> clojure+unsubscribegooglegroups.com or reply to this email with the words
> "REMOVE ME" as the subject.
>

-- 
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

To unsubscribe from this group, send email to 
clojure+unsubscribegooglegroups.com or reply to this email with the words 
"REMOVE ME" as the subject.



Re: Question about overriding print-method for deftypes

2010-03-21 Thread Michał Marczyk
On 21 March 2010 21:02, Mark Engelberg  wrote:
> I'm kind of surprised that *print-dup* behavior isn't automatically enabled
> for deftypes.  Is there a standard way to add this in for a specific
> deftype?

print-dup is just another multimethod, so an implementation of that
can be defined. Obviously deserialisation with read will have no
chance of working in the context of code which doesn't know the
relevant deftype, but when the deftype is known, one could perhaps use
#= for it:

(read-string "#=(Piece 1 \A)")

Sincerely,
Michał

-- 
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

To unsubscribe from this group, send email to 
clojure+unsubscribegooglegroups.com or reply to this email with the words 
"REMOVE ME" as the subject.


Re: Why I have chosen not to employ clojure

2010-03-21 Thread Quzanti
But if he had never been in the Java mindset it wouldn't be obvious to
him that
there is nothing to be gained by compiling your own java code.
Platform independence,
bytecode etc means that a jar file of the stable build is the optimum
solution. That is so
obvious to us we forget that its a revolution for someone new to java.
So he probably
went down some compile from source to optimise for your architecture
route that made
perfect sense to him, but led him onto a iceberg (the captain of the
titanic *knew* that a
ship could turn in time because that is what all his previous
experience
on smaller ships led him to believe)

On Mar 21, 8:39 pm, Laurent PETIT  wrote:
> Yeah,
>
> too bad he removed his entry, 'cause as you said, installing clojure
> isn't harder than installing anything java based. I don't know of a
> sysadmin nowadays which had not to deal with java stuff in a way or
> another ? And ant is around the place *for years*. So more input from
> him may have helped more clearly identify the root problem.
>
> 2010/3/21 Cosmin Stejerean :
>

-- 
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

To unsubscribe from this group, send email to 
clojure+unsubscribegooglegroups.com or reply to this email with the words 
"REMOVE ME" as the subject.


Re: Why I have chosen not to employ clojure

2010-03-21 Thread cageface
What a strange reason to dismiss Clojure. And also strange to refuse
any further input.

-- 
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

To unsubscribe from this group, send email to 
clojure+unsubscribegooglegroups.com or reply to this email with the words 
"REMOVE ME" as the subject.


Re: Why I have chosen not to employ clojure

2010-03-21 Thread Stuart Sierra
I agree that the Clojure first-run experience is too rough.  Both
Scala and JRuby, for example, are complete packages that you can
download, unzip, install, and run -- on any platform -- without
knowing anything about Java.

Clojure needs to provide the same experience, even if it only matters
for first-time users.

-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

To unsubscribe from this group, send email to 
clojure+unsubscribegooglegroups.com or reply to this email with the words 
"REMOVE ME" as the subject.


Re: separating ui and content in clojure

2010-03-21 Thread Mike Meyer
[Context recovered from top-posting.]

On Sun, 21 Mar 2010 10:31:58 -0700
Josh Stratton  wrote:
> On Sat, Mar 20, 2010 at 8:51 AM, Mike Meyer
>  wrote:
> > On Sat, 20 Mar 2010 08:11:49 -0700 (PDT)
> > strattonbrazil  wrote:
> >
> >> I'd like to separate my ui Swing/JOGL from the content, so my code is
> >> relatively unaware of the UI around it.  For example, I create a
> >> global context that holds on my content.  I then make a UI that when
> >> the user does some interaction like a mouse click or drag, the UI
> >> creates a new context.  My OO instincts would be to create a context
> >> and pass it to all my UI objects that receive events and mutate them,
> >> but if I'm dealing with an immutable class if I pass it to each UI
> >> object, when one UI object makes a new context, it isn't reflected in
> >> the other UIs.  Basically I want all UIs pointing to the same context
> >> and each UI being able to create a new context that each UI points
> >> to.  It seems that when one UI updates the global context reference
> >> with a 'def', the others are still using the old one.
> >
> > You need to update shared data, and that doesn't seem avoidable. In
> > clojure, you do that with either a ref or an atom holding the data,
> > depending on how you need to update it. This will make it thread safe
> > if/when you start running your UI objects in different threads.
> >
> An atom seems appropriate after reading up on it, but documentation
> seems a little scarce.  Reading about atoms on the clojure site gives
> a very small example using just a {}.  I've tried piecing it together
> using a struct but am getting
> 
> Exception in thread "main" java.lang.IllegalArgumentException: Key
> must be integer (start.clj:0)
> 
> Can atoms be only certain types?
> 
> let [context (atom (create-context))] ; create-context returns a context 
> object
>   (def canvas0 (create-canvas 0 context)) ; passing the atomized
> context to a struct
>   )

Atoms can only be one type: atom. They can hold objects of arbitrary
type.  Context is an atom. If create-canvas expects some other type,
it won't work. You have three options: 1) create-context doesn't
modify the context; just pass in @context to pass in the context the
atom holds. 2) create-context modifies the context, so either a) it
needs to be modified to expect an atom and change it appropriately, or
b) it needs to be modified to return the new value of the context so
it can be used with one of the atom-changing functions.

 http://www.mired.org/consulting.html
Independent Network/Unix/Perforce consultant, email for more information.

O< ascii ribbon campaign - stop html mail - www.asciiribbon.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

To unsubscribe from this group, send email to 
clojure+unsubscribegooglegroups.com or reply to this email with the words 
"REMOVE ME" as the subject.


Re: Why I have chosen not to employ clojure

2010-03-21 Thread Lee Spector

I have some sympathy with some of what Tim wrote, although I think that I'll be 
working in and enjoying Clojure for some time to come (really -- I'm finding it 
to be fantastic in many ways -- including the community). I'm not sure I agree 
with or even understand all of Tim's complaints, but as a relative newcomer to 
the Java world I share some of his thoughts about getting started.

The last two environments I've worked/taught in have been DrScheme and 
Processing, and both of these have the virtue that you download/install one 
thing and instantly have an intuitive IDE within which you can write and run 
code. Same for MCL way back in the day, and for just about any other 
environment in which I've done much work or teaching (egads, back to Turbo 
Pascal and Think C). BTW Processing even has a one button "export applet" 
function that makes web deployment of applets trivial, and this is REALLY 
attractive to students with non-compsci backgrounds and other total newcomers 
to programming.

To many of you setting up Clojure probably seems just about as simple, and you 
may be thinking "Jeez -- if they can't even do that then how do they expect to 
be able to do anything interesting with the language anyway?" But for newcomers 
to Java -- even newcomers with lots of coding experience in other environments 
-- the issues with classpaths and putting jars in the right places can be 
pretty frustrating, to say nothing of the hoops one has to jump through to set 
up slime or the other available IDEs (even with the very nice videos that some 
of you have made, because there are enough steps and platform dependencies that 
things can go wrong in many ways). Although I now have a nice environment set 
up I'm still a little worried about how I'll deal with setup on all of the 
machines in our lab, and on the laptops of students with no previous 
experience...

I'm sure that this can and will be overcome, in part because I think that for 
my main environment (Mac OS X) and for my needs (which are more about ease of 
starting to write and run code than about deployment) MCLIDE/Clojure is very 
close already (three cheers for Terje!). 

So whatever else might have been right or wrong about Tim's post, I agree that 
it could be a little easier for total newcomers to get going... and I think the 
community will grow even more quickly when it is.

 -Lee


On Mar 21, 2010, at 4:39 PM, Laurent PETIT wrote:

> Yeah,
> 
> too bad he removed his entry, 'cause as you said, installing clojure
> isn't harder than installing anything java based. I don't know of a
> sysadmin nowadays which had not to deal with java stuff in a way or
> another ? And ant is around the place *for years*. So more input from
> him may have helped more clearly identify the root problem.
> 
> 2010/3/21 Cosmin Stejerean :
>> 
>> 
>> On Sun, Mar 21, 2010 at 1:47 PM, Fogus  wrote:
>>> 
 1)As soon as I see the copy of this email in my "clojure mailbox", I
 will
 unsubscribe from this mailing list, delete the clojure mailbox and I
 will not
 be following up in any way.
>>> 
>>> Really?  This is not c.l.l and it's not likely that this thread would
>>> have devolved into flaming or worse.  It's unfortunate he feels the
>>> need to take such an extreme measure because I didn't read his post as
>>> a troll and felt that a dialog about his issues might have been
>>> enlightening.
>>> 
>> 
>> I don't understand the complaints about installing Clojure. As far as I know
>> there's nothing required to 'install' Clojure beyond downloading the
>> clojure.jar, other than I guess having a working Java installation.
>> Similarly, I don't understand the difficulties in deploying Clojure
>> applications. At least as far as web applications go, I really like the one
>> WAR file deployment of Java applications. It's certainly far easier in
>> general than deploying Python applications for example.
>> --
>> Cosmin Stejerean
>> http://offbytwo.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
>> 
>> To unsubscribe from this group, send email to
>> clojure+unsubscribegooglegroups.com or reply to this email with the words
>> "REMOVE ME" as the subject.
>> 
> 
> -- 
> 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/gr

Re: Question about overriding print-method for deftypes

2010-03-21 Thread Meikel Brandmeyer
Hi,

On Sun, Mar 21, 2010 at 08:43:10PM +0100, Michał Marczyk wrote:

> But how would one go about that? str calls .toString on its arguments,
> which is in turn a method of Object, thus not present in any
> interface, whereas deftype / extend only allow one to implement
> interface or protocol methods...

user=> (deftype Xyz []
  Object
  (toString
[]
"This is a Xyz!"))
#'user/Xyz
user=> (str (Xyz))
"This is a Xyz!"

The docstring of deftype says protocol, interface or Object.

Sincerely
Meikel

-- 
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

To unsubscribe from this group, send email to 
clojure+unsubscribegooglegroups.com or reply to this email with the words 
"REMOVE ME" as the subject.


Re: Maven clojure:repl

2010-03-21 Thread Stuart Sierra
Maven has a default search path, but it only works for the standard
plugins distributed by Apache.

To use the Clojure plugin (any of the clojure:* commands) the pom.xml
must contain a section like this:

  
...

...
 
com.theoryinpractise
clojure-maven-plugin
1.3.2
  
...

  

Incanter is divided into several different modules, each with its own
pom.xml.  Some of them include the Clojure plugin, some do not
(presumably they don't need it).

Incanter's top-level pom.xml does not include the Clojure plugin, so
clojure:* goals will not work in the top-level project directory.  In
some of the module directories, such as "modules/incanter-app", the
clojure:* goals should work.

-SS



On Mar 21, 3:04 pm, alux  wrote:
> Hello Stuart,
>
> yes, thats not in. I'm not enough into maven to know where the plugins
> have to be specified. I had the hope that maven searches its
> repository, when I call a specific goal of the form xxx:yyy - so this
> hope was in vain?
>
> Thank you for the comment.
>
> Regards, alux
>
> Stuart Sierra schrieb:
>
>
>
> > On Mar 20, 7:56 am, alux  wrote:
> > > mvn clojure:repl
>
> > > But that doesnt work.
>
> > > [ERROR] BUILD ERROR
> > > [INFO]
> > > 
> > > [INFO] The plugin 'org.apache.maven.plugins:maven-clojure-plugin' does
> > > not exist
>
> > Those instructions appear to be out-of-date for Incanter's current
> > source repository.  The Clojure Maven plugin is not specified as a
> > plugin by the top-level pom.xml.  This may be a bug to take up with
> > the Incanter developers.
>
> > -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

To unsubscribe from this group, send email to 
clojure+unsubscribegooglegroups.com or reply to this email with the words 
"REMOVE ME" as the subject.


Re: clojure.walk

2010-03-21 Thread Stuart Sierra
clojure.walk is a terrible hack that I wrote and abandoned 2 years
ago.  It never should have made it into the Clojure distribution, for
which I apologize.  I will campaign for its deletion just as soon as I
find a suitable replacement.

-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

To unsubscribe from this group, send email to 
clojure+unsubscribegooglegroups.com or reply to this email with the words 
"REMOVE ME" as the subject.


Re: Why I have chosen not to employ clojure

2010-03-21 Thread Anniepoo
It certainly does seem strange coming from the Java world, where ear
files and deployment descriptors can be intimidating. The idea that
adding a couple jar files and the source tree to
the classpath is 'too hard' makes me wonder what language he was
coming from.

I was asked to give a simple 'hands on clojure' thing at a Java users
group. I wanted to spend
minimal time on environment setup, so I had these java developers put
the jars and my starter script in a directory, cd into it, and add .
to the classpath.
Out of the room of programmers I had one person have trouble getting
the starter project to come up pretty much immediately, and whatever
his issue was I fixed it in a few seconds.

For the record, I downloaded and installed Rebol - took about the same
time to get to where I was fiddling with code and not environment as
it did when I started clojure.
I was puzzled which version to download and had to figure out there
was a free version (under 15 sec)
828K download.
found a reasonable tutorial immediately, got my first language smell
when I discovered that they wanted me to use a built-in editor,
quickly got over that when they said most rebol programmers use an
external editor.

Learning curve - far fewer 'strange' concepts than clojure, I came up
pretty fast, but it definitely has a toy language feel. I'm guessing
it'd be a lot like programming in visual basic - quick til you need to
do something 'off the rails' like handle a UDP stream, then hellish.
Looks like another attempt to make an ultra-friendly language at the
expense of power - a 'solution' that usually doesn't get you too far.

deployment - ok, so rebol looks bad to deploy. You have to install a
runtime and give out the source, both probably not very enterprise-
solution oriented sysadmin friendly. And the server side example uses
CGI, which doesn't pass the smell test.

Conclusion -
rebol actually might be a reasonable solution for a project I'm
talking to the biz guy about. It'd involve a whole bunch of objects in
a virtual world that need controlled from some web other end. Rebol
has deployment problems, I'll agree, but don't see them as relevant to
Clojure.

I think our friend's off base.



-- 
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

To unsubscribe from this group, send email to 
clojure+unsubscribegooglegroups.com or reply to this email with the words 
"REMOVE ME" as the subject.


Re: separating ui and content in clojure

2010-03-21 Thread Stuart Sierra
Here's an example I wrote about separating GUI from content using
Agents:
http://stuartsierra.com/2010/01/08/agents-of-swing

-SS

On Mar 20, 11:11 am, strattonbrazil  wrote:
> I'd like to separate my ui Swing/JOGL from the content, so my code is
> relatively unaware of the UI around it.  For example, I create a
> global context that holds on my content.  I then make a UI that when
> the user does some interaction like a mouse click or drag, the UI
> creates a new context.  My OO instincts would be to create a context
> and pass it to all my UI objects that receive events and mutate them,
> but if I'm dealing with an immutable class if I pass it to each UI
> object, when one UI object makes a new context, it isn't reflected in
> the other UIs.  Basically I want all UIs pointing to the same context
> and each UI being able to create a new context that each UI points
> to.  It seems that when one UI updates the global context reference
> with a 'def', the others are still using the old one.

-- 
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

To unsubscribe from this group, send email to 
clojure+unsubscribegooglegroups.com or reply to this email with the words 
"REMOVE ME" as the subject.


Re: Why I have chosen not to employ clojure

2010-03-21 Thread Cosmin Stejerean
On Sun, Mar 21, 2010 at 5:05 PM, Stuart Sierra
wrote:

> I agree that the Clojure first-run experience is too rough.  Both
> Scala and JRuby, for example, are complete packages that you can
> download, unzip, install, and run -- on any platform -- without
> knowing anything about Java.
>
> Clojure needs to provide the same experience, even if it only matters
> for first-time users.
>
>
I have a project on github that I think comes pretty close. I created it so
I can have separate clojure environments for different projects without
having to muck with lein or maven (not to mention neither lein or
clojure-mavne-plugin were available at the time AFAIK). I still find this
the quickest way to get Clojure working on a new machine.I would appreciate
any feedback.

http://github.com/offbytwo/cljenv

-- 
Cosmin Stejerean
http://offbytwo.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

To unsubscribe from this group, send email to 
clojure+unsubscribegooglegroups.com or reply to this email with the words 
"REMOVE ME" as the subject.


Re: Why I have chosen not to employ clojure

2010-03-21 Thread Mark Derricutt
Thanks for the pointer to MCLIDE!  That looks really nice!  Any idea if a
64bit build is in the works?  For some reason I feel dirty about having to
install Rosetta :)

-- 
Pull me down under...

On Mon, Mar 22, 2010 at 11:08 AM, Lee Spector wrote:

> I'm sure that this can and will be overcome, in part because I think that
> for my main environment (Mac OS X) and for my needs (which are more about
> ease of starting to write and run code than about deployment) MCLIDE/Clojure
> is very close already (three cheers for Terje!).
>

-- 
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

To unsubscribe from this group, send email to 
clojure+unsubscribegooglegroups.com or reply to this email with the words 
"REMOVE ME" as the subject.


Re: Why I have chosen not to employ clojure

2010-03-21 Thread e
there's a positive reason to say all that stuff as if to say, " and it's not
that I'm a slouch.  I have been able to succeed with other technology."
 I've personally had tons of trouble getting going with clojure, and I use
java all the time.  I think the ideas in clojure are awesome, and I like the
language, but if folks have never looked at Fan/Fantom ... as far as getting
into it, *that's* about the gentlist you can get into anything.  The website
was written in Fantom, it's a one stop shop for getting started ... not that
I like that language better or anything, but, seriously ... that's a fun
exercise.  It's very inviting and welcoming and I wish that a page could be
taken from that approach -- I think he wouldn't have had any of the same
opinions if it had.

And I realize I'm not being very concrete: I'd had plans to write up what I
thought some specific differences were.  Now I'm just left with an
impression ... an impression that Fantom wants you to LOVE that language . .
. .and an impression of clojure that you have to want to love clojure (so
then you have to make a lot of complicated arguments as to why that is so,
which, by the way, I think are beautifully presented in Clojure In Action).

And don't get me started on trying to get emacs or vi all hooked up on my
mac.  I've never succeeded.  Summary: I agree to some extent.  clojure is
awesome.  I wish I could use it at work, but it's an incredibly hard thing
to sell.

On Sun, Mar 21, 2010 at 4:37 PM, Quzanti  wrote:

>
> Reading his post I got the impression he was a bit of an egocentric (a
> bit more information about himself than was relevant), those sorts
> tend to overreact.
>
> However I can imagine the whole just bung the jar file on your
> classpath thing wouldn't make much sense for a java newbie. It may
> highlight the need for some special 'getting started' documentation
> for Lisp programmers who have never used java, which I understand to
> be one target audience of clojure.
>
> >
> > I don't understand the complaints about installing Clojure. As far as I
> know
> > there's nothing required to 'install' Clojure beyond downloading the
> > clojure.jar, other than I guess having a working Java installation.
> >
>
> --
> 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
>
> To unsubscribe from this group, send email to clojure+
> unsubscribegooglegroups.com or reply to this email with the words "REMOVE
> ME" as the subject.
>

-- 
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

To unsubscribe from this group, send email to 
clojure+unsubscribegooglegroups.com or reply to this email with the words 
"REMOVE ME" as the subject.


Re: General question: Petri nets and STM in clojure

2010-03-21 Thread alux
Hello Ryan,

as far as I understand, Petri nets are as powerful as any concurrent
mechanism. That means you can do all the good things Clojure does, and
all the bad things (the other languages do :) too in Petri nets.

So, can you detail your question a bit more?

(I'd be happy about a Petri net tool for nets colored with Clojure.
But thats another topic ;-)

Regards, alux

-- 
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

To unsubscribe from this group, send email to 
clojure+unsubscribegooglegroups.com or reply to this email with the words 
"REMOVE ME" as the subject.


Re: Why I have chosen not to employ clojure

2010-03-21 Thread Marek Kubica
On Sun, 21 Mar 2010 10:42:12 -0800
Tim Johnson  wrote:

> Here's how I installed the flash player on my system.
> 1)Downloaded install_flash_player_10_linux.tar.gz
> 2)Unzipped libflashplayer.so
> 3)Copied to /usr/lib/firefox-3.5.2/plugins/

Here's how I installed the Clojure REPL on my system.
1) Downloaded clojure-1.1.0.zip
2) Unzipped clojure.jar
3) Ran java -jar clojure.jar

Hardly any different.

FWIW, posting on a list and declaring immediately that one will
unsubscribe afterwards, not even reading replies is near-flamebait
quality.

regards,
Marek

-- 
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

To unsubscribe from this group, send email to 
clojure+unsubscribegooglegroups.com or reply to this email with the words 
"REMOVE ME" as the subject.


clojure and clojure-contrib jars built with the 1.5 jdk

2010-03-21 Thread Eric Thorsen
This is more of a maven question probably, but I have an app that
needs versions of the jars built with jdk 1.5 and I'm using the
http://build.clojure.org/snapshots repo where they appear to be built
with 1.6.  Are there versions (or plans to support 1.5 versions) in a
maven repo somewhere?

Thanks!
Eric

-- 
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

To unsubscribe from this group, send email to 
clojure+unsubscribegooglegroups.com or reply to this email with the words 
"REMOVE ME" as the subject.


Re: Why I have chosen not to employ clojure

2010-03-21 Thread Mike K
> I would appreciate any feedback.

According to the readme it requires bash or zsh.  Any plans to support
windows (without cygwin or other unix emulation)?

I agree with Stuart that the user experience should be friendly on all
supported platforms.

   Mike

-- 
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

To unsubscribe from this group, send email to 
clojure+unsubscribegooglegroups.com or reply to this email with the words 
"REMOVE ME" as the subject.


Re: clojure and clojure-contrib jars built with the 1.5 jdk

2010-03-21 Thread Stuart Sierra
No, but you can change the configs and recompile.

Clojure itself uses Ant, so "ant" on a machine with only Java 1.5
should do the trick.  To install that custom JAR in your local Maven
repository, download the "Maven Ant Tasks" JAR and run:
ant -lib /path/to/maven-ant-tasks.jar ci-build

Contrib uses Maven, so add thes lines to its pom.xml in the 
section:

  
org.apache.maven.plugins
maven-compiler-plugin

1.5
1.5

  

Then "mvn install" to build the JARs and put them in your local
repository.

-SS



On Mar 21, 7:32 pm, Eric Thorsen  wrote:
> This is more of a maven question probably, but I have an app that
> needs versions of the jars built with jdk 1.5 and I'm using 
> thehttp://build.clojure.org/snapshotsrepo where they appear to be built
> with 1.6.  Are there versions (or plans to support 1.5 versions) in a
> maven repo somewhere?
>
> Thanks!
> Eric

-- 
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

To unsubscribe from this group, send email to 
clojure+unsubscribegooglegroups.com or reply to this email with the words 
"REMOVE ME" as the subject.


Re: clojure and clojure-contrib jars built with the 1.5 jdk

2010-03-21 Thread Eric Thorsen
I figured as much.  The issue for me is the Netbeans plugin must have
1.5 java and I was hoping to get these from a repo.  I suppose I can
build the 1.5 versions and publish them (somewhere).  I'll look into
this.

Thanks,
Eric


On Mar 21, 8:50 pm, Stuart Sierra  wrote:
> No, but you can change the configs and recompile.
>
> Clojure itself uses Ant, so "ant" on a machine with only Java 1.5
> should do the trick.  To install that custom JAR in your local Maven
> repository, download the "Maven Ant Tasks" JAR and run:
> ant -lib /path/to/maven-ant-tasks.jar ci-build
>
> Contrib uses Maven, so add thes lines to its pom.xml in the 
> section:
>
>   
>     org.apache.maven.plugins
>     maven-compiler-plugin
>     
>         1.5
>         1.5
>     
>   
>
> Then "mvn install" to build the JARs and put them in your local
> repository.
>
> -SS
>
> On Mar 21, 7:32 pm, Eric Thorsen  wrote:
>
>
>
> > This is more of a maven question probably, but I have an app that
> > needs versions of the jars built with jdk 1.5 and I'm using 
> > thehttp://build.clojure.org/snapshotsrepowhere they appear to be built
> > with 1.6.  Are there versions (or plans to support 1.5 versions) in a
> > maven repo somewhere?
>
> > Thanks!
> > Eric

-- 
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

To unsubscribe from this group, send email to 
clojure+unsubscribegooglegroups.com or reply to this email with the words 
"REMOVE ME" as the subject.


Re: Why I have chosen not to employ clojure

2010-03-21 Thread Antony Blakey

On 22/03/2010, at 9:28 AM, e wrote:

> And don't get me started on trying to get emacs or vi all hooked up on my 
> mac.  I've never succeeded.

I'm about to use Clojure commercially, but it's been a frustrating exercise 
getting setup. I've ended up using LaClojure on IntelliJ, but that wasn't 
trivial because of a plugin versioning issue. CCW doesn't autoindent (I know 
that's coming) and I've been unable to get Enclojure's project REPL to work 
when using Clojure 1.2. I had a stretch of using almost Emacs exclusively for 
15 years, but compared to any IDE thats absolutely not newbie friendly, and not 
as good as an IDE IMO. In any case, the package manager hangs 80% of the time 
trying to grab stuff from the net.

IMHO a significant sociological issue is that so many clojure devs use Emacs, 
are coming at this from a 'rebirth-of-lisp' POV, and seem to have adopted the 
cultural values of Lisp when it comes to development practices. To be 
successful however Clojure needs to adopt 'mainstream' values - introduce just 
one 'different' thing i.e. the language, rather than expecting people to adopt 
both the language, and a different development environment / toolchain e.g. 
leiningen etc (which IMO is classic NIH). You can't cross the chasm with too 
much baggage. Personally I don't believe this will happen unless core 
developers use the tools and practices that users want to use. The end-user 
itches and the developer itches need to be aligned.

Just my $0.02.

Antony Blakey
-
CTO, Linkuistics Pty Ltd
Ph: 0438 840 787

It's amazing that the one side of the conversation that survived is "I don't 
know art, but I know what I like". The reply from the artist was "Madam, so 
does a cow".
  -- Carl Kirkendall


-- 
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

To unsubscribe from this group, send email to 
clojure+unsubscribegooglegroups.com or reply to this email with the words 
"REMOVE ME" as the subject.


Re: Why I have chosen not to employ clojure

2010-03-21 Thread Richard Newman
To be successful however Clojure needs to adopt 'mainstream' values  
- introduce just one 'different' thing i.e. the language, rather  
than expecting people to adopt both the language, and a different  
development environment / toolchain e.g. leiningen etc (which IMO is  
classic NIH).


I think that depends on your definition of "successful".

If you think "popular with mainstream Java developers" is the  
definition of success, then yes: not scaring those poor folks is  
important.


I don't count that as success -- I call that popularity. I'd much  
rather have Clojure make me personally productive (and that means  
Swank, standalone REPLs, introspective debugging, etc.) than somehow  
feel validated because lots of faceless Java folks can get past some  
environment issue, only to reach the point of being scared away by the  
parentheses and immutable functional programming.


Ultimately, though, it all comes down to "here are some jars". If a  
Java developer can't figure that much out, they're probably not going  
to get very far regardless.


--
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

To unsubscribe from this group, send email to clojure+unsubscribegooglegroups.com or 
reply to this email with the words "REMOVE ME" as the subject.


Re: Why I have chosen not to employ clojure

2010-03-21 Thread David Nolen
On Sun, Mar 21, 2010 at 9:12 PM, Antony Blakey wrote:

>
> On 22/03/2010, at 9:28 AM, e wrote:
>
> > And don't get me started on trying to get emacs or vi all hooked up on my
> mac.  I've never succeeded.
>
> I'm about to use Clojure commercially, but it's been a frustrating exercise
> getting setup. I've ended up using LaClojure on IntelliJ, but that wasn't
> trivial because of a plugin versioning issue. CCW doesn't autoindent (I know
> that's coming) and I've been unable to get Enclojure's project REPL to work
> when using Clojure 1.2. I had a stretch of using almost Emacs exclusively
> for 15 years, but compared to any IDE thats absolutely not newbie friendly,
> and not as good as an IDE IMO. In any case, the package manager hangs 80% of
> the time trying to grab stuff from the net.
>

Many people use Emacs at this point only because it has the best Clojure
support thus far. This will change in time. It's still early days. 1 year
ago (when Clojure was one years (1 1/2?) old) it was impossible to even
pretty-print macroexpansion!


> IMHO a significant sociological issue is that so many clojure devs use
> Emacs, are coming at this from a 'rebirth-of-lisp' POV, and seem to have
> adopted the cultural values of Lisp when it comes to development practices.
> To be successful however Clojure needs to adopt 'mainstream' values -
> introduce just one 'different' thing i.e. the language, rather than
> expecting people to adopt both the language, and a different development
> environment / toolchain e.g. leiningen etc (which IMO is classic NIH). You
> can't cross the chasm with too much baggage. Personally I don't believe this
> will happen unless core developers use the tools and practices that users
> want to use. The end-user itches and the developer itches need to be
> aligned.
>

I don't think any of the current Clojure library maintainers believe in an
Emacs or Lein only future. I think as more and more people adopt varying
tool sets, libraries will evolve to support the varying kinds of dev
environments.

These kinds of things don't happen overnight. Or even in a year. A lot of
people have to adopt Clojure for these things to improve. And improve they
have. If things improve at the pace they have been, before long most of
these concerns will be thing of the distant past.

I think part of the problem is that so many things about Clojure work so
well. You expect everything to magically work!

While I sympathize with the OP, I think the OP was trolling just a tad. I
mean clearly noone on this list has a slackware setup, thus the less than
helpful responses. But Clojure is just too young to have a large base of
developers with every hardware/software configuration out there. It would
have been more constructive if the OP had sludged through it and shared his
insights as many of us have sludged through it so that we can spread our
collective knowledge about how to make hacking on Clojure as fun as possible
in many different environments.

David

-- 
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

To unsubscribe from this group, send email to 
clojure+unsubscribegooglegroups.com or reply to this email with the words 
"REMOVE ME" as the subject.


Getting an arbitrary element from a transient hash-set

2010-03-21 Thread Mark Engelberg
On a set s, you can just do (first s) to get an arbitrary element of s.
Any way to get an arbitrary item for a transient set?

-- 
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

To unsubscribe from this group, send email to 
clojure+unsubscribegooglegroups.com or reply to this email with the words 
"REMOVE ME" as the subject.


Re: Why I have chosen not to employ clojure

2010-03-21 Thread Terje Norderhaug

On Mar 21, 2010, at 3:56 PM, Mark Derricutt wrote:
Thanks for the pointer to MCLIDE!  That looks really nice!  Any  
idea if a 64bit build is in the works?  For some reason I feel  
dirty about having to install Rosetta :)


MCLIDE 2.0 will have that cutting edge you're craving for and  
definitely NOT require Rosetta, but please don't let that hold you  
back from using MCLIDE 1.0. The first version is intended to provide  
fodder for a conversation about what to include in the next  
generation lisp/clojure IDE for Macintosh. I invite you to download  
the upcoming release of MCLIDE for Clojure and join the dialogue  
about where to go from here. Think of Rosetta as just another VM... ;-)


There are good reasons for the initial release to use Rosetta,  
particularly that it allowed MCLIDE to be built rapidly on top of a  
mature, proven lisp IDE. This dramatically cut down the development  
time from conception to usable software, making MCLIDE available now  
instead of at the time of the 2.0 release.


You get the gist: "Release early. Release often. And listen to your  
customers."


When MCLIDE for Clojure is out, you will be able to download a  
distribution of MCLIDE and have it work instantly as an IDE for  
Clojure on Mac OSX, and with a little extra effort as a Mac IDE for  
Clojure on any platform.


If you just can't wait any longer, send me an email, and I'll let you  
in on how to make the current version of MCLIDE work with Clojure.


On Mon, Mar 22, 2010 at 11:08 AM, Lee Spector  
 wrote:
I'm sure that this can and will be overcome, in part because I  
think that for my main environment (Mac OS X) and for my needs  
(which are more about ease of starting to write and run code than  
about deployment) MCLIDE/Clojure is very close already (three  
cheers for Terje!).


-- Terje Norderhaug
  te...@in-progress.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

To unsubscribe from this group, send email to clojure+unsubscribegooglegroups.com or 
reply to this email with the words "REMOVE ME" as the subject.


Re: Sequential vs. "divide and conquer" algorithm

2010-03-21 Thread Andrzej
On Sun, Mar 21, 2010 at 1:04 PM, Matt  wrote:
> Throwing in my 2 cents:
>
> (def chunk-size 2000)
>
> (defn sum-tree-part [nums start length]
>  (reduce
>    #(+ %1 (nth nums (+ start %2)))
>    0
>    (range length)))
>
> (defn sum-partition[nums]
>  (reduce +
>    (pmap #(sum-tree-part nums % chunk-size)
>      (range 0 (count nums) chunk-size

Some of the performance gain you observed can be attributed to the
built in reduce function. I found it several times faster than a
simple sequential recur loop. This is not surprising if you look into
internals of the reduce function:

[...]
 (if (chunked-seq? s)
   (recur f
  (.reduce (chunk-first s) f val)
  (chunk-next s))
   (recur f (f val (first s)) (next s)))

(seq []) returns a chunked-seq but to use it efficiently one needs to
iterate over chunks, like in the example above, not over single list
elements. One more reason to use higher order functions.

Well, that rises the bar for a competing parallel reduce equivalent
(sure we can make any O(n) parallel reduce faster than the sequential
one simply by using sufficiently large sequential chunks or heavy
enough computations but I'm still aiming at optimizing a general
case).

Andrzej

-- 
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

To unsubscribe from this group, send email to 
clojure+unsubscribegooglegroups.com or reply to this email with the words 
"REMOVE ME" as the subject.


Re: Why I have chosen not to employ clojure

2010-03-21 Thread Cosmin Stejerean
On Sun, Mar 21, 2010 at 6:55 PM, Mike K  wrote:

> > I would appreciate any feedback.
>
> According to the readme it requires bash or zsh.  Any plans to support
> windows (without cygwin or other unix emulation)?
>
> I agree with Stuart that the user experience should be friendly on all
> supported platforms.


I don't have a Windows machine so I can't easily add Windows support. I'm
assuming that what I'm doing with Bash should be possible to accomplish in
Windows, perhaps using BATCH scripts. Patches/pull requests are welcome :)

-- 
Cosmin Stejerean
http://offbytwo.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

To unsubscribe from this group, send email to 
clojure+unsubscribegooglegroups.com or reply to this email with the words 
"REMOVE ME" as the subject.


Re: Why I have chosen not to employ clojure

2010-03-21 Thread Seth
I hate to feed trolls, but this is a solid example of passive-
aggresive behavior. Also, ignoring plausible sounding, spell-checked
diatribes is bad.

The installation of one or two jar files from a Maven repository is
par for the JVM course. Deployment? Works on any reasonable JVM out
there. Could the install/deploy behavior be improved? Sure, but try
targeting something less ubiquitous than "ant". Slackware more modern
than Ubuntu??

Contrasting Clojure with Flash on Ubuntu really takes the cake. Flash
has never had a good reputation outside of Windows. Also, either the
poster is running as root (!) or has somehow forgotten a very
important su/sudo between steps 2 and 3. Either way, no sysadmin has
to be convinced.

Wresting with pigs is bad because you get dirty and the pig likes it.

On Mar 21, 2:42 pm, Tim Johnson  wrote:
> I have evaluated clojure for the last couple of days, and it is both my own
> professional decision and my recommendation to the professional organizations
> that I belong to and report to that clojure is not ready for prime time.
>
> Before any of you think that I am a disgruntled newbie turned troll, know
> the following:
>
> 1)As soon as I see the copy of this email in my "clojure mailbox", I will
> unsubscribe from this mailing list, delete the clojure mailbox and I will not
> be following up in any way.
>
> 2)In as much as clojure is a new programming language with a small but
> enthusiastic user base and a brilliant developer I confess to a certain deja 
> vu
> here. That would be rebol 10 years ago. Brilliantly conceived, brilliantly
> designed by one of the best programmers on the planet. Never went anywhere.
> I've used rebol for 10 years steadily and made a lot of money with it, but
> there is almost 0 demand for rebol programmers out there.
>
> 3)Although I may be a noob with it comes to clojure and even more of a noob
> when it comes to java, I have been a professional analyst and programmer for 
> 21
> years and own my own company. Many seasoned programmers, analysts and system
> adminstrators look at a new system as something to "employ". As a front end 
> for
> java, I do not consider clojure to be "employable".
>
> I think that clojure is brilliantly conceived and it is clear from what I have
> read of Rich Hickey's words that his vision is right in the same channel with
> mine, but that is not the problem. The fact that I respect the developer and
> the product is the reason that I have taken this time to write this email.
>
> The reason I choose NOT to employ clojure can be summed up in three words.
> ---
> Install and deploy.
> ---
>
> I consider this to be clojure's fatal weakness. Certainly I can get clojure up
> and running, but "selling" clojure to a sysadmin is going to be a problem at
> this time. There was a time when PHP was NOT present on virtually all 
> webservers.
> PHP got it's "foot in the door" because it was very easy to deploy.
>
> Consider the two threads that I started up - one is titled "Web programming in
> Clojure" - there's the good stuff. Generous reponse, lots of input.
>
> The other one is titled "Installation issues on slack 13.0 (ant?)". This where
> it all falls apart.
>
> Sadly, this is like the first impression and we all know how lasting first
> impressions are. In fact as you can see, the thread ended with no resolution.
> I'm sorry to pick on "steve" but his response is a case study
>
> * Steve  [100320 05:24]:
>
> > Reading the getting started page on the website will get you further
> > still :http://clojure.org/getting_started
>
> Sadly inadequate! Check out the comparable kawa resources and instructions for
> a better example.
>
> > If you do need ant then a more modern distro will make your life much
> > easier (eg. apt-get install ant).
>
> Again, so inadequate. I also use ubuntu. Have for years. apt-get is a thing
> of beauty. When it works. And bye the way, slackware is much more modern
> when it comes to up-to-date build tools. So know I not only have to "sell"
> clojure to the sysadmins, I have to sell them ubuntu too? Good luck with
> that!
>
> Here's how I installed the flash player on my system.
> 1)Downloaded install_flash_player_10_linux.tar.gz
> 2)Unzipped libflashplayer.so
> 3)Copied to /usr/lib/firefox-3.5.2/plugins/
>
> Make clojure "install and deployment" like the example above and more of us 
> will
> EMPLOY clojure and 10 years from now there WILL be a market for clojure
> programmers.
>
> Goodby and good luck.
> --
> Tim
> t...@johnsons-web.comhttp://www.akwebsoft.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: General question: Petri nets and STM in clojure

2010-03-21 Thread Andrzej
On Mon, Mar 22, 2010 at 4:36 AM, alux  wrote:
>
> as far as I understand, Petri nets are as powerful as any concurrent
> mechanism. That means you can do all the good things Clojure does, and
> all the bad things (the other languages do :) too in Petri nets.

I wonder if Petri nets can be applied for modeling systems based on
STM (in Clojure's flavor). I've only seen them used in common
lock-based designs (not that it means anything - I barely touched the
surface).

Andrzej

-- 
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

To unsubscribe from this group, send email to 
clojure+unsubscribegooglegroups.com or reply to this email with the words 
"REMOVE ME" as the subject.


Re: Why I have chosen not to employ clojure

2010-03-21 Thread Luc Préfontaine

He's illiterate about Java, he's older than me and has less experience
so finding how to run a jar file is probably
as remote as traveling to Alpha Centauri :))) (Don't we have something
like Google to find these answers ?)

Most of his recent experience seems to be in Visual Basic and mainstream
web centric languages.
I suspect he's more a by-product of using too few commercial language
centric IDEs.
If it does not work out of the box without a 1-800 number to call, he's
lost.

Let's not spend more time about this guy's comments.

I think we can assume a Java programmer knows about class path issues
and is able to run java and add librairies to the class path.

As for non Java programmers yes it can be a bit daunting but I bet you
can't do much in C# or F# if you do not have the slightest
idea on how to use VisualStudio : You are far away from a three
steps installation process here.

Agree, many people may already be familiar with VisualStudio, it's been
around for along time. But do you like it ? :)))
Getting started with Clojure is rather simple from the command line,
mastering a foreign IDE is a different story.
If you are not familiar with Eclipse, IntelliJ or Emacs and you want to
use something more flexible than command line mode
then you have a learning curve investment to do.

The alternatives are documented from the "Getting started" page of the
Clojure web site and it's pretty clear to follow.
The best "choice" may not be clear upfront (we all have our tastes) but
there is some solid ground to help people decide
on an alternative.

Yes we could have a complete package to run Clojure from the shell
command line but how far could someone go with this
to build a workable system without an IDE ? It might have some sex
appeal to help learn the language but how different
is it from the three steps described by Marek ? Do we really need to
release a Clojure SDK with an IDE etc ?
What other language does that ? Ruby ? Scala ? Groovy ? 

>From time to time we have comments about how difficult/easy it is to get
acquainted with Clojure but I wonder if we all
understand the same things about this issue. Do we need to gather
requirements somehow ? (!?!?!)

Comments anyone ?

Luc P.


On Sun, 2010-03-21 at 22:08 +0100, Marek Kubica wrote:

> On Sun, 21 Mar 2010 10:42:12 -0800
> Tim Johnson  wrote:
> 
> > Here's how I installed the flash player on my system.
> > 1)Downloaded install_flash_player_10_linux.tar.gz
> > 2)Unzipped libflashplayer.so
> > 3)Copied to /usr/lib/firefox-3.5.2/plugins/
> 
> Here's how I installed the Clojure REPL on my system.
> 1) Downloaded clojure-1.1.0.zip
> 2) Unzipped clojure.jar
> 3) Ran java -jar clojure.jar
> 
> Hardly any different.
> 
> FWIW, posting on a list and declaring immediately that one will
> unsubscribe afterwards, not even reading replies is near-flamebait
> quality.
> 
> regards,
> Marek
> 

-- 
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

To unsubscribe from this group, send email to 
clojure+unsubscribegooglegroups.com or reply to this email with the words 
"REMOVE ME" as the subject.


Re: Why I have chosen not to employ clojure

2010-03-21 Thread Cosmin Stejerean
On Sun, Mar 21, 2010 at 10:20 PM, Luc Préfontaine <
lprefonta...@softaddicts.ca> wrote:

>
> Yes we could have a complete package to run Clojure from the shell command
> line but how far could someone go with this
> to build a workable system without an IDE ?
>

[...]


> Comments anyone ?
>
>
I can get pretty far writing an application in Python with nothing more than
good command line support and syntax highlighting in any text editor.
Anything extra like completions, refactoring, etc, are just nice-to-haves. I
don't see why an IDE is required for writing workable Clojure apps.

-- 
Cosmin Stejerean
http://offbytwo.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

To unsubscribe from this group, send email to 
clojure+unsubscribegooglegroups.com or reply to this email with the words 
"REMOVE ME" as the subject.


Re: Question about overriding print-method for deftypes

2010-03-21 Thread Michał Marczyk
On 21 March 2010 23:19, Meikel Brandmeyer  wrote:
> The docstring of deftype says protocol, interface or Object.

So it does. (My, do I feel silly now.) Thanks!

Sincerely,
Michał

-- 
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

To unsubscribe from this group, send email to 
clojure+unsubscribegooglegroups.com or reply to this email with the words 
"REMOVE ME" as the subject.


Re: Why I have chosen not to employ clojure

2010-03-21 Thread cej38
I am a physicist by training and practice, this means that I am an
expert on Fortran 95.  To say my exposure to Java is minimal would be
generous.  And until last year when I heard about Clojure from a
friend, I thought LISP was a speech impediment.

Setting up Clojure was a MAJOR problem for me, what with getting
path's and classpaths right. (Figuring out what a classpath is was a
challenge.)  If it wasn't for the very patient help of a CS friend of
mine, I would not have figured it out.

I think the documentation assumes that the user is comfortable with
Java.  I feel like I am being asked to learn Java so that I can learn
Clojure.

I am now an avid Clojure user, but there really does need to be better
descriptions of how to set Clojure up on the website.


On Mar 21, 4:37 pm, Quzanti  wrote:
> Reading his post I got the impression he was a bit of an egocentric (a
> bit more information about himself than was relevant), those sorts
> tend to overreact.
>
> However I can imagine the whole just bung the jar file on your
> classpath thing wouldn't make much sense for a java newbie. It may
> highlight the need for some special 'getting started' documentation
> for Lisp programmers who have never used java, which I understand to
> be one target audience of clojure.
>
>
>
>
>
> > I don't understand the complaints about installing Clojure. As far as I know
> > there's nothing required to 'install' Clojure beyond downloading the
> > clojure.jar, other than I guess having a working Java installation.

-- 
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

To unsubscribe from this group, send email to 
clojure+unsubscribegooglegroups.com or reply to this email with the words 
"REMOVE ME" as the subject.


Re: Why I have chosen not to employ clojure

2010-03-21 Thread Luc Préfontaine
An IDE becomes a necessity as the complexity of your software is
increasing.

Now what's a complex piece of software ?

Presently we have 12 components in production some being several
thousand lines covering three languages (Java, Ruby and Clojure).
4 others components are in progress. Add to this that we use Spring and
a number of other frameworks for which plug ins are
available to ease the pain.

Refactoring, code searching, configuration validation, ... are
significant features we need otherwise we would spend a lot of time
to keep things in sync,

We started to work with Clojure in command line mode. However at a
certain moment it became clear that keeping Clojure
separate from the rest of the core was not the way to go. Today we are
mixing components from different languages/frameworks
in common Jars. Deployment is much more easier this way and using a
common IDE makes that possible.

If the consensus is that we need to package installers to get simple
Clojure REPLs running on
Windows and Linux in a command line window then let's do it. I think
that all the infrastructure is ready (maven like repo, ...).


Luc


On Sun, 2010-03-21 at 22:52 -0500, Cosmin Stejerean wrote:

> On Sun, Mar 21, 2010 at 10:20 PM, Luc Préfontaine
>  wrote:
> 
> 
> Yes we could have a complete package to run Clojure from the
> shell command line but how far could someone go with this
> to build a workable system without an IDE ?
> 
> 
> 
> [...]
>  
> Comments anyone ?
> 
> 
> 
> 
> I can get pretty far writing an application in Python with nothing
> more than good command line support and syntax highlighting in any
> text editor. Anything extra like completions, refactoring, etc, are
> just nice-to-haves. I don't see why an IDE is required for writing
> workable Clojure apps.
>  
> 
> -- 
> Cosmin Stejerean
> http://offbytwo.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
>  
> To unsubscribe from this group, send email to clojure
> +unsubscribegooglegroups.com or reply to this email with the words
> "REMOVE ME" as the subject.

-- 
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

To unsubscribe from this group, send email to 
clojure+unsubscribegooglegroups.com or reply to this email with the words 
"REMOVE ME" as the subject.


Printing promises

2010-03-21 Thread Per Vognsen
The print-method for IDerefs by default dereferences anything to be
printed. Right now it has a special type check for futures but not for
promises. It makes promises nearly impossible to debug or to use from
the REPL. The current implementation of promises uses reify rather
than deftype, so there is currently no type or tag by which to
discriminate. As a solution, I factored the reify out into a deftype:

http://gist.github.com/339834

Unfortunately, the Promise deftype is no longer intercepted by the
print-method for IDerefs. I guess it has to do with the deftype
hierarchy vs Java hierarchy. Maybe someone more familiar with deftype
can figure this one out. For now, what I have is good enough to get on
with my immediate coding.

-Per

-- 
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

To unsubscribe from this group, send email to 
clojure+unsubscribegooglegroups.com or reply to this email with the words 
"REMOVE ME" as the subject.


Re: Printing promises

2010-03-21 Thread Meikel Brandmeyer
Hi,

On Mar 22, 7:13 am, Per Vognsen  wrote:

> As a solution, I factored the reify out into a deftype:
>
> http://gist.github.com/339834

A short note: you don't have to use :keyword notation in the methods.
The attributes of the type are available under their names. See here:
http://paste.pocoo.org/show/192446.

> Unfortunately, the Promise deftype is no longer intercepted by the
> print-method for IDerefs. I guess it has to do with the deftype
> hierarchy vs Java hierarchy.

No. The "problem" is, that for each type there is a unique print-
method installed by deftype. You have to re-define this method and
call the method for clojure.lang.IDeref directly. (See also above
paste.)

Sincerely
Meikel

-- 
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

To unsubscribe from this group, send email to 
clojure+unsubscribegooglegroups.com or reply to this email with the words 
"REMOVE ME" as the subject.


Re: Why I have chosen not to employ clojure

2010-03-21 Thread Miron Brezuleanu
Hello all,

On Sun, Mar 21, 2010 at 8:42 PM, Tim Johnson  wrote:
> I have evaluated clojure for the last couple of days, and it is both my own
> professional decision and my recommendation to the professional organizations
> that I belong to and report to that clojure is not ready for prime time.
>

Since I had a pretty smooth experience with Clojure right from the
start, despite having little experience with Java, I'll try to
describe what made it easy for me - maybe this will help someone
trying to come up with improvements to the initial experience.

For me, having the "Programming Clojure" zip file available was great.
Being able to just run bin/repl.bat (or .sh) whenever I wanted to try
something out - even if it involved some of the additional libraries,
such as the database connectivity stuff - was just great. Running it
from an Emacs shell to get better history navigation etc. was also
very nice (I  never got as far as using Slime, even though I should
probably try it sometimes). Well, with the minor caveat that Emacs and
jline don't always play nice, so I removed jline from the .bat after
wondering for a while why (+ 1 1) sent to the Clojure REPL inside
Emacs never returns :-)

So maybe this is a way to make friendly environments for beginners.
Maybe it's enough make more "Programming Clojure"-like environments,
targeted towards beginners, beginners interested in web/database
access, beginners with an interest in graphics, etc. Some script (or
just instructions about how to do it) to update clojure.jar and the
libs would be nice too. Care must be taken to keep things easy - the
script should not try to compile anything, just attempt to download
updated versions - trying to compile stuff would increase friction for
newbies.

The great part about the "Programming Clojure" environment is not that
it makes very hard things easy - but that it makes simple tasks very
simple (no need to download and configure Compojure, it's just there).
Just reducing friction seems to be a very good idea, things are more
likely to be tried out when they are just a few keystrokes away.

As for the original poster, it's weird that he evaluates Clojure for
just two days - and decides that although the technical principles it
is based on are sound, the whole thing should be dismissed because of
the first 'tactical' hurdle - installing. Maybe the guy is used to
evaluating things by reading marketing texts? Maybe the CLASSPATH is
really such a big problem? (this is hard to evaluate for someone used
to the command line).

Nevertheless, it would be dangerous to ignore or dismiss his troubles,
as they are probably quite common, so if anyone is thinking about how
to improve the situation, maybe my opinion above of what made me happy
with Clojure at the beginning is useful.

Oh, and "Programming Clojure" itself was great in making me see how to
use Clojure in practice (I already knew it was great in theory, but
the book made the practice-theory gap much smaller). So maybe the book
(or the coming books) should be promoted more?

Bye,

> Before any of you think that I am a disgruntled newbie turned troll, know
> the following:
>
> 1)As soon as I see the copy of this email in my "clojure mailbox", I will
> unsubscribe from this mailing list, delete the clojure mailbox and I will not
> be following up in any way.
>

-- 
Miron Brezuleanu

-- 
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

To unsubscribe from this group, send email to 
clojure+unsubscribegooglegroups.com or reply to this email with the words 
"REMOVE ME" as the subject.