Re: better community docs: getting started

2011-07-25 Thread Sean Corfield
On Sun, Jul 24, 2011 at 9:14 PM, Ken Wesson kwess...@gmail.com wrote:
 Under 2) would be a guide for setting up Emacs (immediately divided
 into Mac, Windows, Linux).  At the end would be a list of alternative
 options: Eclipse, Netbeans, IntelliJ, etc.

 No.

 No, no, no, no, no!

 That will kill 90% of the people that try it as potential future
 Clojurians. They'll install emacs, try to use it, throw keyboards out
 windows and mice through monitors, say What? Huh? WTF is this shit!?

For once I'm in complete agreement with Ken - trying to push Emacs as
the recommended editor for Clojure would be a disaster!

We need to be very clear that pretty much whatever IDE / editor you
use today can be used for Clojure.

Having the Getting Clojure section focus on Leiningen to handle
dependencies, run a REPL and run Clojure scripts (with a -main
function) is a great way to get people started.

I do not think we should attempt a recommended IDE (not even Clooj).
We should offer a path for all existing IDEs / editors. If you're an
Eclipse user, try CCW. If you're an existing Emacs user, here's how to
configure it for Clojure. If you're a TextMate user, here's the
Clojure bundle. And so on. Use an editor not listed here? Try Clooj
(i.e., use this as a simple catch-all if we haven't covered what you
already used today).

Sean

-- 
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: clojure.contrib.profile crashes

2011-07-25 Thread Sunil S Nandihalli
Hi Aaron Bedra,
 Thanks for your quick response. Sorry I could not get back to you with the
information you asked for sooner..

 I am using

user *clojure-version*
{:major 1, :minor 2, :incremental 1, :qualifier }

My project.clj is as follows...

(defproject bitvector 1.0.0-SNAPSHOT
  :description FIXME: write description
  :dependencies [[org.clojure/clojure 1.2.1]
 [org.clojure/clojure-contrib 1.2.0]
 [clj-iterate 0.95-SNAPSHOT]]
  :dev-dependencies [[swank-clojure 1.4.0-SNAPSHOT]
 [clojure-source 1.2.1]]
  :main bitvector.core)

do you have any idea why I am getting this out of range thing when I use
clojure.contrib.profile?

Thanks again,
Sunil.

On Fri, Jul 22, 2011 at 4:51 AM, Aaron Bedra aaron.be...@gmail.com wrote:

 **
 What version of Clojure are you running?

 Cheers,

 Aaron Bedra
 --
 Clojure/core
 http://clojure.com


 On 07/21/2011 06:12 PM, Sunil S Nandihalli wrote:

 The reason I am not posting the code is because I am not able to reproduce
 this on a simple case. I was just hoping some of you may have some insight
 with out the code..
 Thanks,
 Sunil.

  On Fri, Jul 22, 2011 at 3:29 AM, Sunil S Nandihalli 
 sunil.nandiha...@gmail.com wrote:

 Hello everybody,
  I have used the profiler successfully in the past. But some how it is
 repeatedly crashing with the following stack trace.

  Value out of range for int: 17069635385


   [Thrown class java.lang.IllegalArgumentException]





 Restarts:


  0: [QUIT] Quit to the SLIME top level





 Backtrace:


   0: clojure.lang.RT.intCast(RT.java:950)


   1: clojure.lang.RT.intCast(RT.java:922)


   2: clojure.contrib.profile$summarize$fn__3252.invoke(profile.clj:88)


   3: clojure.core$r.invoke(core.clj:799)


   4: clojure.contrib.profile$summarize.invoke(profile.clj:85)


   5: bitvector.core$eval4530.invoke(NO_SOURCE_FILE:1)


   6: clojure.lang.Compiler.eval(Compiler.java:5424)


   7: clojure.lang.Compiler.eval(Compiler.java:5391)


   8: clojure.core$eval.invoke(core.clj:2382)


   9: swank.core$eval650$fn__651.invoke(core.clj:409)


  10: clojure.lang.MultiFn.invoke(MultiFn.java:163)


  .
 .
  .
 .

  Before I bother you all with actual code which might get messy, does
 anybody have any suggestion as to why this is happening..?
 Thanks,
 Sunil.


  --
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clojure@googlegroups.com
 Note that posts from new members are moderated - please be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en


  --
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clojure@googlegroups.com
 Note that posts from new members are moderated - please be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: clojure.contrib.profile crashes

2011-07-25 Thread Sunil S Nandihalli
here is the list of jar files in my lib directory

github@eagle ~/bitvector/lib#tree
.
|-- clj-iterate-0.95-20110417.030036-2.jar
|-- clojure-1.2.1.jar
|-- clojure-contrib-1.2.0.jar
`-- dev
|-- cdt-1.2.6.1-20110417.030036-6.jar
|-- clojure-1.2.1.jar
|-- clojure-contrib-1.2.0.jar
|-- clojure-source-1.2.1.jar
|-- debug-repl-0.3.1.jar
`-- swank-clojure-1.4.0-20110601.165758-9.jar

1 directory, 9 files


On Mon, Jul 25, 2011 at 12:10 PM, Sunil S Nandihalli 
sunil.nandiha...@gmail.com wrote:

 Hi Aaron Bedra,
  Thanks for your quick response. Sorry I could not get back to you with the
 information you asked for sooner..

  I am using

 user *clojure-version*
 {:major 1, :minor 2, :incremental 1, :qualifier }

 My project.clj is as follows...

 (defproject bitvector 1.0.0-SNAPSHOT
   :description FIXME: write description
   :dependencies [[org.clojure/clojure 1.2.1]
  [org.clojure/clojure-contrib 1.2.0]
  [clj-iterate 0.95-SNAPSHOT]]
   :dev-dependencies [[swank-clojure 1.4.0-SNAPSHOT]
  [clojure-source 1.2.1]]
   :main bitvector.core)

 do you have any idea why I am getting this out of range thing when I use
 clojure.contrib.profile?

 Thanks again,
 Sunil.

 On Fri, Jul 22, 2011 at 4:51 AM, Aaron Bedra aaron.be...@gmail.comwrote:

 **
 What version of Clojure are you running?

 Cheers,

 Aaron Bedra
 --
 Clojure/core
 http://clojure.com


 On 07/21/2011 06:12 PM, Sunil S Nandihalli wrote:

 The reason I am not posting the code is because I am not able to reproduce
 this on a simple case. I was just hoping some of you may have some insight
 with out the code..
 Thanks,
 Sunil.

  On Fri, Jul 22, 2011 at 3:29 AM, Sunil S Nandihalli 
 sunil.nandiha...@gmail.com wrote:

 Hello everybody,
  I have used the profiler successfully in the past. But some how it is
 repeatedly crashing with the following stack trace.

  Value out of range for int: 17069635385


   [Thrown class java.lang.IllegalArgumentException]





 Restarts:


  0: [QUIT] Quit to the SLIME top level





 Backtrace:


   0: clojure.lang.RT.intCast(RT.java:950)


   1: clojure.lang.RT.intCast(RT.java:922)


   2: clojure.contrib.profile$summarize$fn__3252.invoke(profile.clj:88)


   3: clojure.core$r.invoke(core.clj:799)


   4: clojure.contrib.profile$summarize.invoke(profile.clj:85)


   5: bitvector.core$eval4530.invoke(NO_SOURCE_FILE:1)


   6: clojure.lang.Compiler.eval(Compiler.java:5424)


   7: clojure.lang.Compiler.eval(Compiler.java:5391)


   8: clojure.core$eval.invoke(core.clj:2382)


   9: swank.core$eval650$fn__651.invoke(core.clj:409)


  10: clojure.lang.MultiFn.invoke(MultiFn.java:163)


  .
 .
  .
 .

  Before I bother you all with actual code which might get messy, does
 anybody have any suggestion as to why this is happening..?
 Thanks,
 Sunil.


  --
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clojure@googlegroups.com
 Note that posts from new members are moderated - please be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en


  --
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clojure@googlegroups.com
 Note that posts from new members are moderated - please be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en




-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: Clojure number crunching win ! was Re: Needing type hinting help for number crunching

2011-07-25 Thread Tassilo Horn
Sean Corfield seancorfi...@gmail.com writes:

Hi Sean,

 If you specify the Sonatype snapshots repository, you can pull nightly
 builds:

   :repositories { sonatype { :url
 https://oss.sonatype.org/content/repositories/snapshots; } }
   :dependencies [[org.clojure/clojure 1.3.0-master-SNAPSHOT]]

 That just pulled clojure-1.3.0-master-20110622.000355-98.jar which is
 the most recent nightly build according to build.clojure.org.

Hey, great.  Until now, I've built my own snapshots, because the
official snapshots are out of date.  The only issue is that with the
repo above, version ranges don't work.  If I say

  :dependencies [[org.clojure/clojure [1.3.0-master-SNAPSHOT,)]]

aka 1.3.0 snapshot or better, lein deps force tries getting a
org.clojure:clojure:jar:1.3.0-testbuild9-SNAPSHOT and fails checksuming
(at least that is what maven wants to tell me...):

[WARNING] *** CHECKSUM FAILED - Checksum failed on download: local =
'88bbc831eaafdd9895f27debc95446618ac82a79'; remote =
'92472231000f7b66ebf43cb412c74b4ba3cd7277' - RETRYING
[WARNING] *** CHECKSUM FAILED - Checksum failed on download: local =
'88bbc831eaafdd9895f27debc95446618ac82a79'; remote =
'92472231000f7b66ebf43cb412c74b4ba3cd7277' - IGNORING

Bye,
Tassilo

-- 
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: better community docs: getting started

2011-07-25 Thread pmbauer


 I do not think we should attempt a recommended IDE (not even Clooj).
 We should offer a path for all existing IDEs / editors. 

... 

 Use an editor not listed here? Try Clooj
 (i.e., use this as a simple catch-all if we haven't covered what you
 already used today).


That's one way of organizing it.

The slightly serious explorer will of course pick setup documentation for 
their favorite IDE/editor, and that should be provided.

But think of the casual dev wanting to know what Clojure and a typical 
Clojure toolchain can do for her ASAP.
Most Java devs have never used a repl-aware edit buffer, something most of 
us take for granted.
No common IDE/editor setup can expose her to a lisp-style toolchain in a 
single click.  None.

For usability, nothing beats the single-click.  In seconds, Clooj gives her 
a one-stop-shop.
So I see Clooj as something worth putting right along with try-clojure.org.
It not only showcases Clojure, but is rapid exposure to the lisp-style 
toolchain.

That's why I would give Clooj some prominence rather than burying it at the 
bottom of the decision tree.
Anyone knowing what they're looking for will of course move on to the setup 
of their preference (emacs,vi,eclipse), so they don't lose anything.
But the neophyte who doesn't know what they're looking for should have the 
lowest barrier to entry possible - usability.

-- 
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: Why is this code so slow?

2011-07-25 Thread Oskar
On Jul 23, 4:06 pm, Dmitry Gutov raa...@gmail.com wrote:
 Ahem.

 Here is a more idiomatic version that runs under half a second, no
 annotations required.

I did that from the beginning, but as I really needed 4e6 and not 1e5
elements, that map got very big. And I didn't remember the argument to
give java more memory. Also I was just curious to see what arrays did
to the performance. However, my code that looked like that was slow
too. I used Clojure 1.2.0. Are you using 1.3.0?


 (def vs (atom {}))

 (defn sk [k]
   (if (@vs k)
       (@vs k)
       (let [ans (if ( k 56)
                   (- (mod (+ 13 (- (* k 23)) (* 37 k k k))
                           100) 50)
                   (- (mod (+ (sk (- k 24))
                              (sk (- k 55))) 100)
                      50))]
         (do (swap! vs assoc k ans)
             ans

 user (reset! vs {})
 {}
 user (time (dorun (map sk (range 10
 Elapsed time: 155.082351 msecs
 nil

 I guess the moral is that the built-in data structures are quite fast,
 and reflection is evil.

-- 
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: better community docs: getting started

2011-07-25 Thread Ken Wesson
On Mon, Jul 25, 2011 at 12:28 AM, pmbauer paul.michael.ba...@gmail.com wrote:
 +1 on clooj.
 One click and you have a working build environment, REPL, and REPL-aware
 editor.
 https://github.com/downloads/arthuredelstein/clooj/clooj-0.1.5-standalone.jar

This URL is somewhat unfortunate. For some reason, both

https://github.com/downloads/arthuredelstein/clooj/

and

https://github.com/downloads/arthuredelstein/

give 404 pages, so it's not possible to use .. walking to get to the
parent node -- i.e., Edelstein's Clooj page as a whole, and then
Edelstein's everything-including-Clooj page. That's poor URL design,
but it's probably not Edelstein's fault, but rather github's.

I'd argue that this is another reason for having separate sites for
projects, sites hosted away from places like sourceforge and github
(but linking to those); a generic web host will let you use a better
URL structure so people who, say, only see your download link posted
somewhere and want to read more before committing to downloading
anything can just chop the last segment off your URL and read away.

-- 
Protege: What is this seething mass of parentheses?!
Master: Your father's Lisp REPL. This is the language of a true
hacker. Not as clumsy or random as C++; a language for a more
civilized age.

-- 
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: better community docs: getting started

2011-07-25 Thread Ambrose Bonnaire-Sergeant
Yep, Github URLs suck like that.

FWIW this is probably close what you're looking for:
https://github.com/arthuredelstein/clooj/downloads

Ambrose

-- 
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: better community docs: getting started

2011-07-25 Thread cljneo
ClojureScript release has changed things now and I guess that getting 
started with ClojureScript will probably change as it gets closer to a 
release. But anyway, I suggest a getting started page along these lines:


* *Meet Clojure*
  - Try Clojure online http://try-clojure.org/ or on your 
machinehttps://github.com/arthuredelstein/clooj/downloadswhile reading this 
Introductory 
Article. // the article should actually point to an updated copy of the 
ociweb article
  - For further education: 
   * Links to four or five introductory videos
   * Thumbnails of the each of the Clojure book covers that link to 
Amazon.

Note: 
  - The link to CLOOJ should not point to github but to CLOOJ website which 
I hope it would develop to be a Racket like environment (probably with teach 
packs or an integrated Teaching Lab - labrepl). 
  - CLOOJ needs a step-by-step tutorial to build a simple application. The 
idea is to get the workflow of developing using a REPL and moving to 
application files, build and get a running jar. 
   
*  *Experienced* *Programmers*: Build your first application with your 
favorite
  - IDE: Eclipse, NetBeans, JetBrains IDEAJ. (each is an icon of the IDE and 
links to a separate page that directs to the respective IDE addon  and other 
tools if needed).
  - Editor: Emacs, Vim, (other editors?). (again, each is an icon of the 
editor and links to a separate page).

The articles for IDEs and editors should flow like the development workflow 
and ask the user to download and install the necessary tools he will need 
along the way to get a complete simple application. These articles should 
refer to each other and should actually repeat the information as if the 
other articles do not exist. Furthermore, they will point to articles about 
lein, cake, maven and other tools and why they need them but these later 
ones shouldn't be top level articles.

-- 
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: better community docs: getting started

2011-07-25 Thread Mark Derricutt
I just thought - Java Webstart based clooj direct from try-clojure.org.

Mark

On 25/07/2011, at 6:51 PM, pmbauer wrote:

 For usability, nothing beats the single-click.  In seconds, Clooj gives her a 
 one-stop-shop.
 So I see Clooj as something worth putting right along with try-clojure.org.
 It not only showcases Clojure, but is rapid exposure to the lisp-style 
 toolchain.
 

-- 
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: Alright, fess up, who's unhappy with clojurescript?

2011-07-25 Thread Mark Derricutt
Oracle announced/talked about Nashorn at the recent JVM Languages summit, this 
is an Invoke Dynamic based Javascript runtime which is (aiming) for inclusion 
in JDK8.

I do so hope however that someone manages to pull that out for a lets run this 
NOW on Java 7 as that would be a great improvement over rhino.

On 25/07/2011, at 3:54 AM, Stuart Halloway wrote:

 Rhino is an implementation detail of the development platform. That 
 implementation detail could and probably should change.

-- 
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: better community docs: getting started

2011-07-25 Thread Sean Corfield
On Sun, Jul 24, 2011 at 11:51 PM, pmbauer paul.michael.ba...@gmail.com wrote:
 But think of the casual dev wanting to know what Clojure and a typical
 Clojure toolchain can do for her ASAP.

I find it hard to imagine a casual dev that doesn't already have a
preferred editor - but I'm certainly not averse to promoting Clooj to
folks who don't have a strong IDE predilection.

 Most Java devs have never used a repl-aware edit buffer, something most of
 us take for granted.

Most Java devs have a strong affinity for a specific IDE tho'...

 That's why I would give Clooj some prominence rather than burying it at the
 bottom of the decision tree.

Well, then put it at the top with the tag line If you don't have a
strong affinity for a specific IDE or editor, why not try Clooj which
is a simple, lightweight editor focused on Clojure? Otherwise see the
options below for adding Clojure support to your favorite IDE...
-- 
Sean A Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/
World Singles, LLC. -- http://worldsingles.com/
Railo Technologies, Inc. -- http://www.getrailo.com/

Perfection is the enemy of the good.
-- Gustave Flaubert, French realist novelist (1821-1880)

-- 
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: Clojure number crunching win ! was Re: Needing type hinting help for number crunching

2011-07-25 Thread Sean Corfield
On Sun, Jul 24, 2011 at 11:45 PM, Tassilo Horn tass...@member.fsf.org wrote:
 The only issue is that with the
 repo above, version ranges don't work.  If I say

  :dependencies [[org.clojure/clojure [1.3.0-master-SNAPSHOT,)]]

Your Maven-fu is far off the scale - I didn't even know that kind of
thing should be possible :)

I use Leiningen specifically to avoid having to learn that sort of stuff...
-- 
Sean A Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/
World Singles, LLC. -- http://worldsingles.com/
Railo Technologies, Inc. -- http://www.getrailo.com/

Perfection is the enemy of the good.
-- Gustave Flaubert, French realist novelist (1821-1880)

-- 
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: better community docs: getting started

2011-07-25 Thread Mark Derricutt
I just thought - Java Webstart based clooj direct from try-clojure.org.



On 25/07/2011, at 6:51 PM, pmbauer wrote:

 For usability, nothing beats the single-click.  In seconds, Clooj gives her a 
 one-stop-shop.
 So I see Clooj as something worth putting right along with try-clojure.org.
 It not only showcases Clojure, but is rapid exposure to the lisp-style 
 toolchain.
 

-- 
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: clojurescript development workflow

2011-07-25 Thread Sam Aaron

On 24 Jul 2011, at 23:10, Eric Lavigne wrote:
 
 Also, look for a recent post by Peter Taoussanis. It sounds like he has come 
 up with a very good workflow for ClojureScript development.

That certainly looks very interesting and exactly the kind of thing I was 
looking for. 

Also, with respect to the lack of ability to interact with the browser directly 
through the REPL or editor like with emacs-swank-slime, is it fair to assume 
that this is just due to the current implementation being Rhino-based? Also 
ClojureScript doesn't support eval, I'm assuming JavaScript does - otherwise we 
wouldn't have so many AJAX tricks where websites spit bits of js at the browser 
to manipulate the dom. I'm therefore wondering if it will eventually be 
possible to spit fragments of compiled ClojureScript at a browser to do similar 
things?

Sam

---
http://sam.aaron.name

-- 
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: better community docs: getting started

2011-07-25 Thread Michael Wood
On 25 July 2011 09:41, Sean Corfield seancorfi...@gmail.com wrote:
 On Sun, Jul 24, 2011 at 11:51 PM, pmbauer paul.michael.ba...@gmail.com 
 wrote:
[...]
 That's why I would give Clooj some prominence rather than burying it at the
 bottom of the decision tree.

 Well, then put it at the top with the tag line If you don't have a
 strong affinity for a specific IDE or editor, why not try Clooj which
 is a simple, lightweight editor focused on Clojure? Otherwise see the
 options below for adding Clojure support to your favorite IDE...

+1

-- 
Michael Wood esiot...@gmail.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: better community docs: getting started

2011-07-25 Thread abp
 * *Meet Clojure*

That's also an upcoming book on Clojure:

http://meetclj.raynes.me/

-- 
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: Alright, fess up, who's unhappy with clojurescript?

2011-07-25 Thread Colin Yates
Absolutely nothing to add to the argument as such except to say that I am
quite surprised at the level of resistance to James' thread.  I can see the
argument if this was the 'dev' mailing list.

I have been reading this mailing list for a long while now (even if I
haven't contributed much to it) but if this had been the first post I had
read I would have a very negative opinion of the *clojure community*.  It
comes off as sounding like if you don't like what we do, go away - it is
our way or the highway, which would be a terrible shame as I don't *think*
that is the case?  If I wanted that atmosphere there are plenty of other
places to go.

Sure, I get that James' email didn't really provide any points of
discussion, it was more a moan (sorry James ;)), but so what - I don't see
anybody shooting down ClojureScript - I love it type posts.  And maybe a
better response would be asking OK, this guy clearly doesn't get it - how
can we improve our communication?

Rich - we are *all* grateful and I expect I am not alone in being amazed at
the technical marvel you have pulled out of the hat.  But to be honest I
think you need a thicker skin.  Getting your strokes from the mailing list
is dangerous at best.  To be disheartened by one negative post in the midst
of positive votes is a bit worrying.

If this mailing list is for the community to discuss Clojure and ask
Clojurians for help then these responses were inappropriate.  If this
mailing list is to big up Clojure then fine - but make that explicit.

Col (surprisingly disappointed and feels strongly enough to send this at the
risk of being called a troll himself!)

P.S.  Strongly opinionated communities that shoots down criticisms of the
great leaders' achievements is unfortunately not breaking new ground - so
stop this :) and move onto the next ground breaking tool!

On 25 July 2011 08:38, Mark Derricutt m...@talios.com wrote:

 Oracle announced/talked about Nashorn at the recent JVM Languages summit,
 this is an Invoke Dynamic based Javascript runtime which is (aiming) for
 inclusion in JDK8.

 I do so hope however that someone manages to pull that out for a lets run
 this NOW on Java 7 as that would be a great improvement over rhino.


 On 25/07/2011, at 3:54 AM, Stuart Halloway wrote:

 Rhino is an implementation detail of the development platform. That
 implementation detail could and probably should change.


  --
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clojure@googlegroups.com
 Note that posts from new members are moderated - please be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en


-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: Alright, fess up, who's unhappy with clojurescript?

2011-07-25 Thread Ken Wesson
On Mon, Jul 25, 2011 at 5:08 AM, Colin Yates colin.ya...@gmail.com wrote:
 Absolutely nothing to add to the argument as such except to say that I am
 quite surprised at the level of resistance to James' thread.  I can see the
 argument if this was the 'dev' mailing list.
 I have been reading this mailing list for a long while now (even if I
 haven't contributed much to it) but if this had been the first post I had
 read I would have a very negative opinion of the *clojure community*.  It
 comes off as sounding like if you don't like what we do, go away - it is
 our way or the highway, which would be a terrible shame as I don't *think*
 that is the case?  If I wanted that atmosphere there are plenty of other
 places to go.
 Sure, I get that James' email didn't really provide any points of
 discussion, it was more a moan (sorry James ;)), but so what - I don't see
 anybody shooting down ClojureScript - I love it type posts.  And maybe a
 better response would be asking OK, this guy clearly doesn't get it - how
 can we improve our communication?
 Rich - we are *all* grateful and I expect I am not alone in being amazed at
 the technical marvel you have pulled out of the hat.  But to be honest I
 think you need a thicker skin.  Getting your strokes from the mailing list
 is dangerous at best.  To be disheartened by one negative post in the midst
 of positive votes is a bit worrying.
 If this mailing list is for the community to discuss Clojure and ask
 Clojurians for help then these responses were inappropriate.  If this
 mailing list is to big up Clojure then fine - but make that explicit.

 Col (surprisingly disappointed and feels strongly enough to send this at the
 risk of being called a troll himself!)

 P.S.  Strongly opinionated communities that shoots down criticisms of the
 great leaders' achievements is unfortunately not breaking new ground - so
 stop this :) and move onto the next ground breaking tool!

+1 to all of that.

-- 
Protege: What is this seething mass of parentheses?!
Master: Your father's Lisp REPL. This is the language of a true
hacker. Not as clumsy or random as C++; a language for a more
civilized age.

-- 
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: Why is this code so slow?

2011-07-25 Thread Dmitry Gutov
Clojure 1.2.1 here.

4e6 takes about 10 seconds, the process uses ~500Mb of RAM. `lein
repl` is fine with that.
Python takes 5, but that's acceptable difference, I think, considering
we're talking immutable vs mutable here.

If you still have the old code, I'd like to take a look.

On Jul 25, 10:54 am, Oskar oskar.kv...@gmail.com wrote:
 On Jul 23, 4:06 pm, Dmitry Gutov raa...@gmail.com wrote:

  Ahem.

  Here is a more idiomatic version that runs under half a second, no
  annotations required.

 I did that from the beginning, but as I really needed 4e6 and not 1e5
 elements, that map got very big. And I didn't remember the argument to
 give java more memory. Also I was just curious to see what arrays did
 to the performance. However, my code that looked like that was slow
 too. I used Clojure 1.2.0. Are you using 1.3.0?

-- 
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: Alright, fess up, who's unhappy with clojurescript?

2011-07-25 Thread cassiel
Clojure newcomer here, but here's the thought that's frontmost in my
mind about ClojureScript...

I'm used to Clojure as a language that's solidly spot-welded to the
JVM and the Java libraries. Just as [1 2 3] is legal portable
Clojure code, so is (.start (Thread. #(...))) despite it being a
blatant set of calls into Java, and so are the various Java-leaning
reflection features.

I think ClojureScript is a great piece of work, but I'm not sure what
this means for language standardisation or portability. Is it still
real Clojure? Clearly I can write programs, or distribute libraries,
which run on one but not the other. Similarly, I'm sure there are
common chunks of functionality (although I'm not enough of a JS
programmer to suggest any) which are pretty crucial to some programs
written in either Clojure but implemented differently. ClojureScript
is still missing key parts of Clojure (e.g. agents) making even non-
Java-ish programs non(-yet)-portable.

I guess I'm interested in the road map, if any: are things heading
towards some kind of common ClojureCore specification with
ClojureJava and ClojureScript both supersets of this? What are the
ramifications for library distribution? Or are Clojure Classic and
ClojureScript different systems for different environments? In which
case, what mileage is there in identifying and specifying the
overlapping and identical areas and transparently developing for both?

Sorry if the questions are stupid... I'm looking forward to having a
good solid session with ClojureScript in a browser near me soon.

-- 
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: Alright, fess up, who's unhappy with clojurescript?

2011-07-25 Thread James Keats



Right, Rich, please allow me to reply to the points you mentioned; I
declined from doing so last night as I sensed some unintentionally
irritated feelings, which I hope have eased a bit by now. I believe
all my posts in this discussion are purely technical concerns and I
believe them to be valid. I am most definitely not a troll as some
have suggested; I would've had to do a ridiculous amount of homework
over a long, long period of time and been a psychic to predict this
event (I've only found out clojurescript in the past couple of days),
and I do not believe in any way I'm making an attempt at humor in the
technical arguments I'm making.

On Jul 24, 10:28 pm, Rich Hickey richhic...@gmail.com wrote:
 On Jul 24, 11:19 am, James Keats james.w.ke...@gmail.com wrote:

  Alright, to be honest, I'm disappointed.

 I'll make sure you get a refund then.

 Seriously, this is like being disappointed an action movie was an
 action movie instead of a comedy. Your expectations are a complete
 mismatch for the intentions of ClojureScript.

clojure's rocks... javascript reaches


  First of all, congrats and good job to all involved in putting it out.
  On the plus side, it's a good way to use the Google Closure javascript
  platform.

  On the minus, imho, that's what's wrong with it.

  Google Closure is too Java.

 Actually, it's too JavaScript. Some JS proponents want to disavow its
 pseudo class model, but it certainly is part of the design of
 JavaScript. And it has some particular advantages over the other
 strategies, as outlined here:

 http://bolinfest.com/javascript/inheritance.php

Rich, the pseudo class model with the new keyword is a syntactic
obfuscation, semantically javascript is prototypical inheritance. It's
class free. In addition to the pseudo class inheritance advocated by
google closure and the prototypical inherent in javascript, others
like Doug Crockford advocated functional inheritance.

Now I have watched and read enough of your output and for example
Stuart Holloways talk about protocols to know that you've railed in
your adovacy of clojure against classes and inheritance, and find it
ironic that now you posit a link by an advocate of it citing it as
advantageous. In any case, as I've mentioned, I have been aware of
this article for nearly a year now, it failed to convince me back then
and it still does; most of the arguments in it concern the closure
compiler, an obeisance to which by the regular developer who doesn't
have the needs and resources of google, I feel in this day and age of
ample memory and bandwidth and fast javascript engines, is premature
optimization gone berserk (seriously, folks, people are streaming HD
video, 1.5 gbps fiber optic broadband is being rolled out in London
and soon other cities worldwide and 4G mobiles are upon and we're
fretting over mere tens of KB that gets cached after first time and
basing our development around minimizing it?!), and the remainder of
the arguments are in support of classes and inheritance.


  It's not idiomatic JavaScript.

 There's no such thing as idiomatic JavaScript. There are a lot of
 different conventions used by different libraries.


The Javascript community - the vast majority of which - after a decade
and a half now of experience with the language has come to regard some
aspect of it as good and others as problematic; things like functional
programming and object literals (akin to clojure's maps/structs/
records) vs classical inheritance, which are positions you yourself
have taken and advocated.

  I find it
  disappointing that rather than porting from a functional language like
  Clojure straight to another functional language like Javascript, the
  google closure with its ugly Java-isms is right there obnoxiously in
  the middle.

 In the middle of what? I look at ClojureScript code and it looks like
 Clojure to me. Google Closure is under, and it is no more annoying
 there than Java is under Clojure - an implementation detail, and a
 rich source of production-quality code.

I respectfully dispute that; for what they both do - dom, css, ajax,
events, cookies, ui, effects, animations etc - jquery does it far
better and is much more pleasant an api. What jquery itself doesn't do
the huge ecosphere of libs around it do, for example:
http://metajack.im/2009/03/13/jquery-and-strophe-made-for-each-other/
http://strophe.im/



  Then, there's the elephant in the room, and that elephant is Jquery. I
  believe any targetting-javascript tool that misses out on jquery-first-
  and-foremost is missing out on the realities of javascript in 2011.

 Should it be the purpose of a new language like ClojureScript to
 orient itself around the realities of currently popular JavaScript
 libraries? I think not.
 If you want jQuery as the center of your
 universe, JavasScript is your language - good luck with it. I see
 jQuery as a tool to be leveraged when appropriate (i.e. rarely in
 large programs), not an architectural centerpiece.



Re: ClojureScript Questions

2011-07-25 Thread Nick Zbinden


On Jul 25, 7:51 am, cljneo cljneoph...@gmail.com wrote:
 Hi,
 I have started reading about ClojureScript and Closure and had some
 questions which I am sure will eventually be answered as I move along.
 But I am too eager to know now so I thought of asking instead of
 waiting.
 - On page 2 of the Closure book, there is a workflow figure on using
 the Closure tools, how would ClojureScript change this workflow? It
 would be great to post such a modified diagram to the closure wiki.

Identifing a workflow and implment good tools has just started there
is no definit answer jet.

 - Clojure itself has web development stack (ring, compojure,
 enlive,...). Will some of these libraries be redundant in
 ClojureScript and will be useful only for web development in Clojure
 proper? Or they will still be useful but we will see ClojureScript
 versions of them.

Depens if you use cljs on the client or on the serverside. Something
like ring or compojure could probebly work on a serverside js
implmentation but do not have a lot of use for JS on the clientside.

Librarys like hiccup will probebly work just as well on the client.
Its early days nobody know what will happen. Your best bet is to trie
thing out and tell other people what helped you.

 - Are there any cases where using the current Clojure web development
 libraries would be better than using ClojureScript?

I don't understand that Question. If you want to do Serverside
programming regular Clojure is probebly still better then
ClojureScript with Node.js (or something like that).

The hole application with only Clojure as a language is possible if
you programm the serverside with clojure and deliver ClojureScript to
the client there is not really much redundency.

 Thanks

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
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: Clojure number crunching win ! was Re: Needing type hinting help for number crunching

2011-07-25 Thread Chas Emerick

On Jul 24, 2011, at 4:30 PM, Sean Corfield wrote:

 On Sun, Jul 24, 2011 at 1:11 PM, bernardH
 un.compte.pour.tes...@gmail.com wrote:
 On Jul 24, 2:30 pm, Chas Emerick cemer...@snowtide.com wrote:
 You should be using 1.3.0-beta1 of Clojure 1.3 -- anything with 
 -master-SNAPSHOT is woefully out of date at
 this point.
 Damned, I thought -master-SNAPSHOT was as snapshot of the current
 HEAD.
 Thanks for pointing that out.
 
 If you specify the Sonatype snapshots repository, you can pull nightly builds:
 
  :repositories { sonatype { :url
 https://oss.sonatype.org/content/repositories/snapshots; } }
  :dependencies [[org.clojure/clojure 1.3.0-master-SNAPSHOT]]
 
 That just pulled clojure-1.3.0-master-20110622.000355-98.jar which is
 the most recent nightly build according to build.clojure.org.
 
 Without that repo, I've no idea what build you'd get...

Right, I should have mentioned that — I unfortunately assumed that Bernard 
didn't have the OSS repo in his config.  Without that, it would resolve to a 
build from December from build.clojure.org if one is using Leiningen.

(I think the only useful artifacts at build.clojure.org that aren't in central 
already are old versions of clojure-contrib (1.0.0 and 1.1.0 AFAICT).  Is that 
what's keeping build.clojure.org/* in Leiningen's default set of searched repos 
these days?)

- Chas

-- 
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: Clojure number crunching win ! was Re: Needing type hinting help for number crunching

2011-07-25 Thread Chas Emerick

On Jul 25, 2011, at 3:47 AM, Sean Corfield wrote:

 On Sun, Jul 24, 2011 at 11:45 PM, Tassilo Horn tass...@member.fsf.org wrote:
 The only issue is that with the
 repo above, version ranges don't work.  If I say
 
  :dependencies [[org.clojure/clojure [1.3.0-master-SNAPSHOT,)]]
 
 Your Maven-fu is far off the scale - I didn't even know that kind of
 thing should be possible :)
 
 I use Leiningen specifically to avoid having to learn that sort of stuff...

Coordinates (including version strings) used by Leiningen are Maven 
coordinates, so the former won't help you avoid their complexities.

FWIW, this is a decent reference page about the semantics of Maven versions, 
version ranges, default conflict resolution, etc:

http://docs.codehaus.org/display/MAVEN/Dependency+Mediation+and+Conflict+Resolution

- Chas

-- 
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: casting and type declaration

2011-07-25 Thread Dmitry Gutov
Type annotations are used at compile time to generate direct method
calls (as opposed to using reflection).

`cast` is a function, so it doesn't do anything until runtime, and it
just delegates to Class#cast.
I don't think it is used much. In the core, it's only called in single-
arity cases for * and +, to make sure that the operand is indeed a
Number.

Not sure about the type inference here. Have you tried with
SourceDataLine imported, but without the annotation? Rich does that in
the example.

On Jul 24, 10:53 pm, Kartik ksara...@gmail.com wrote:
 Hello.  I have the following code snippet to start reading an mp3 file

 (let [file (File. filename)
       stream (AudioSystem/getAudioInputStream file)
       base-format (.getFormat stream)
       decoded-format (AudioFormat. AudioFormat$Encoding/
 PCM_SIGNED ...)
       line-info (DataLine$Info. SourceDataLine decoded-format)
       decoded-stream (AudioSystem/getAudioInputStream decoded-format
 stream)
       line (AudioSystem/getLine line-info)
       buffer (byte-array (* 1024 4))]
   (pprint line)
   (.open line decoded-format)
   (.start line)
   ...)

 This works fine on Mac OSX.  The pprint gives

 #MixerSourceLine com.sun.media.sound.MixerSourceLine@56101751

 When I run it in windows I get

 Can't call public method of non-public class: public void
 com.sun.media.sound.AbstractDataLine.open(javax.sound.sampled.AudioFormat)
 throws javax.sound.sampled.LineUnavailableException
   [Thrown class java.lang.IllegalArgumentException]

 This time the pprint gives

  #DirectSDL com.sun.media.sound.DirectAudioDevice$DirectSDL@173bb67

 The problem is that getLine on windows returns DirectSDL which is a
 private inner class of DirectAudioDevice.  I tried casting it to
 SourceDataLine which is the type I need (which is a literal
 translation of equivalent java code I'm following) by doing

       line (cast SourceDataLine (AudioSystem/getLine line-info))

 But that didn't work.  I had to declare the type like so

       #^SourceDataLine line (AudioSystem/getLine line-info)

 My question is what is the difference between casting and type
 declaration?  Why does one work and not the other in this case?  In
 general, when is one used over the other?

 I found a related post from 
 Richhttp://www.mail-archive.com/clojure@googlegroups.com/msg13283.html
 where he says the let (without type declaration I assume) should allow
 the compiler to infer the type.

 Thanks

 Kartik

-- 
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: Alright, fess up, who's unhappy with clojurescript?

2011-07-25 Thread Alen Ribic
  In the middle of what? I look at ClojureScript code and it looks like
  Clojure to me. Google Closure is under, and it is no more annoying
  there than Java is under Clojure - an implementation detail, and a
  rich source of production-quality code.
 I respectfully dispute that; for what they both do - dom, css, ajax,
 events, cookies, ui, effects, animations etc - jquery does it far
 better and is much more pleasant an api. What jquery itself doesn't do
 the huge ecosphere of libs around it do, for 
 example:http://metajack.im/2009/03/13/jquery-and-strophe-made-for-each-other/http://strophe.im/

Who really cares what library is used at this early, *alpha*, stage of
the project? If you want to prove to yourself and then to others that
jQuery is better suited than Google Closure Library, go ahead and
write your ClojureScript code [1] that utilizes the jQuery library.
Once you are happy with your findings, I suggest you fork the
rationale and write the reasons that justify your beliefs and I'm
sure we all will be eager to listen.

[1] https://gist.github.com/1098417

-Alen

--
Science is what you know, philosophy is what you don't know.
-- Bertrand Russell


On Jul 25, 11:54 am, James Keats james.w.ke...@gmail.com wrote:
 Right, Rich, please allow me to reply to the points you mentioned; I
 declined from doing so last night as I sensed some unintentionally
 irritated feelings, which I hope have eased a bit by now. I believe
 all my posts in this discussion are purely technical concerns and I
 believe them to be valid. I am most definitely not a troll as some
 have suggested; I would've had to do a ridiculous amount of homework
 over a long, long period of time and been a psychic to predict this
 event (I've only found out clojurescript in the past couple of days),
 and I do not believe in any way I'm making an attempt at humor in the
 technical arguments I'm making.

 On Jul 24, 10:28 pm, Rich Hickey richhic...@gmail.com wrote:

  On Jul 24, 11:19 am, James Keats james.w.ke...@gmail.com wrote:

   Alright, to be honest, I'm disappointed.

  I'll make sure you get a refund then.

  Seriously, this is like being disappointed an action movie was an
  action movie instead of a comedy. Your expectations are a complete
  mismatch for the intentions of ClojureScript.

 clojure's rocks... javascript reaches



   First of all, congrats and good job to all involved in putting it out.
   On the plus side, it's a good way to use the Google Closure javascript
   platform.

   On the minus, imho, that's what's wrong with it.

   Google Closure is too Java.

  Actually, it's too JavaScript. Some JS proponents want to disavow its
  pseudo class model, but it certainly is part of the design of
  JavaScript. And it has some particular advantages over the other
  strategies, as outlined here:

 http://bolinfest.com/javascript/inheritance.php

 Rich, the pseudo class model with the new keyword is a syntactic
 obfuscation, semantically javascript is prototypical inheritance. It's
 class free. In addition to the pseudo class inheritance advocated by
 google closure and the prototypical inherent in javascript, others
 like Doug Crockford advocated functional inheritance.

 Now I have watched and read enough of your output and for example
 Stuart Holloways talk about protocols to know that you've railed in
 your adovacy of clojure against classes and inheritance, and find it
 ironic that now you posit a link by an advocate of it citing it as
 advantageous. In any case, as I've mentioned, I have been aware of
 this article for nearly a year now, it failed to convince me back then
 and it still does; most of the arguments in it concern the closure
 compiler, an obeisance to which by the regular developer who doesn't
 have the needs and resources of google, I feel in this day and age of
 ample memory and bandwidth and fast javascript engines, is premature
 optimization gone berserk (seriously, folks, people are streaming HD
 video, 1.5 gbps fiber optic broadband is being rolled out in London
 and soon other cities worldwide and 4G mobiles are upon and we're
 fretting over mere tens of KB that gets cached after first time and
 basing our development around minimizing it?!), and the remainder of
 the arguments are in support of classes and inheritance.



   It's not idiomatic JavaScript.

  There's no such thing as idiomatic JavaScript. There are a lot of
  different conventions used by different libraries.

 The Javascript community - the vast majority of which - after a decade
 and a half now of experience with the language has come to regard some
 aspect of it as good and others as problematic; things like functional
 programming and object literals (akin to clojure's maps/structs/
 records) vs classical inheritance, which are positions you yourself
 have taken and advocated.

   I find it
   disappointing that rather than porting from a functional language like
   Clojure straight to another functional language like Javascript, 

JavaScript is Assembly Language for the Web

2011-07-25 Thread Jimmy

With clojurescript just launched, I thought there might be some
interest in this podcast by Scott Hanselman.
JavaScript is Assembly Language for the Web -
http://www.hanselminutes.com/default.aspx?showID=294

Some discussion regarding the podcast.
http://www.hanselman.com/blog/JavaScriptIsAssemblyLanguageForTheWebPart2MadnessOrJustInsanity.aspx

Regards,
Jimmy

-- 
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: better community docs: getting started

2011-07-25 Thread Mark Derricutt
I just thought - Java Webstart based clooj direct from try-clojure.org.



On 25/07/2011, at 6:51 PM, pmbauer wrote:

 For usability, nothing beats the single-click.  In seconds, Clooj gives her a 
 one-stop-shop.
 So I see Clooj as something worth putting right along with try-clojure.org.
 It not only showcases Clojure, but is rapid exposure to the lisp-style 
 toolchain.
 

-- 
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: clojurescript development workflow

2011-07-25 Thread Eric Lavigne


 Also, with respect to the lack of ability to interact with the browser
 directly through the REPL or editor like with emacs-swank-slime, is it fair
 to assume that this is just due to the current implementation being
 Rhino-based? Also ClojureScript doesn't support eval, I'm assuming
 JavaScript does - otherwise we wouldn't have so many AJAX tricks where
 websites spit bits of js at the browser to manipulate the dom. I'm therefore
 wondering if it will eventually be possible to spit fragments of compiled
 ClojureScript at a browser to do similar things?


Yes, javascript does have eval. I would guess, however, that any javascript
that uses eval would not be compatible with Google Closure's advanced mode.
You can't prune dead code from a code base that uses eval, because the
eval'ed code has the potential to invoke any piece of every library out
there.

If you want to spit fragments of compiled ClojureScript at a browser, as
part of your development environment, I would look at how the REPL works
now. There is probably incremental compilation going on there, and you
should be able to modify the REPL to send the results of that incremental
compilation to any connected browsers. If you find time to put something
like that together, be sure to let us know how it goes. :-)

-- 
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: Clojure number crunching win ! was Re: Needing type hinting help for number crunching

2011-07-25 Thread Tassilo Horn
Sean Corfield seancorfi...@gmail.com writes:

Hi Sean,

 On Sun, Jul 24, 2011 at 11:45 PM, Tassilo Horn tass...@member.fsf.org wrote:
 The only issue is that with the repo above, version ranges don't
 work.  If I say

  :dependencies [[org.clojure/clojure [1.3.0-master-SNAPSHOT,)]]

 Your Maven-fu is far off the scale - I didn't even know that kind of
 thing should be possible :)

Well, that basically means 1.3.0 snapshot or newer.  I tend to be
optimistic with respect to versioning and assume that newer packages
won't break my stuff.

Currently, it seems most people specify exact versions creating the
maven equivalent of a JAR/DLL hell.  For example, there are many libs
out there that depend on clojure 1.2.0 although they work perfectly fine
with 1.2.1 or even a 1.3.0 snapshot.  Depending on one of those will
pollute you lib/ with different clojure versions which will certainly
mess up your classpath.

Bye,
Tassilo

-- 
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: Alright, fess up, who's unhappy with clojurescript?

2011-07-25 Thread Nick Zbinden
 Oracle announced/talked about Nashorn at the recent JVM Languages summit, 
 this is an Invoke Dynamic based Javascript runtime which is (aiming) for 
 inclusion in JDK8.

 I do so hope however that someone manages to pull that out for a lets run 
 this NOW on Java 7 as that would be a great improvement over rhino.

Does it really matter? Nobody would really deploy ClojureScript based
on Rhino, right? As long as Rhino has the correct semantics its fine
as a repl. We allready have a programming language that runs fast on
the JVM, its called 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


Re: clojurescript development workflow

2011-07-25 Thread Scott Jaderholm
On Mon, Jul 25, 2011 at 4:02 AM, Sam Aaron samaa...@gmail.com wrote:

 Also, with respect to the lack of ability to interact with the browser
 directly through the REPL or editor like with emacs-swank-slime, is it fair
 to assume that this is just due to the current implementation being
 Rhino-based?


Perhaps ClojureScript repl could be hooked up to swank-js (similar to
mozrepl) to send the code to your browser (a specific page even) for
evaluation.
https://github.com/ivan4th/swank-js

Scott

-- 
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: Alright, fess up, who's unhappy with clojurescript?

2011-07-25 Thread Mark Rathwell
Colin,

I don't think anyone responding was doing so with the mindset of my way or
the highway and we must defend the great leader's achievements.  Speaking
for myself, I responded to an argument that did not make sense, that
argument being basically: Crockford says javascript can be written a
certain way, jQuery generally follows this pattern and it is popular, Google
Closure does not follow this pattern in some ways and is not as popular,
therefore it should not be used for ClojureScript.

Nobody is shooting down I love it type posts because they do come off as
intentionally inflammatory.  The titles of these posts seem aimed to incite
controversy and ruffle feathers (as does the content), rather than seriously
inquire about the rationale.  And the arguments are generally recaps of
articles that agree with the author, rather than actual pain points hit when
trying to create something with Clojure or ClojureScript.  The responses
throwing troll around are the attempt of the community to point out that
this list's main purpose is to help people, not for inflammatory content
that belongs in blog posts.

As for responding with OK, this guy clearly doesn't get it - how can we
improve our communication, this goes back to the intent of the author.  I
don't think the intent was to get anything, I think the intent was to
incite.  The best response to this is to ignore it, and that is what I
should have done, but it is easier to say than to do.

 - Mark

On Mon, Jul 25, 2011 at 5:08 AM, Colin Yates colin.ya...@gmail.com wrote:

 Absolutely nothing to add to the argument as such except to say that I am
 quite surprised at the level of resistance to James' thread.  I can see the
 argument if this was the 'dev' mailing list.

 I have been reading this mailing list for a long while now (even if I
 haven't contributed much to it) but if this had been the first post I had
 read I would have a very negative opinion of the *clojure community*.  It
 comes off as sounding like if you don't like what we do, go away - it is
 our way or the highway, which would be a terrible shame as I don't *think*
 that is the case?  If I wanted that atmosphere there are plenty of other
 places to go.

 Sure, I get that James' email didn't really provide any points of
 discussion, it was more a moan (sorry James ;)), but so what - I don't see
 anybody shooting down ClojureScript - I love it type posts.  And maybe a
 better response would be asking OK, this guy clearly doesn't get it - how
 can we improve our communication?

 Rich - we are *all* grateful and I expect I am not alone in being amazed at
 the technical marvel you have pulled out of the hat.  But to be honest I
 think you need a thicker skin.  Getting your strokes from the mailing list
 is dangerous at best.  To be disheartened by one negative post in the midst
 of positive votes is a bit worrying.

 If this mailing list is for the community to discuss Clojure and ask
 Clojurians for help then these responses were inappropriate.  If this
 mailing list is to big up Clojure then fine - but make that explicit.

 Col (surprisingly disappointed and feels strongly enough to send this at
 the risk of being called a troll himself!)

 P.S.  Strongly opinionated communities that shoots down criticisms of the
 great leaders' achievements is unfortunately not breaking new ground - so
 stop this :) and move onto the next ground breaking tool!

 On 25 July 2011 08:38, Mark Derricutt m...@talios.com wrote:

 Oracle announced/talked about Nashorn at the recent JVM Languages summit,
 this is an Invoke Dynamic based Javascript runtime which is (aiming) for
 inclusion in JDK8.

 I do so hope however that someone manages to pull that out for a lets run
 this NOW on Java 7 as that would be a great improvement over rhino.


 On 25/07/2011, at 3:54 AM, Stuart Halloway wrote:

 Rhino is an implementation detail of the development platform. That
 implementation detail could and probably should change.


  --
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clojure@googlegroups.com
 Note that posts from new members are moderated - please be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en


  --
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clojure@googlegroups.com
 Note that posts from new members are moderated - please be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en


-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from 

Re: Alright, fess up, who's unhappy with clojurescript?

2011-07-25 Thread Lars Rune Nøstdal
I'd say Google Closure/Libray is more idiomatic JavaScript than jQuery; 
jQuery is more sugary and has a different feel to it.

I like jQuery, but I completely see why that is not a the most optimal base 
to build on when something like Google Closure exists. Rich mentioned, 
however, that people would probably wrap or include jQuery as a plugin 
anyway, i.e. not as a base thing, and this is ok and a much better strategy 
IMHO.

I didn't really understand your post about Yegge either.

-- 
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: Alright, fess up, who's unhappy with clojurescript?

2011-07-25 Thread Ken Wesson
On Mon, Jul 25, 2011 at 8:28 AM, Mark Rathwell mark.rathw...@gmail.com wrote:
 Colin,
 I don't think anyone responding was doing so with the mindset of my way or
 the highway and we must defend the great leader's achievements.  Speaking
 for myself, I responded to an argument that did not make sense, that
 argument being basically: Crockford says javascript can be written a
 certain way, jQuery generally follows this pattern and it is popular, Google
 Closure does not follow this pattern in some ways and is not as popular,
 therefore it should not be used for ClojureScript.

 Nobody is shooting down I love it type posts because they do come off as
 intentionally inflammatory.  The titles of these posts seem aimed to incite
 controversy and ruffle feathers (as does the content), rather than seriously
 inquire about the rationale.  And the arguments are generally recaps of
 articles that agree with the author, rather than actual pain points hit when
 trying to create something with Clojure or ClojureScript.  The responses
 throwing troll around are the attempt of the community to point out that
 this list's main purpose is to help people, not for inflammatory content
 that belongs in blog posts.

Be that as it may, it has been my experience that throwing the term
troll around itself is inflammatory and generates more heat than
light. It's easily abused to dismiss without consideration (and to try
to get others to do likewise) an argument you disagree with, for
example, as well as frequently misapplied by accident. (It should be
properly reserved for those who quite intentionally are posting solely
to stir up noise -- not just anyone whose posts have that effect even
unintentionally, let alone where the main stirring up of noise is
coming from the use of the word troll itself or from other
name-calling directed AT the alleged troll.)

The best thing to do if you suspect some post may be a troll is to
*ignore it*. Flaming it and/or calling its author names will, if
you're wrong, alienate what might be a useful contributor to the
group, and if you're right, feed the troll. I doubt you wish to do
either.

 As for responding with OK, this guy clearly doesn't get it - how can we
 improve our communication, this goes back to the intent of the author.  I
 don't think the intent was to get anything, I think the intent was to
 incite.

The evidence is, thus far, equivocal on that score.

 The best response to this is to ignore it, and that is what I
 should have done, but it is easier to say than to do.

Ahh. That's one that is beginning to get it more, anyway.

-- 
Protege: What is this seething mass of parentheses?!
Master: Your father's Lisp REPL. This is the language of a true
hacker. Not as clumsy or random as C++; a language for a more
civilized age.

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: [ANN] ClojureScript

2011-07-25 Thread Andreas Liljeqvist
There is some small mentions about mobile around Clojurescript.
What is the plan for Mobile integration?
Why wouldn't Clojure be a better fit on the androidplatform? (performance
and build problems aside)

-- 
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: JavaScript is Assembly Language for the Web

2011-07-25 Thread Frank Gerhardt
Yes. And somebody said that Java is the assembly language of the JVM. So
true.

Frank.

On Mon, Jul 25, 2011 at 11:56 AM, Jimmy jimmy.co...@gmail.com wrote:


 With clojurescript just launched, I thought there might be some
 interest in this podcast by Scott Hanselman.
 JavaScript is Assembly Language for the Web -
 http://www.hanselminutes.com/default.aspx?showID=294

 Some discussion regarding the podcast.

 http://www.hanselman.com/blog/JavaScriptIsAssemblyLanguageForTheWebPart2MadnessOrJustInsanity.aspx

 Regards,
 Jimmy

 --
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clojure@googlegroups.com
 Note that posts from new members are moderated - please be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: better community docs: getting started

2011-07-25 Thread Lee Spector

On Jul 25, 2011, at 4:11 AM, Michael Wood wrote:

 On 25 July 2011 09:41, Sean Corfield seancorfi...@gmail.com wrote:
 On Sun, Jul 24, 2011 at 11:51 PM, pmbauer paul.michael.ba...@gmail.com 
 wrote:
 [...]
 That's why I would give Clooj some prominence rather than burying it at the
 bottom of the decision tree.
 
 Well, then put it at the top with the tag line If you don't have a
 strong affinity for a specific IDE or editor, why not try Clooj which
 is a simple, lightweight editor focused on Clojure? Otherwise see the
 options below for adding Clojure support to your favorite IDE...
 
 +1

+1 with a little more justification from one perspective:

As a relative newbie (to Clojure and especially the Java ecosystem, but not to 
Lisp) and as a teacher (I have been and plan to continue teaching Clojure to 
undergrads) I have pretty strong opinions on this.

What I hope for in a getting started page/process is something that will 
allow people with little/no experience with any existing programming 
environment to install and begin to use a Clojure environment that is not toy 
in the sense that it includes both a reasonable Lisp code editor (minimally: 
bracket matching and language-aware auto-reindenting) and a reasonable way to 
grow a project to include multiple files and libraries without learning a lot 
about classpaths and miscellaneous other Java tools (which probably means 
leiningen or cake).

All of the existing full IDEs involve a lot of complexity that is bewildering 
to newcomers, either in installation/configuration, in use, in dealing with 
libraries/classpaths in the community-normed way, or in some combination of 
these.

Until very recently I thought that the way forward on this was to push one or 
more of the existing IDEs in more newbie-friendly directions, e.g. by getting 
CCW to play more nicely with leiningen, or to provide more newbie-friendly 
installation/configuration scripts/instructions for emacs-based environments. 
And several people in the community have recently made contributions recently 
that helped with these things in significant ways. I thank them all! But from 
my perspective there was not yet a really complete, satisfying solution.

Now along comes clooj. This has, to my mind, really leapfrogged over all of the 
other approaches in its potential to provide a really smooth entry ramp into 
Clojure coding for total novices -- AND (and this conjunction is quite 
important for me personally) also for seasoned non-Java-ecosystem programmers 
who want to use Clojure for serious work without mastering Java ecosystem 
tools. It provides trivial download/installation, a simple but sufficient 
editing environment and, I think (although I haven't yet worked with this) 
smooth integration with a leiningen-based or cake-based workflow.

Related issues are being discussed on the clooj mailing list 
(cl...@googlegroups.com), and I think that with a few more enhancements to the 
environment and especially to the getting started instructions (focusing on 
integrated clooj+lein/cake workflow, and providing simple instructions for 1: 
hello world, 2: including and using a library, and 3: building an application) 
this will be a really excellent environment for newcomers.

Assuming that clooj+lein/cake continues to improve as rapidly as it has over 
the last week, I too would advocate this being the first item listed on a 
Clojure getting started page.

 -Lee



-- 
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: JavaScript is Assembly Language for the Web

2011-07-25 Thread Lars Heidieker
Except for the fact that it is categorically wrong, it's some
intuition behind the statement that might be valid.

On Mon, Jul 25, 2011 at 3:05 PM, Frank Gerhardt
f...@gerhardtinformatics.com wrote:
 Yes. And somebody said that Java is the assembly language of the JVM. So
 true.
 Frank.

 On Mon, Jul 25, 2011 at 11:56 AM, Jimmy jimmy.co...@gmail.com wrote:

 With clojurescript just launched, I thought there might be some
 interest in this podcast by Scott Hanselman.
 JavaScript is Assembly Language for the Web -
 http://www.hanselminutes.com/default.aspx?showID=294

 Some discussion regarding the podcast.

 http://www.hanselman.com/blog/JavaScriptIsAssemblyLanguageForTheWebPart2MadnessOrJustInsanity.aspx

 Regards,
 Jimmy

 --
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clojure@googlegroups.com
 Note that posts from new members are moderated - please be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en

 --
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clojure@googlegroups.com
 Note that posts from new members are moderated - please be patient with your
 first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en



-- 
Mystische Erklärungen:
Die mystischen Erklärungen gelten für tief;
die Wahrheit ist, dass sie noch nicht einmal oberflächlich sind.
   -- Friedrich Nietzsche
   [ Die Fröhliche Wissenschaft Buch 3, 126 ]

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

2011-07-25 Thread Sam Aaron
Hi Peter,

I would also love to know how you set this up in a little more detail. It 
really sounds like an excellent approach…

Sam

---
http://sam.aaron.name

On 25 Jul 2011, at 05:46, FL wrote:

 
 
 On Jul 24, 1:44 pm, Peter Taoussanis ptaoussa...@gmail.com wrote:
 
 ...
 I am, literally, deploying this to my web app right now. I've got a
 Compojure route setup for a the resulting output of memoized
 ClojureScript compile call. I can work on the ClojureScript directly
 from my project. When something changes, I re-evaluate the memoized fn
 on my dev box (or on the production server through an SSH tunnel) and
 boom: I have a fully-optimized script going out to users. Add in a
 content-hash of the compiled script to automatically expire the old
 resource, and I have a workflow that I couldn't imagine being much
 better.
 ...
 --Peter
 
 Could you describe your setup in some more detail? (I'd like to use
 clojure+clojurescript for a netCDF-compatible web mapping server.)
 
 -F
 
 -- 
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clojure@googlegroups.com
 Note that posts from new members are moderated - please be patient with your 
 first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Alright, fess up, who's unhappy with clojurescript?

2011-07-25 Thread Steve
On Jul 25, 7:54 pm, James Keats james.w.ke...@gmail.com wrote:

 Best regards; love you, man, and sorry again for any misunderstanding
 or unintended miscommunication.


My humble suggestion is when you find yourself in your 5th or 6th
paragraph of an opinion piece there's a reasonable chance what you're
writing belongs on your blog rather than here.

- Steve

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
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: Alright, fess up, who's unhappy with clojurescript?

2011-07-25 Thread Colin Yates
+1 - I think an etiquette document needs to be written.

On 25 July 2011 15:10, Steve stephen.a.lind...@gmail.com wrote:

 On Jul 25, 7:54 pm, James Keats james.w.ke...@gmail.com wrote:
 
  Best regards; love you, man, and sorry again for any misunderstanding
  or unintended miscommunication.
 

 My humble suggestion is when you find yourself in your 5th or 6th
 paragraph of an opinion piece there's a reasonable chance what you're
 writing belongs on your blog rather than here.

 - Steve

 --
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clojure@googlegroups.com
 Note that posts from new members are moderated - please be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en


-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: clojure.contrib.profile crashes

2011-07-25 Thread Colin Jones
This could be the same issue that Kevin Baribeau has found with 
clojure.contrib.profile here: 
https://github.com/richhickey/clojure-contrib/pull/2#issuecomment-1385392 

(Yes, we know he needs a CA, etc. - he mentions requesting assembla access 
before closing that pull request.)

TL;DR - might want a long instead of an int? 
https://github.com/kbaribeau/clojure-contrib/commit/5de52bd488265199fed8af09e7d5d31389492ed9

- Colin

-- 
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: Alright, fess up, who's unhappy with clojurescript?

2011-07-25 Thread Brenton
James,

The reason you are experiencing resistance is because you are
proposing changes to things that will never change. Rich came up with
the Rationale before designing ClojureScript and long before writing
any code. All of the design work was informed by this. You are arguing
that there should be a different rationale which would mean starting
over from scratch.

Imagine that I invite you come work on a house that I am building
which has already been framed. Furthermore, imagine that I welcome
your input as to how the construction should progress. If your input
is, I think we should build the house on top of the mountain over
there or There should be two bedrooms downstairs instead of one you
are going to get shut down. Those decisions were made a long time ago
and it's too late to change now.

If you look at The Library Problem section of the Rationale
document, you will see the specific problem that ClojureScript
addresses and why the Closure compiler was chosen as the solution to
that problem. Your argument seems to be, that isn't a problem. If
you don't think that is a problem then you are looking for something
other than ClojureScript and are welcome to pursue it.

Brenton

On Jul 25, 5:54 am, James Keats james.w.ke...@gmail.com wrote:
 Right, Rich, please allow me to reply to the points you mentioned; I
 declined from doing so last night as I sensed some unintentionally
 irritated feelings, which I hope have eased a bit by now. I believe
 all my posts in this discussion are purely technical concerns and I
 believe them to be valid. I am most definitely not a troll as some
 have suggested; I would've had to do a ridiculous amount of homework
 over a long, long period of time and been a psychic to predict this
 event (I've only found out clojurescript in the past couple of days),
 and I do not believe in any way I'm making an attempt at humor in the
 technical arguments I'm making.

 On Jul 24, 10:28 pm, Rich Hickey richhic...@gmail.com wrote:

  On Jul 24, 11:19 am, James Keats james.w.ke...@gmail.com wrote:

   Alright, to be honest, I'm disappointed.

  I'll make sure you get a refund then.

  Seriously, this is like being disappointed an action movie was an
  action movie instead of a comedy. Your expectations are a complete
  mismatch for the intentions of ClojureScript.

 clojure's rocks... javascript reaches



   First of all, congrats and good job to all involved in putting it out.
   On the plus side, it's a good way to use the Google Closure javascript
   platform.

   On the minus, imho, that's what's wrong with it.

   Google Closure is too Java.

  Actually, it's too JavaScript. Some JS proponents want to disavow its
  pseudo class model, but it certainly is part of the design of
  JavaScript. And it has some particular advantages over the other
  strategies, as outlined here:

 http://bolinfest.com/javascript/inheritance.php

 Rich, the pseudo class model with the new keyword is a syntactic
 obfuscation, semantically javascript is prototypical inheritance. It's
 class free. In addition to the pseudo class inheritance advocated by
 google closure and the prototypical inherent in javascript, others
 like Doug Crockford advocated functional inheritance.

 Now I have watched and read enough of your output and for example
 Stuart Holloways talk about protocols to know that you've railed in
 your adovacy of clojure against classes and inheritance, and find it
 ironic that now you posit a link by an advocate of it citing it as
 advantageous. In any case, as I've mentioned, I have been aware of
 this article for nearly a year now, it failed to convince me back then
 and it still does; most of the arguments in it concern the closure
 compiler, an obeisance to which by the regular developer who doesn't
 have the needs and resources of google, I feel in this day and age of
 ample memory and bandwidth and fast javascript engines, is premature
 optimization gone berserk (seriously, folks, people are streaming HD
 video, 1.5 gbps fiber optic broadband is being rolled out in London
 and soon other cities worldwide and 4G mobiles are upon and we're
 fretting over mere tens of KB that gets cached after first time and
 basing our development around minimizing it?!), and the remainder of
 the arguments are in support of classes and inheritance.



   It's not idiomatic JavaScript.

  There's no such thing as idiomatic JavaScript. There are a lot of
  different conventions used by different libraries.

 The Javascript community - the vast majority of which - after a decade
 and a half now of experience with the language has come to regard some
 aspect of it as good and others as problematic; things like functional
 programming and object literals (akin to clojure's maps/structs/
 records) vs classical inheritance, which are positions you yourself
 have taken and advocated.

   I find it
   disappointing that rather than porting from a functional language like
   Clojure straight to another functional 

ClojureScript on Windows

2011-07-25 Thread Timothy Baldridge
Is there a documented way to get ClojureScript working on Windows?
While I'm familiar with Linux, and use it in several server
environments, all my development is on Windows, so I don't really have
access to a Linux box for development.

Timothy

-- 
“One of the main causes of the fall of the Roman Empire was
that–lacking zero–they had no way to indicate successful termination
of their C programs.”
(Robert Firth)

-- 
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: ClojureScript on Windows

2011-07-25 Thread Tamreen Khan
I've gotten the basics working. Haven't had the time to write up a full blog
post, though. Basically I used Cygwin so that I could run the bootstrap
script. In any of the shell scripts where it sets a classpath you'll have to
change the colons to semicolons.

On Mon, Jul 25, 2011 at 10:59 AM, Timothy Baldridge tbaldri...@gmail.comwrote:

 Is there a documented way to get ClojureScript working on Windows?
 While I'm familiar with Linux, and use it in several server
 environments, all my development is on Windows, so I don't really have
 access to a Linux box for development.

 Timothy

 --
 “One of the main causes of the fall of the Roman Empire was
 that–lacking zero–they had no way to indicate successful termination
 of their C programs.”
 (Robert Firth)

 --
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clojure@googlegroups.com
 Note that posts from new members are moderated - please be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: ClojureScript on Windows

2011-07-25 Thread Mark Rathwell
Also, VirtualBox (http://www.virtualbox.org/) is free, if you were
interested in linux for some development.

On Mon, Jul 25, 2011 at 11:06 AM, Tamreen Khan histor...@gmail.com wrote:

 I've gotten the basics working. Haven't had the time to write up a full
 blog post, though. Basically I used Cygwin so that I could run the bootstrap
 script. In any of the shell scripts where it sets a classpath you'll have to
 change the colons to semicolons.


 On Mon, Jul 25, 2011 at 10:59 AM, Timothy Baldridge 
 tbaldri...@gmail.comwrote:

 Is there a documented way to get ClojureScript working on Windows?
 While I'm familiar with Linux, and use it in several server
 environments, all my development is on Windows, so I don't really have
 access to a Linux box for development.

 Timothy

 --
 “One of the main causes of the fall of the Roman Empire was
 that–lacking zero–they had no way to indicate successful termination
 of their C programs.”
 (Robert Firth)

 --
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clojure@googlegroups.com
 Note that posts from new members are moderated - please be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en


  --
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clojure@googlegroups.com
 Note that posts from new members are moderated - please be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en


-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: JavaScript is Assembly Language for the Web

2011-07-25 Thread Luc Prefontaine
From an historic perspective it's absolutely right. It happened in the past
already.

When you end up writing thousands of lines of code to achieve what should
be a simple objective and you need assistance from sophisticated tools to
get the task done, it means that the language used is at a very low level
in the language stack.

That's what motivated the emergence of high level (at the time) languages
like Fortran, Cobol, Pascal, ... to get away from the metal and assemblers.

It's exactly the same today, a search for more concise expressiveness to
achieve more complex goals.

Java and C/C++ have attained their apogee in terms of expressing today's
problems. They are a better than assemblers but they will get confined
to the bottom of the language stack as better alternatives emerge.

It does not mean they are not useful anymore, assemblers were widely used
in the 1980s/90s in low level libraries and in resource constrained environments
(bank tellers, ...)

Being able to use Java libs from Clojure in the same fashion is valuable.
No one would like to rewrite all the Java libs in Clojure or any other
of today's high level language. It's simply unrealistic.

Luc P.

On Mon, 25 Jul 2011 15:16:11 +0200
Lars Heidieker lars.heidie...@googlemail.com wrote:

 Except for the fact that it is categorically wrong, it's some
 intuition behind the statement that might be valid.
 
 On Mon, Jul 25, 2011 at 3:05 PM, Frank Gerhardt
 f...@gerhardtinformatics.com wrote:
  Yes. And somebody said that Java is the assembly language of the
  JVM. So true.
  Frank.
 
  On Mon, Jul 25, 2011 at 11:56 AM, Jimmy jimmy.co...@gmail.com
  wrote:
 
  With clojurescript just launched, I thought there might be some
  interest in this podcast by Scott Hanselman.
  JavaScript is Assembly Language for the Web -
  http://www.hanselminutes.com/default.aspx?showID=294
 
  Some discussion regarding the podcast.
 
  http://www.hanselman.com/blog/JavaScriptIsAssemblyLanguageForTheWebPart2MadnessOrJustInsanity.aspx
 
  Regards,
  Jimmy
 
  --
  You received this message because you are subscribed to the Google
  Groups Clojure group.
  To post to this group, send email to clojure@googlegroups.com
  Note that posts from new members are moderated - please be patient
  with your first post.
  To unsubscribe from this group, send email to
  clojure+unsubscr...@googlegroups.com
  For more options, visit this group at
  http://groups.google.com/group/clojure?hl=en
 
  --
  You received this message because you are subscribed to the Google
  Groups Clojure group.
  To post to this group, send email to clojure@googlegroups.com
  Note that posts from new members are moderated - please be patient
  with your first post.
  To unsubscribe from this group, send email to
  clojure+unsubscr...@googlegroups.com
  For more options, visit this group at
  http://groups.google.com/group/clojure?hl=en
 
 
 



-- 
Luc P.


The rabid Muppet

-- 
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: Alright, fess up, who's unhappy with clojurescript?

2011-07-25 Thread Chouser
On Sun, Jul 24, 2011 at 11:19 AM, James Keats james.w.ke...@gmail.com wrote:

 Google Closure is too Java. It's not idiomatic JavaScript. I find it
 disappointing that rather than porting from a functional language like
 Clojure straight to another functional language like Javascript, the
 google closure with its ugly Java-isms is right there obnoxiously in
 the middle.

It is interesting to me that you say this, because it's an argument
I've used against other JavaScript libraries. In particular I think
Zimbra is weak in this way. For a specific example, to register an
event handler using the Zimbra event system, you can't just pass in a
function, you have to pass in an instance of an AjxListener. This
definitely strikes me as a useless Java-ism.

The G. Closure library doesn't have that particular problem -- it's
clearly aware that functions are first-class objects in JavaScript and
takes advantage of that fact. Is there some other specific way in
which the G. Closure library is too Java-like? How does that specific
way actual harm the development process or the final product?

 Then, there's the elephant in the room, and that elephant is Jquery.

I like jQuery. It's a huge win compared to vanilla JavaScript for the
browser. Now, I personally plan to write my ClojureScript code to
target the G. Closure library and then run it through the
advanced-mode G. Closure compiler, but there's no reason *you* have
to.  You argue elsewhere that the G. Closure compiler is unnecessary
(citing streaming HD video in comparison to minified JavaScript) -- if
you don't use the compiler (or use it only in simple mode) you should
have no problem using jQuery. Your resulting .js will be quite a bit
larger because you'll have a couple of the G. Closure library files
that ClojureScript itself uses, but nothing compared to streaming HD
video.

So, you could use ClojureScript and jQuery to write a snappy little
demo and prove to everyone the value of that approach. I'm sure I'm
not the only one that would be interested in seeing such a demo.

--Chouser

-- 
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: Alright, fess up, who's unhappy with clojurescript?

2011-07-25 Thread Timothy Baldridge
 So, you could use ClojureScript and jQuery to write a snappy little
 demo and prove to everyone the value of that approach. I'm sure I'm
 not the only one that would be interested in seeing such a demo.


I think Rich's point in his talk is good to re-iterate here. Is jQuery
cool? Yes! I would hate to program a webapp in JS without it...but
that's the key, in JS. Why do I need jQuery 90% of the time, because
simplifies things like finding dom elements, and adding events, etc.
For JS coding, that's a awesome tool to have. But in ClojureScript we
have map, filter, macros, etc. Why would I need jQuery?  I think it's
important to distinguish between libraries that are truly needed to do
web programming, and libraries that are needed in JS to do web
programming.

Timothy

-- 
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: ClojureScript Questions

2011-07-25 Thread Jack Moffitt
 - On page 2 of the Closure book, there is a workflow figure on using
 the Closure tools, how would ClojureScript change this workflow? It
 would be great to post such a modified diagram to the closure wiki.

Some quick notes on this:

1) calcdeps.py and the compiler are taken care of for you by cljsc.
2) There's nothing specific to help with templates in ClojureScript,
so you still need to generate the JS template code using the Closure
template tools.
3) Use the :libs option in the compiler options to point to things
like Soy or your own libs (these must use google.provides and
google.require though).

I haven't yet looked into the testing part yet, but I assume it works
like using soy.

jack.

-- 
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: better community docs: getting started

2011-07-25 Thread nchurch
 How about making the main suggestion be clooj instead, with emacs,
 eclipse, netbeans in the list of alternative options? :)

Sounds like consensus around Clooj.  Released on July 18th, top option
on July 25th!  Things move at lightspeed around here

The one thing I want to say about Emacs is that at some point we might
want to tell newcomers that it is as close to a standard dev
environment for experienced Clojure programmers as there is (along
with all the necessary warnings about its difficulties).  I've been
using Emacs for such a long time I've forgotten how horrible it can be
thoughhence my apparent missrec...

(If Aquamacs consistently worked with Clojure, Emacs would not be as
bad of a problem on Mac at least.  Some people do seem to get it
workingRich Hickey, for instance.  But I trust he has better
things to do with his time than write Getting Started guides for
Aquamacs.)

I just found out that I don't have permission on dev.clojure to move
pages (which would be needed to reorganize docs obviously).  Does
anyone around here have that permission and want to do it, or shall I
go about and try to get the permission?  Maybe someone with more
experience and having been on dev.clojure longer would be preferred,
but I feel pretty confident I can do \this at least = )

Other than not recommending Emacs, do people think that the overall
organization I suggested is a good idea?  I should reiterate that
other information needs to be accessible; for now I'd just like to see
us not presenting people with twelve options as their first view of
Getting Started, all in link form (after at least two clickthroughs
from clojure.org, typically).  Of course people are capable of
digesting the information in the current form, but it takes more time
and mindshareand why should it?

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

2011-07-25 Thread Ghadi Shayban
It will be a only a matter of time before people realize it doesn't
matter whether jQuery integrates or not. The examples/blog posts
coming out already are spectacular.

On Jul 24, 1:44 pm, Peter Taoussanis ptaoussa...@gmail.com wrote:
 Just want to throw in on this real quick. I am -dumbfounded- by how
 cool ClojureScript is.

 It was about 2AM my time when I first heard the announcement and I
 stayed up another 3 hours after that watching Rich's talk and playing
 with the samples. As I see it right now, this is a Big Deal. For lots
 of reasons. And I suspect it might take some time for the whole
 concept and its wide ramifications to fully digest for everyone.

 Like many (I'm guessing), my first question was: will it work with
 jQuery? I'd never even heard of Google Closure. Suffice it to say it
 didn't take much time looking into it to get me excited. And for it to
 click just how smart this whole approach seems it might just be.

 I am, literally, deploying this to my web app right now. I've got a
 Compojure route setup for a the resulting output of memoized
 ClojureScript compile call. I can work on the ClojureScript directly
 from my project. When something changes, I re-evaluate the memoized fn
 on my dev box (or on the production server through an SSH tunnel) and
 boom: I have a fully-optimized script going out to users. Add in a
 content-hash of the compiled script to automatically expire the old
 resource, and I have a workflow that I couldn't imagine being much
 better.

 Client-side side stuff I've wanted to do with my app but couldn't even
 begin to have the patience to implement- now suddenly seem trivial in
 principle. Having access to the reader for transmitting native data
 structures between the server and client... I don't even have the
 words.

 And this is just the stuff that touches me directly and that's
 obvious. I can't wait to see what people are going to do with this in
 time.

 Thank you: awesome job, guys. And what an awesome surprise!

 --
 Peter

-- 
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: Clojure number crunching win ! was Re: Needing type hinting help for number crunching

2011-07-25 Thread Phil Hagelberg
On Mon, Jul 25, 2011 at 3:10 AM, Chas Emerick cemer...@snowtide.com wrote:
 (I think the only useful artifacts at build.clojure.org that aren't in 
 central already are old versions of clojure-contrib (1.0.0 and 1.1.0 AFAICT). 
  Is that what's keeping build.clojure.org/* in Leiningen's default set of 
 searched repos these days?)

It was actually dropped a while ago when I found out that it was no
longer being updated. I didn't realize until now that contrib wasn't
on central prior to 1.2.0, but I think at this point the odds of
someone needing versions that old are pretty slim.

-Phil

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: clojurescript development workflow

2011-07-25 Thread Max Weber
Hi,

today I've been working on cljs-devmode:

https://github.com/maxweber/cljs-devmode

It is a really primitive prototype of a development mode for
ClojureScript. For an explanation take a look at the README on the
GitHub repo. I'm in a hurry so I'm going to continue the work on cljs-
devmode tomorrow. I would appreciate any feedback.

Best regards

Max

On 24 Jul., 23:51, Sam Aaron samaa...@gmail.com wrote:
 Hi there,

 Having never really enjoyed javascript and therefore avoiding it for the 
 longest time, I'm now quite excited to jump into it given the introduction of 
 ClojureScript. It's really quite exciting - thanks everyone for putting so 
 much effort and thought into it.

 One thing I'm wondering about (and hope that someone with more ClojureScript 
 dev experience than myself could help illuminate things for me) is what a 
 typical ClojureScript development workflow looks like.

 With Clojure, I do the following:

 * start up a swank server
 * hack in the repl
 * hack in the text editor - sending forms to be evaled on the swank server
 * instantly see/hear (if I'm doing GUI/sound work) the results of my evals

 I walked through the first two Google Closure tutorials:

 *http://code.google.com/closure/library/docs/gettingstarted.html
 *http://code.google.com/closure/library/docs/tutorial.html

 My workflow lacked a REPL (although I believe they exist in some web 
 browsers) but I was able to modify the code, hit refresh in the browser and 
 immediately see changes.

 However, when I went through the ClojureScript tutorial:

 *https://github.com/clojure/clojurescript/wiki/Quick-Start

 Although I did get a REPL, it was totally disconnected from the browser, so I 
 wasn't able to test any GUI stuff with it and if I modified the code I had to 
 wait quite a long time for the js to compile before I saw the changes in the 
 browser.

 I'm therefore wondering, how do other people with more experience develop 
 with ClojureScript? Is there any way of getting the wonderful flow of code 
 creation/evaluation/visibility that you can get in a typical Clojure workflow?

 Thanks in advance,

 Sam

 ---http://sam.aaron.name

-- 
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: :require farms in Clojure?

2011-07-25 Thread Laurent PETIT
And then goodbye statical analysis ... :-)

2011/7/20 Meikel Brandmeyer m...@kotka.de

 Hi,

 Am Mittwoch, 20. Juli 2011 06:38:27 UTC+2 schrieb Chas Emerick:

 Try:

 (ns myfuns
(:require
(foo.baz [a :as a]
 [b :as b]
 [c :as c]))

 I think he wants more something like this:

 (ns require.farm)

 (def xxx '[[foo.bar [a :as a] [b :as b]] frob.nicate])
 (def yyy '[[foo.bar.c :as c]])

 (ns require.userA
   (:require [require.farm :as requires]))

 (apply require requires/xxx)

 (ns require.userB
   (:require [require.farm :as requires]))

 (apply require requires/xxx)
 (apply require requires/yyy)

 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


-- 
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: Alright, fess up, who's unhappy with clojurescript?

2011-07-25 Thread nchurch
+1 to writing an etiquette document.  I have to confess I wrote a long
post a few weeks ago without realizing these sorts of posts belonged
on blogs (it was, oddly enough, another James Keats thread, on the
subject of Steve Yegge.  I figured if \Yegge writes long blogs).
I didn't intend to ruffle any feathers there, but my opinion that some
things were not being given enough priority was taken as disrespecting
people's efforts so far.  But there seems to be some more attention to
documentation now and the newbie experience, so I'm happy (and trying
to help) = )

Ken was helpful to me then when he pointed out that my post was simply
too long.  I suspect this was much more useful to the forum than
someone partly reading the post and responding out of context.
Similarly, writing (hopefully gentle) admonishments about etiquette
might help steer things in the right direction.  If someone simply
responded with a few lines to this particular thread: This is not the
kind of discussion this forum is for; it is also too late in the
process to be a constructive criticism, there might have been more
light and less heat.

Furthermore, if people want to offer etiquette pointers on the tone
and framing of a particular post, why not simply use the reply to
author link?  There's a quote from the New Testament that I can't
quite rememberwait.thank you Google: If thy brother shall
trespass against thee, go and tell him his fault between thee and him
alone.

(I note, however, that this was presumably written before Facebook,
which makes privacy sound almost as quaint as King James and
Shakespeare.)

As for the subsequent part about And if he neglect to hear the
cljurch, let him be as an troll to you ((this is from the New
Internet Version)), I guess that would be equivalent to simply
ignoring him.

(If it said: then ANN thou out upon him and the list that he be an
trollwe would have a horse of a different color.)

On Jul 25, 10:21 am, Colin Yates colin.ya...@gmail.com wrote:
 +1 - I think an etiquette document needs to be written.

 On 25 July 2011 15:10, Steve stephen.a.lind...@gmail.com wrote:







  On Jul 25, 7:54 pm, James Keats james.w.ke...@gmail.com wrote:

   Best regards; love you, man, and sorry again for any misunderstanding
   or unintended miscommunication.

  My humble suggestion is when you find yourself in your 5th or 6th
  paragraph of an opinion piece there's a reasonable chance what you're
  writing belongs on your blog rather than here.

  - Steve

  --
  You received this message because you are subscribed to the Google
  Groups Clojure group.
  To post to this group, send email to clojure@googlegroups.com
  Note that posts from new members are moderated - please be patient with
  your first post.
  To unsubscribe from this group, send email to
  clojure+unsubscr...@googlegroups.com
  For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Alright, fess up, who's unhappy with clojurescript?

2011-07-25 Thread Jack Moffitt
 Rich, the pseudo class model with the new keyword is a syntactic
 obfuscation, semantically javascript is prototypical inheritance. It's
 class free. In addition to the pseudo class inheritance advocated by
 google closure and the prototypical inherent in javascript, others
 like Doug Crockford advocated functional inheritance.

Almost every big JS library I know of adds in traditional inheritance,
so I don't think the community has decided what the best design
pattern is. There are many vocal people in the community who advocate
for prototypal inheritance, but I think this is a far cry from
consensus.

But the real issue is that this has very little to do with
ClojureScript. Whether the underlying library uses one or the other is
of little concern to the higher level. I don't think there is anything
in ClojureScript preventing you from interop with *any* JS lib, unless
of course you also want to use Closure compiler, in which case there
are some rules to follow.

 I respectfully dispute that; for what they both do - dom, css, ajax,
 events, cookies, ui, effects, animations etc - jquery does it far
 better and is much more pleasant an api. What jquery itself doesn't do
 the huge ecosphere of libs around it do, for example:
 http://metajack.im/2009/03/13/jquery-and-strophe-made-for-each-other/
 http://strophe.im/

I wrote that post and the Strophe.js library. I can tell you there is
nothing at all in Strophe that is jQuery dependent. It turns out that
jQuery's selector engine is quite useful at picking apart XML (and
strangely the other libraries selector engines aren't), which makes
using Strophe.js a lot easier. Plenty of people use Strophe.js
alongside other JS libs without any problems.

Many libraries are like this. Underscore.js is another example, but
there are tons of others.

It's certainly true that jQuery has a lot of plugins that already
exist. I can't say yet whether any of those would be useful in
ClojureScript.  There's nothing preventing you using jQuery and
ClojureScript together (aside from a few kB overhead which they claim
to be working on minimizing). I don't see what benefit ClojureScript
would get from being built on jQuery, and it would be giving up a lot
(the Closure compiler!) for any such benefits.

Strophe is actually a great example because it's nearly impossible to
write any javascript library that satisfies some consensus of
javascript design. What dependency management tool should it use? What
type of object structure? No matter what I choose, there are large
swaths of major libraries that will not have made the same choices.

ClojureScript doesn't seemed particularly tied to anything but the
Closure compiler and it's dependency requirements. The benefits are
huge, and don't exist anywhere else to my knowledge. If jQuery or YUI
offered such a system, I think there would be more to argue about, but
even though I'm not a fan of Closure or YUI either (I tend to reach
for jQuery), I am perfectly happy with ClojureScript's choices and
have started down the road to embracing Closure library as well.

jack.

-- 
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: Alright, fess up, who's unhappy with clojurescript?

2011-07-25 Thread Ken Wesson
On Mon, Jul 25, 2011 at 12:59 PM, nchurch nchubr...@gmail.com wrote:
 +1 to writing an etiquette document.  I have to confess I wrote a long
 post a few weeks ago without realizing these sorts of posts belonged
 on blogs

Not everyone *has* a blog, you know.

 Ken was helpful to me then when he pointed out that my post was simply
 too long.

More in a condense your thoughts, or post several posts on subtopics
sense than a post somewhere else sense, though.

 Furthermore, if people want to offer etiquette pointers on the tone
 and framing of a particular post, why not simply use the reply to
 author link?  There's a quote from the New Testament that I can't
 quite rememberwait.thank you Google: If thy brother shall
 trespass against thee, go and tell him his fault between thee and him
 alone.

Unfortunately, some people on the internet seem to think that a) the
way to punish misdemeanors is public humiliation of some sort, b) they
are the police and judge and jury who will decide who's guilty and
apply these punishments, and c) what things are *misdemeanors* and
what things *they, personally, dislike* are precisely equal as sets.
Of course, all three things are wrong. :)

Those people cause as much trouble as trolls -- perhaps more, since
they're among the most incorrigible troll *feeders*.

[snippy]

nchurch, I arrest you, try you, and find you guilty of the heinous
charge of top-posting, thou knave, thou scum, thou waster of
bandwidth! ;)

-- 
Protege: What is this seething mass of parentheses?!
Master: Your father's Lisp REPL. This is the language of a true
hacker. Not as clumsy or random as C++; a language for a more
civilized age.

-- 
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: Alright, fess up, who's unhappy with clojurescript?

2011-07-25 Thread pmbauer
Fair point, but Rhino doesn't always have the correct semantics.

For example, one common JS idiom for default params:
eval(undefined || 2 + 2) = returns true instead of 4

But mostly, Rhino is just a JS engine with no DOM, so is less than ideal for 
browser UI development.
 

  I do so hope however that someone manages to pull that out for a lets 
 run this NOW on Java 7 as that would be a great improvement over rhino. 

 Does it really matter? Nobody would really deploy ClojureScript based 
 on Rhino, right? As long as Rhino has the correct semantics its fine 
 as a repl. We allready have a programming language that runs fast on 
 the JVM, its called 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

Re: Alright, fess up, who's unhappy with clojurescript?

2011-07-25 Thread nchurch
 nchurch, I arrest you, try you, and find you guilty of the heinous
 charge of top-posting, thou knave, thou scum, thou waster of
 bandwidth!

I confess that I have erred and strayed from thy ways like a lost
sheep

-- 
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: Alright, fess up, who's unhappy with clojurescript?

2011-07-25 Thread Ken Wesson
On Mon, Jul 25, 2011 at 1:23 PM, nchurch nchubr...@gmail.com wrote:
 nchurch, I arrest you, try you, and find you guilty of the heinous
 charge of top-posting, thou knave, thou scum, thou waster of
 bandwidth!

 I confess that I have erred and strayed from thy ways like a lost
 sheep

For penance you must make 3 more useful posts here today, and solve 3
Project Euler problems by midnight. ;)

-- 
Protege: What is this seething mass of parentheses?!
Master: Your father's Lisp REPL. This is the language of a true
hacker. Not as clumsy or random as C++; a language for a more
civilized age.

-- 
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: :require farms in Clojure?

2011-07-25 Thread Meikel Brandmeyer
Salut Laurent,

Am 25.07.2011 um 18:54 schrieb Laurent PETIT:

 And then goodbye statical analysis ... :-)

I didn't say, that I think it's a good idea to do this. :)

On the other hand I'm not afraid of dynamic analysis either. That's what 
VimClojure does at the moment anyway. Static analysis is – in general – 
confined to special cases known to the analyzer in the presence of macros. In 
practice it's probably doable in a reasonable way.

Cordialement
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


Re: clojurescript development workflow

2011-07-25 Thread Sam Aaron

On 25 Jul 2011, at 17:33, Max Weber wrote:

 Hi,
 
 today I've been working on cljs-devmode:
 
 https://github.com/maxweber/cljs-devmode
 
 It is a really primitive prototype of a development mode for
 ClojureScript. For an explanation take a look at the README on the
 GitHub repo. I'm in a hurry so I'm going to continue the work on cljs-
 devmode tomorrow. I would appreciate any feedback.

Fantastic stuff - thank-you so much for this.

Sam

---
http://sam.aaron.name

-- 
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: better community docs: getting started

2011-07-25 Thread Sergey Didenko
IMO, it's a very good idea to give much more accent on the easiest options
for newcomers.

Other than not recommending Emacs, do people think that the overall
 organization I suggested is a good idea?  I should reiterate that
 other information needs to be accessible; for now I'd just like to see
 us not presenting people with twelve options as their first view of
 Getting Started, all in link form (after at least two clickthroughs
 from clojure.org, typically).  Of course people are capable of
 digesting the information in the current form, but it takes more time
 and mindshareand why should it?


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

Parsing double with default value

2011-07-25 Thread siyu798
Hi,
   Is there an idiomatic/built-in way to parse double with a default value 
if there's exception?  Currently we use a generic with-default macro to 
ignore exception and return default value as follow:

(with-default 0.0 (Double. my-value))

-- 
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: Alright, fess up, who's unhappy with clojurescript?

2011-07-25 Thread daly
On Mon, 2011-07-25 at 09:59 -0700, nchurch wrote:
 +1 to writing an etiquette document. 

In place of an etiquette document I suggest the book
called Producing Open Source Software.

In this generally useful book there is some advice,
mostly directed at project leads but this section is relevant:

http://producingoss.com/en/producingoss.html#communications

I don't think the original poster intended to troll but the
post certainly fell under the rubric of kibitzing (def:
A Kibitzer is a non-participant who hangs around offering
(often unwanted) advice or commentary). The advice was
unwanted as the issue was already addressed in the video.

Based on the book, I think Rich is doing an
excellent job, especially in the area of communication.

Tim Daly


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


Need Help Parsing Clojure Strings

2011-07-25 Thread octopusgrabbus
I have a web application that returns data that is pipe-delimited and
looks like this:

AT|1 Kenilworth Rd||Soapville|ZA|99901-7505|Option value=A == Normal
street matchOption value=T == ZIP+4 corrected|013|C065|

What I want to do is take the zip-zip4 field, split the zip and zip 4
apart, and add them as separate fields right after state ZA. I want to
do some other things too (like remove from Option value... through
013), but that's the next step.

This function

(defn rearrange-accumail-seq
Fixes up AccuMail sequence, so we have the right data, and it's
in the correct order.
[in-str]
(let [s1 (cstr/split in-str #^\w*\|\w*\|\w*\|\w*\|)]
  s1))

does not do what I expect it to. That is I cannot find first and next
in the vector of splits returned.

[AT|1 Kenilworth Rd||Soapville|ZA|99901-7505|Option value=A == Normal
street matchOption value=T == ZIP+4 corrected|013|C065|]

Should I be using Java string parsing directly, or am I missing
something basic?

Thanks.
cmn

-- 
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: Parsing double with default value

2011-07-25 Thread Tassilo Horn
siyu798 siyu...@gmail.com writes:

Hi!

Is there an idiomatic/built-in way to parse double with a default
 value if there's exception?

Not that I know of.

 Currently we use a generic with-default macro to ignore exception and
 return default value as follow:

 (with-default 0.0 (Double. my-value))

Why a macro instead of a function?

--8---cut here---start-8---
(defn parse-double [s  [d]]
  (try
(Double/valueOf s)
(catch Exception _ d)))
--8---cut here---end---8---

That way, you can use it directly with higher-order functions:

;; Without default value
(map parse-double
 [0 1.5 3.8e-1 broken 0x1.bP2 Infinity NaN])
== (0.0 1.5 0.38 nil 6.75 Infinity NaN)

;; With default value 42.0
(map #(parse-double % 42.0)
 [0 1.5 3.8e-1 broken 0x1.bP2 Infinity NaN])
== (0.0 1.5 0.38 42.0 6.75 Infinity NaN)

Bye,
Tassilo

-- 
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: Need Help Parsing Clojure Strings

2011-07-25 Thread Islon Scherer
Do you want something like:
(vec (.split some-string \\|))

(vec (.split AT|1 Kenilworth Rd||Soapville|ZA|99901-7505|Option value=A == 
Normal street matchOption value=T == ZIP+4 corrected|013|C065| \\|))
= [AT 1 Kenilworth Rd  Soapville ZA 99901-7505 Option value=A 
== Normal street matchOption value=T == ZIP+4 corrected 013 C065]

-- 
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: Need Help Parsing Clojure Strings

2011-07-25 Thread Tassilo Horn
octopusgrabbus octopusgrab...@gmail.com writes:

Hi!

 What I want to do is take the zip-zip4 field, split the zip and zip 4
 apart, and add them as separate fields right after state ZA. I want to
 do some other things too (like remove from Option value... through
 013), but that's the next step.

 This function

 (defn rearrange-accumail-seq
 Fixes up AccuMail sequence, so we have the right data, and it's
 in the correct order.
 [in-str]
 (let [s1 (cstr/split in-str #^\w*\|\w*\|\w*\|\w*\|)]
   s1))

 does not do what I expect it to. That is I cannot find first and next
 in the vector of splits returned.

`split' expects a regex that matches the *separator*.

(clojure.string/split foo|bar|baz #\|)
== [foo bar baz]

Then you can take the compontents of the resulting vector and shuffle
them to your likings.

Bye,
Tassilo

-- 
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: Parsing double with default value

2011-07-25 Thread siyu798
Tassilo,
   The reason a generic default macro being used here is because we can use 
the same macro to parse other data type like integer:

(with-default 1 (Integer. my-value))


Thanks,
siyu

-- 
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: Parsing double with default value

2011-07-25 Thread Alan Malloy
On Jul 25, 1:18 pm, siyu798 siyu...@gmail.com wrote:
 Tassilo,
    The reason a generic default macro being used here is because we can use
 the same macro to parse other data type like integer:

 (with-default 1 (Integer. my-value))

 Thanks,
 siyu

You can still do the same with a function:

(defn with-default [f  [default]]
  (fn [ args]
(try (apply f args)
 (catch Throwable _ default

(map (with-default #(Integer/parseInt %) 0)
 [4 test])

;= (4 0)

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


determining whether state has changed in a thread safe manner

2011-07-25 Thread Sam Aaron
Hi there,

I have some state which I'd like to set to some default value, A. I'd then like 
to update A to a new value A' and then, if (not (= A A')) I'd like to fire off 
a function - say print to stdout that A has changed. If (= A A') I'd like 
nothing to happen at all. Additionally, I'd like to do this in a way that's 
thread safe - i.e. I can be updating A from any given thread and I'd never like 
to miss a time when A has changed and also I don't want to fire of the fn more 
times than necessary.

An initial naive solution might be the following:

(def a (atom 1))

(defn changed-fn
  []
  (println something changed!))

(defn new-val
  []
  (int (rand 2)))

(defn update
  []
  (let [old-a @a ;;A
new-a (reset! a (new-val)] ;;B
(when-not (= old-a new-a)
  (changed-fn

However, if there are two updates running concurrently, statements A and B may 
be interleaved such that if we have two threads X and Y, a starting val of 0 
for a and the result of calling new-val be 0 each time:

X (deref a) ;= 1
Y (deref a) ;= 1
X (reset! a 0) ;= 0
Y (reset! a 0) ;= 0

We now call our changed-fn twice. If however, we don't interleave the calls:

X (deref a) ;= 1
X (reset! a 0) ;= 0
Y (deref a) ;= 0
Y (reset! a 0) ;= 0 

this results in changed-fn called only once. Clearly this approach doesn't work.

Ideally, it seems that there could be versions of reset! and swap! that 
returned a vector result containing the old and new vals which could be 
directly compared.

The solution appears to be to use a transaction and bind the result of a 
comparison within the dosync:

(def a (ref 1))

(defn update
  []
  (let [changed? (dosync
  (let [old-a @a
new-a (ref-set a (new-val))]
(= old-a new-a)))]
(when changed? (changed-fn

Is this the only way of achieving this? Is there another, perhaps more 
idiomatic, approach? It certainly seems overkill to have to use a transaction 
when the number of references we wish to coordinate is only one - itself and 
its previous value.

Sam

---
http://sam.aaron.name

-- 
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: determining whether state has changed in a thread safe manner

2011-07-25 Thread Sam Aaron

On 25 Jul 2011, at 21:45, Sam Aaron wrote:
 
 (defn update
  []
  (let [changed? (dosync
  (let [old-a @a
new-a (ref-set a (new-val))]
(= old-a new-a)))]
(when changed? (changed-fn

Clearly I meant (not (= old-a new-a)) :-)

Sam

---
http://sam.aaron.name

-- 
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: determining whether state has changed in a thread safe manner

2011-07-25 Thread Meikel Brandmeyer
Hi,

you want a watch.

(def a (atom 0))
(add-watch a ::your-id (fn [_your-id _a old-val new-val] (when (not= old-val 
new-val) (println New value: new-val
(swap! a inc)
(reset! a 1)
(swap! a inc)

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


Re: Need Help Parsing Clojure Strings

2011-07-25 Thread octopusgrabbus
Thanks. I finally got part of my problem when I changed the regex to
#\d\d\d\d\d-\d\d\d\d to match the zip-zip4, and when that
disappeared, I realized what was going on.

On Jul 25, 3:51 pm, Tassilo Horn tass...@member.fsf.org wrote:
 octopusgrabbus octopusgrab...@gmail.com writes:

 Hi!



  What I want to do is take the zip-zip4 field, split the zip and zip 4
  apart, and add them as separate fields right after state ZA. I want to
  do some other things too (like remove from Option value... through
  013), but that's the next step.

  This function

  (defn rearrange-accumail-seq
      Fixes up AccuMail sequence, so we have the right data, and it's
  in the correct order.
      [in-str]
      (let [s1 (cstr/split in-str #^\w*\|\w*\|\w*\|\w*\|)]
            s1))

  does not do what I expect it to. That is I cannot find first and next
  in the vector of splits returned.

 `split' expects a regex that matches the *separator*.

 (clojure.string/split foo|bar|baz #\|)
 == [foo bar baz]

 Then you can take the compontents of the resulting vector and shuffle
 them to your likings.

 Bye,
 Tassilo

-- 
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: Need Help Parsing Clojure Strings

2011-07-25 Thread octopusgrabbus
Thanks for the suggestion. I will try this tomorrow and report back.

On Jul 25, 3:46 pm, Islon Scherer islonsche...@gmail.com wrote:
 Do you want something like:
 (vec (.split some-string \\|))

 (vec (.split AT|1 Kenilworth Rd||Soapville|ZA|99901-7505|Option value=A ==
 Normal street matchOption value=T == ZIP+4 corrected|013|C065| \\|))
 = [AT 1 Kenilworth Rd  Soapville ZA 99901-7505 Option value=A
 == Normal street matchOption value=T == ZIP+4 corrected 013 C065]

-- 
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: determining whether state has changed in a thread safe manner

2011-07-25 Thread Sam Aaron
Hi Meikel,

On 25 Jul 2011, at 21:51, Meikel Brandmeyer wrote:
 
 you want a watch.
 
 (def a (atom 0))
 (add-watch a ::your-id (fn [_your-id _a old-val new-val] (when (not= old-val 
 new-val) (println New value: new-val
 (swap! a inc)
 (reset! a 1)
 (swap! a inc)
 

That's cool to know - thanks.

So what if I would like #'update to return a boolean representing whether the 
state has changed rather than call #'changed-fn internally? (which is actually 
what i'm trying to do, I just refactored the example to be a lot simpler and 
hopefully clearer).

Sam

---
http://sma.aaron.name

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


ClojureScript Demo

2011-07-25 Thread Asim Jalis
Just saw this neat ClojureScript demo, which can be used as a starting
point to create a Javascript game.

http://jng.imagine27.com/articles/2011-07-23-101007_clojurescript_demo_convex_hull.html

-- 
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: determining whether state has changed in a thread safe manner

2011-07-25 Thread Meikel Brandmeyer
Hi,

Am 25.07.2011 um 23:12 schrieb Sam Aaron:

 So what if I would like #'update to return a boolean representing whether the 
 state has changed rather than call #'changed-fn internally? (which is 
 actually what i'm trying to do, I just refactored the example to be a lot 
 simpler and hopefully clearer).

Since this is callback based, you can't return a value. Do you want more 
something like a polling solution? Then you'll have to roll your own with an 
atom and a clojure.lang.PersistentQueue.

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


Re: determining whether state has changed in a thread safe manner

2011-07-25 Thread Sam Aaron
Hi Meikel,

On 25 Jul 2011, at 22:46, Meikel Brandmeyer wrote:

 Am 25.07.2011 um 23:12 schrieb Sam Aaron:
 
 Since this is callback based, you can't return a value. Do you want more 
 something like a polling solution? Then you'll have to roll your own with an 
 atom and a clojure.lang.PersistentQueue.

Sorry, I should have been more specific. The callback-based watchers are cool, 
but I don't believe they specifically address my problem (which I don't believe 
I sufficiently explained from the outset).

Hopefully this is a more succinct and specific description. Is there a way to 
write the following in a thread safe manner without using a transaction:

(def a (ref 1))

(defn update-and-check-whether-modified?
  [update-fn]
  (let [changed? (dosync
  (let [old-a @a
new-a (alter a update-fn)]
(not= old-a new-a)))]
changed?))


Sam

---
http://sam.aaron.name


-- 
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: Alright, fess up, who's unhappy with clojurescript?

2011-07-25 Thread James Keats

Perhaps I should've just looked for a blog about knitting or cupcakes
and posted what I did here about clojure/clojurescript in it. That way
you fine folks won't get to read it, eventhough no one here is obliged
in any way to read my posts or any in this thread. Yeah, definitely,
that way I might've made sure that I didn't incite any controversy
or ruffle any feathers; god forbid that should ever be done here.
I ask, what is it that I did other than seriously inquire about the
rationale?! I don't see me making any jokes and I don't see me doing
anything other than seriously inquire about the rationale. I'm
sorry, but if you fine folks choose to blind and deafen yourself to my
seriuos inquiry about the rationale and call me a troll for it,
then there's a big wide merciless world out there that'll find it
absolutely ridiculous for Rich Hickey to rail against classes and
inheritance on and on and then favor a library and post a link titled
inheritance that argues for hoisting a pseudoclassical version of it
upon a language that tries to be functional as proof that it is
advantageous. Perhaps clojure itself should have classes and
inheritance and Rich should instead of apologizing for having once
taught it to people apologize for teaching them clojure.

Fine, I am done with this (- back to scala); I have better things to
do than being called a troll. ignore me all you want, if that's
how you want it then it the world out there will ignore you.

(ps. what's quotes below mischaracterizes what my psots)

On Jul 25, 1:28 pm, Mark Rathwell mark.rathw...@gmail.com wrote:
 Colin,

 I don't think anyone responding was doing so with the mindset of my way or
 the highway and we must defend the great leader's achievements.  Speaking
 for myself, I responded to an argument that did not make sense, that
 argument being basically: Crockford says javascript can be written a
 certain way, jQuery generally follows this pattern and it is popular, Google
 Closure does not follow this pattern in some ways and is not as popular,
 therefore it should not be used for ClojureScript.

 Nobody is shooting down I love it type posts because they do come off as
 intentionally inflammatory.  The titles of these posts seem aimed to incite
 controversy and ruffle feathers (as does the content), rather than seriously
 inquire about the rationale.  And the arguments are generally recaps of
 articles that agree with the author, rather than actual pain points hit when
 trying to create something with Clojure or ClojureScript.  The responses
 throwing troll around are the attempt of the community to point out that
 this list's main purpose is to help people, not for inflammatory content
 that belongs in blog posts.

 As for responding with OK, this guy clearly doesn't get it - how can we
 improve our communication, this goes back to the intent of the author.  I
 don't think the intent was to get anything, I think the intent was to
 incite.  The best response to this is to ignore it, and that is what I
 should have done, but it is easier to say than to do.

  - Mark







 On Mon, Jul 25, 2011 at 5:08 AM, Colin Yates colin.ya...@gmail.com wrote:
  Absolutely nothing to add to the argument as such except to say that I am
  quite surprised at the level of resistance to James' thread.  I can see the
  argument if this was the 'dev' mailing list.

  I have been reading this mailing list for a long while now (even if I
  haven't contributed much to it) but if this had been the first post I had
  read I would have a very negative opinion of the *clojure community*.  It
  comes off as sounding like if you don't like what we do, go away - it is
  our way or the highway, which would be a terrible shame as I don't *think*
  that is the case?  If I wanted that atmosphere there are plenty of other
  places to go.

  Sure, I get that James' email didn't really provide any points of
  discussion, it was more a moan (sorry James ;)), but so what - I don't see
  anybody shooting down ClojureScript - I love it type posts.  And maybe a
  better response would be asking OK, this guy clearly doesn't get it - how
  can we improve our communication?

  Rich - we are *all* grateful and I expect I am not alone in being amazed at
  the technical marvel you have pulled out of the hat.  But to be honest I
  think you need a thicker skin.  Getting your strokes from the mailing list
  is dangerous at best.  To be disheartened by one negative post in the midst
  of positive votes is a bit worrying.

  If this mailing list is for the community to discuss Clojure and ask
  Clojurians for help then these responses were inappropriate.  If this
  mailing list is to big up Clojure then fine - but make that explicit.

  Col (surprisingly disappointed and feels strongly enough to send this at
  the risk of being called a troll himself!)

  P.S.  Strongly opinionated communities that shoots down criticisms of the
  great leaders' achievements is unfortunately not breaking new ground 

Re: Parsing double with default value

2011-07-25 Thread siyu798
Alan,
Your with-default fn is neat.  So it appears there's no 
idiomatic/built-in clojure fn/macro to do parsing and wrapper functions such 
as follow would be needed to avoid typing the whole expression every time.

(def parse-double (with-default #(Double. %) 0.0))
(def parse-int (with-default #(Integer. %) 0))
...

Thanks,
siyu

-- 
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: Parsing double with default value

2011-07-25 Thread Michael

Tassilo and Alan,

Thanks for responding. We're new to clj and don't have a good feel of
when to you use macros over functions.

(defmacro with-dflt
  Runs body in a try/catch returning result of body
   if no exception otherwise default
  [default  body]
  `(try
 (do ~@body)
 (catch Exception _# ~default)))

Here's how it could be used with map, but it needs to be wrapped in an
anonymous function and I think that was part of your point.

(map #(err/with-dflt 42.0 (Double. %))  [0 1.5 3.8e-1 broken
0x1.bP2 Infinity NaN])
(0.0 1.5 0.38 42.0 6.75 Infinity NaN)

We are using it in map like this,

(map #(err/with-dflt 0.0 (- % r Double.))
   [Holding OA Dur OA Cvx KRDur 6M KRDur 1Y KRDur 2Y
KRDur 5Y KRDur 10Y Mtge Sprd Dur
OA Sprd Dur Price PV OA DP/DY KR DP/DY 6M KR DP/DY 1Y
KR DP/DY 2Y KR DP/DY 5Y KR DP/DY 10Y])

We also wanted to put a default around any form,

(err/with-dflt 0.0 (some #(when (= (% Bench Code) Bench TSY 10Y) (-
 OA DP/DY % Double.))
   (-
 ctx :run-file-deps :bench :file csv/load-csv))

One style question we have is whether it's worth creating small,
specific parse with default functions for doubles and ints or simply
to use something like the following inline

(err/with-dflt 0.0 (Double. num-str))

If it's worth creating separate parse functions, we were wondering if
anybody had packaged up a set already.


-- 
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: better community docs: getting started

2011-07-25 Thread Sean Corfield
On Mon, Jul 25, 2011 at 9:03 AM, nchurch nchubr...@gmail.com wrote:
 Other than not recommending Emacs, do people think that the overall
 organization I suggested is a good idea?

Yes.

 for now I'd just like to see
 us not presenting people with twelve options as their first view of
 Getting Started, all in link form

Agreed.
-- 
Sean A Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/
World Singles, LLC. -- http://worldsingles.com/
Railo Technologies, Inc. -- http://www.getrailo.com/

Perfection is the enemy of the good.
-- Gustave Flaubert, French realist novelist (1821-1880)

-- 
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: determining whether state has changed in a thread safe manner

2011-07-25 Thread cassiel
Hi Sam,

A nice late night exercise...

Not very practical, but if you want a safe transaction-free operation
on an atom which returns whether it was changed, you can perhaps hack
it by embedding the change state into the atom itself:

(def a (atom {:value 45 :changed? false}))

(defn update-and-check-whether-modified?
  [update-fn]
  (:changed?
   (swap! a (fn [{v :value _ :changed?}]
  (let [new-v (update-fn v)]
(if (== v new-v)
  {:value new-v :changed? false}
  {:value new-v :changed? true}))

(update-and-check-whether-modified? (fn [x] (+ x 1)))
(update-and-check-whether-modified? (fn [x] 70))

-- 
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: Alright, fess up, who's unhappy with clojurescript?

2011-07-25 Thread Mark Rathwell
James,

If I've misread and/or mischaracterized your intentions, I do apologize for
that.  I was, and still am, unsure as to your desired outcome from this
post.

If the intent was for the core team to rewrite ClojureScript to target
jQuery instead of GClosure, we both know that was not going to happen.

If the intent was to garner support for a fork of ClojureScript that targets
jQuery, the path that generally offers the best chance of success is to get
a working base or a proof of concept written by yourself, then use that to
start recruiting others to help.

If the intent was to be able to use jQuery with ClojureScript, you can
already do that.  This may help get you started:
https://gist.github.com/1096382

If the issue was that you have been trying to write something in
ClojureScript, but have been running into issues, or feel there is a better
way to do it that you may be missing, post the code you have and what your
desired outcome is, and I guarantee someone can offer advice.  There are
truly some geniuses in this list, and many extremely helpful people in
general.

In any case, I again apologize for any misunderstanding on my part, and
sincerely hope you give Clojure and ClojureScript a fair try.

 - Mark


On Mon, Jul 25, 2011 at 6:11 PM, James Keats james.w.ke...@gmail.comwrote:


 Perhaps I should've just looked for a blog about knitting or cupcakes
 and posted what I did here about clojure/clojurescript in it. That way
 you fine folks won't get to read it, eventhough no one here is obliged
 in any way to read my posts or any in this thread. Yeah, definitely,
 that way I might've made sure that I didn't incite any controversy
 or ruffle any feathers; god forbid that should ever be done here.
 I ask, what is it that I did other than seriously inquire about the
 rationale?! I don't see me making any jokes and I don't see me doing
 anything other than seriously inquire about the rationale. I'm
 sorry, but if you fine folks choose to blind and deafen yourself to my
 seriuos inquiry about the rationale and call me a troll for it,
 then there's a big wide merciless world out there that'll find it
 absolutely ridiculous for Rich Hickey to rail against classes and
 inheritance on and on and then favor a library and post a link titled
 inheritance that argues for hoisting a pseudoclassical version of it
 upon a language that tries to be functional as proof that it is
 advantageous. Perhaps clojure itself should have classes and
 inheritance and Rich should instead of apologizing for having once
 taught it to people apologize for teaching them clojure.

 Fine, I am done with this (- back to scala); I have better things to
 do than being called a troll. ignore me all you want, if that's
 how you want it then it the world out there will ignore you.

 (ps. what's quotes below mischaracterizes what my psots)

 On Jul 25, 1:28 pm, Mark Rathwell mark.rathw...@gmail.com wrote:
  Colin,
 
  I don't think anyone responding was doing so with the mindset of my way
 or
  the highway and we must defend the great leader's achievements.
  Speaking
  for myself, I responded to an argument that did not make sense, that
  argument being basically: Crockford says javascript can be written a
  certain way, jQuery generally follows this pattern and it is popular,
 Google
  Closure does not follow this pattern in some ways and is not as popular,
  therefore it should not be used for ClojureScript.
 
  Nobody is shooting down I love it type posts because they do come off
 as
  intentionally inflammatory.  The titles of these posts seem aimed to
 incite
  controversy and ruffle feathers (as does the content), rather than
 seriously
  inquire about the rationale.  And the arguments are generally recaps of
  articles that agree with the author, rather than actual pain points hit
 when
  trying to create something with Clojure or ClojureScript.  The responses
  throwing troll around are the attempt of the community to point out
 that
  this list's main purpose is to help people, not for inflammatory content
  that belongs in blog posts.
 
  As for responding with OK, this guy clearly doesn't get it - how can we
  improve our communication, this goes back to the intent of the author.
  I
  don't think the intent was to get anything, I think the intent was to
  incite.  The best response to this is to ignore it, and that is what I
  should have done, but it is easier to say than to do.
 
   - Mark
 
 
 
 
 
 
 
  On Mon, Jul 25, 2011 at 5:08 AM, Colin Yates colin.ya...@gmail.com
 wrote:
   Absolutely nothing to add to the argument as such except to say that I
 am
   quite surprised at the level of resistance to James' thread.  I can see
 the
   argument if this was the 'dev' mailing list.
 
   I have been reading this mailing list for a long while now (even if I
   haven't contributed much to it) but if this had been the first post I
 had
   read I would have a very negative opinion of the *clojure community*.
  It
   comes off as 

Re: determining whether state has changed in a thread safe manner

2011-07-25 Thread cassiel
Of course, once posted, I realised the conditional could be
eliminated:

(defn update-and-check-whether-modified?
  [update-fn]
  (:changed?
   (swap! a (fn [{v :value _ :changed?}]
  (let [new-v (update-fn v)]
{:value new-v :changed? (not= v new-v)})

-- 
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: :require farms in Clojure?

2011-07-25 Thread Laurent PETIT
2011/7/25 Meikel Brandmeyer m...@kotka.de

 Salut Laurent,

 Am 25.07.2011 um 18:54 schrieb Laurent PETIT:

  And then goodbye statical analysis ... :-)

 I didn't say, that I think it's a good idea to do this. :)

 On the other hand I'm not afraid of dynamic analysis either. That's what
 VimClojure does at the moment anyway. Static analysis is – in general –
 confined to special cases known to the analyzer in the presence of macros.
 In practice it's probably doable in a reasonable way.


Certainly, ccw/eclipse also does dynamic analysis currently, but I still
have the idea of using static analysis for when no REPL is started, for some
kinds of refactorings, etc. In the end, I find it interesting to be able to
reconcile the static  dynamic views, maybe eventually being able to say to
the user: beware, you're looking at a function definition in a file that's
more recent in the repl, would you like to update, etc.



 Cordialement
 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


-- 
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: ClojureScript on Windows

2011-07-25 Thread Laurent PETIT
Taking a look at the content of some of these scripts, I would not be
surprised if a lein plugin, and probably also a maven archetype, would come
up rapidly (if not already under my radar !)

Cheers,

-- 
Laurent

2011/7/25 Timothy Baldridge tbaldri...@gmail.com

 Is there a documented way to get ClojureScript working on Windows?
 While I'm familiar with Linux, and use it in several server
 environments, all my development is on Windows, so I don't really have
 access to a Linux box for development.

 Timothy

 --
 “One of the main causes of the fall of the Roman Empire was
 that–lacking zero–they had no way to indicate successful termination
 of their C programs.”
 (Robert Firth)

 --
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clojure@googlegroups.com
 Note that posts from new members are moderated - please be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: clooj, a lightweight IDE for clojure

2011-07-25 Thread Laurent PETIT
Hi, I'm just back after some vacations without Internet connections. Please
give me a couple more days to emerge from the tons of emails and workload,
and I'll gladly help you in any possible ways.

Cheers,

-- 
Laurent

2011/7/18 Arthur Edelstein arthuredelst...@gmail.com



 On Jul 18, 2:31 am, Shantanu Kumar kumar.shant...@gmail.com wrote:
  This is so cool. Any chance you can use Laurent Petit's Paredit?
 https://github.com/laurentpetit/paredit.clj

 Thanks, that's a very interesting idea. Perhaps, if Laurent doesn't
 mind! :)

  Any roadmap for features? Syntax highlight, autocomplete etc?

 I'm adding Issues to the github project now.

 --
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clojure@googlegroups.com
 Note that posts from new members are moderated - please be patient with
 your first post.
 To unsubscribe from this group, send email to
 clojure+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en


-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Re: [ANN] ClojureScript

2011-07-25 Thread Hoornet
Anyone successfully stated this thing on windows yet?
I tried in no avail ...

-- 
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: Alright, fess up, who's unhappy with clojurescript?

2011-07-25 Thread Christian Marks


On Jul 25, 6:11 pm, James Keats james.w.ke...@gmail.com wrote:
 I ask, what is it that I did other than seriously inquire about the
 rationale?!
You started a thread with the non-serious title, Alright, fess up,
whose unhappy with clojurescript?
instead of the more serious Comments on the clojurescript rationale.
Having done that, you could have addressed the rationale.

 then there's a big wide merciless world out there that'll find it
 absolutely ridiculous for Rich Hickey to rail against classes and
 inheritance on and on and then favor a library and post a link titled
 inheritance that argues for hoisting a pseudoclassical version of it
 upon a language that tries to be functional as proof that it is
 advantageous. Perhaps clojure itself should have classes and
 inheritance and Rich should instead of apologizing for having once
 taught it to people apologize for teaching them clojure.

Oh dear, this is jumbled prose for someone who always advocates
taking
a managerial attitude.  So much for the managerial attitude. What
happened to love you, man? One gathers that managers offer
conditional
apologies and then quickly and resentfully withdraw them.

-- 
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: Problem with ClojureScript and Node.js

2011-07-25 Thread Oliver Kaiser
I also experience this problem; switching nodejs versions (0.4.11-pre
== v0.4 branch, 0.4.10 and 0.5.2) did not have any effect.

When compiling with:
bin/cljsc samples/nodehello.cljs '{:target :nodejs :optimizations
:simple :pretty-print true}'  nodehello.js

the (first) relevant line for this error seems to be:
goog.global.Date.prototype.cljs$core$IEquiv$ = !0;

I don't get why this is goog.global.Date and not goog.date.Date, or
where the definition should actually come from; somehow it smells like
config trouble or (most likely) user error.

Regards,
tok

-- 
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en


Re: Leiningen on OpenBSD

2011-07-25 Thread scitesy
I'm going to listen to Aaron's initial advice and follow the path of
least resistance by switching from OpenBSD to Linux (Arch) for Clojure
development.

Thanks all for your help.

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

2011-07-25 Thread Peter Taoussanis
 I would also love to know how you set this up in a little more detail. It 
 really sounds like an excellent approach…

Sure: it's not complicated! I'm writing this in a hurry though- so
hope it's still clear.

Basically I just define a memoized dynamic scripts function that
returns a map with a text/javascript Ring response, along with a hash
of that response.

So something like (def dynamic-scripts (memoize (function []
{:response foobar :hash (make-hash foobar)}))

Then I've got a Compojure route configured to serve requests like so:
(GET /dynamic-stuff/:hash/scripts.js {} (:response (dynamic-
scripts)))

This'll just send back the memoized script response anytime a request
is made for /dynamic-stuff/whatever/scripts.js

The /whatever/ is important since it let's me automatically include
the current hash in any script tags in the HTML with URI (str /
dynamic-stuff/ (:hash (dynamic-scripts)) /scripts.js).


Now all I need to do when I want to tweak the scripts is reevaluate
the namespace they're in and it'll re-hash, meaning that all future
requests for scripts.js go to the new resource - avoiding any possible
caching issues.


What I've described so far doesn't necessitate anything ClojureScript.
But with ClojureScript, the dynamic-scripts function can be easily
modified to produce it's response by compiling ClojureScript source.
This is awesome since it means I can keep everything in one
environment, and compilation happens automatically any time there is a
change to the underlying source. The scripts.js is always optimized,
always up-to-date, and always hashed to avoid caching problems.

When I want to test a change to the scripts, I just reevaluate the ns
then refresh my browser and the changes are live. If there's a major
compile-time bug in the scripts, it'll get caught before any changes
take affect.

BTW if the devs are listening, it'd be nice if cljsc/build could one
day also support input/output directly via strings :) That'd make all
this absolutely trivial(er).

--
Peter

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


Calling clojure from java.

2011-07-25 Thread mmwaikar
Hi,

I am using the Lobos library - https://github.com/budu/lobos
In it there's a function create, which is called like this - (create db 
(table :some-name)), where db is earlier defined as - (def db
 {:classname org.postgresql.Driver
  :subprotocol postgresql
  :user postgres
  :password 
  :subname //localhost:5432/flyway})

If I have to call the above function from Java, how do I -
1) define the def (do I have to load some variable)?
2) I am loading the reqd. lobos libraries using [ RT.load(lobos/core, 
true); ] and then getting the reference to the create function like - [ Var 
foo = RT.var(lobos.core, create); ]
But how do I pass the required arguments to this function. Do I need to 
create an array?

Any help is truly appreciated.

Thanks,
Manoj.

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