Re: [ANN] ClojureScript One - Getting Started with ClojureScript

2012-01-12 Thread Laurent PETIT
Hi Brenton,

2012/1/11 Brenton bashw...@gmail.com

 Today we are releasing ClojureScript One. A project to help you get
 started writing single-page applications in ClojureScript.

 http://clojure.com/blog/2012/01/11/announcing-clojurescript-one.html

 http://clojurescriptone.com/

 https://github.com/brentonashworth/one

 This project is the result of a lot of hard work from the people at
 Relevance. Thanks everyone.


I am totally bluffed by the level of quality I can see in this released
work! The whole thing seems so cohesive and encompassing so much concerns
people have when starting projects with new languages/platforms!

It seems like an incredible gift for the community, dramatically lowering
the barrier to entry for newcomers, etc.

Cheers,

-- Laurent



 --
 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 One - Getting Started with ClojureScript

2012-01-12 Thread mmwaikar
Heart felt thanks to everyone who contributed to this.
I hope to catch up with my lack of JS skills through ClojureScript :) 
Everything about ClojureScript is exciting stuff.

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

Re: Literate Programming in Emacs?

2012-01-12 Thread Andrew
I found [1] from Eric Schulte which says to add certain package archives 
such that ELPA finds swank-clojure... But what about the swank-clojure 
elisp package being deprecated? (By the way, I do get further now... the 
clojure code evaluates)

 (setq package-archives
'((original. http://tromey.com/elpa/;;)
  (gnu . http://elpa.gnu.org/packages/;;)
  (marmalade   . http://marmalade-repo.org/packages/;;)))


[1] http://lists.gnu.org/archive/html/emacs-orgmode/2011-12/msg00629.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: [ANN] ClojureScript One - Getting Started with ClojureScript

2012-01-12 Thread Daniel Jomphe
Will we be able to read the account of the experience of translating the 
app from CoffeeScript to ClojureScript?

And/or reading both code bases.

Not sure if this account is covered by 
https://github.com/brentonashworth/one/issues/22

-- 
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: Literate Programming in Emacs?

2012-01-12 Thread Phil Hagelberg
Andrew ache...@gmail.com writes:

 I found [1] from Eric Schulte which says to add certain package
 archives such that ELPA finds swank-clojure... But what about the
 swank-clojure elisp package being deprecated?

swank-clojure.el is definitely deprecated, but there could still be code
out there in the wild depending upon it. If that's the case then a bug
should be opened for that package.

-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: Struggling in making a sub-process work in an interactive way

2012-01-12 Thread Denis Labaye
Hi,

In Java you would do it with common-exec: http://commons.apache.org/exec/

So add the deps to your project.clj :

:dependencies [[org.apache.commons/commons-exec 1.1]]

And use Clojure's Java interop.

Keep us posted, I will need to do the same thing soon :)

Denis

On Wed, Jan 11, 2012 at 4:05 AM, jaime xiejianm...@gmail.com wrote:

 I didn't read your code carefully yet but I think you're meaning to
 copy streams between my Clojure code and the sub-process, actually
 I've tried this but this is probably not what I want.
 I might not make myself clear. So here I go again:
  1. I writing a program which will open an OS shell (that means cmd
 under Windows and bash under Linux) as sub-process
  2. this shell thing will not terminate while my code is still
 running, all system commands such as dir/ls/cat etc. will be thrown
 into the shell's input-stream to execute and the result is pulled
 from shell's output-stream/err-stream
  3. because when the shell will finish its execution is
 unpredictable, I chained an echo stop-sign command to original
 command so that the program can get the sign when execution done. E.g.
 for command dir, I will throw dir echo stop-sign to the shell,
 when a stop-sign is captured then it knows the execution finished
  4. it works well so far but when the system command is interactive
 one such as 'time' (in Windows), the program will hang; if there are
 ways to know when to require user input then I can resolve this in the
 code, but the answer is NO. I didn't find a way to detect this
  5. thus I tried to find out any workarounds but failed. I also tried
 the way you mentioned here, it can work in an interactive way but in
 this case I cannot get the control back.

 That's all the things I'm struggling on...

 On Jan 10, 4:54 pm, Alan Malloy a...@malloys.org wrote:
  On Jan 9, 9:24 pm, Phil Hagelberg p...@hagelb.org wrote:
 
   jaime xiejianm...@gmail.com writes:
Later on I tried to add code that can make this possible but I found
there's no way to detect if a command requires user's input and thus
 I
have to find another way to make it work - but I didn't success and
have been struggling for a workaround for a long while
 
anyone has any idea?
 
   As far as I know this is impossible to do without bringing in
   third-party libraries; this is just a (rather serious) shortcoming of
   the JDK. I haven't looked into it enough to know which libraries would
   offer it though.
 
  This should be possible if you don't mind suiciding your own process's
  stdin/stdout, by blindly forwarding all your input and output through
  the child. But if you send the child some input it didn't need, and it
  terminates, and then later you need your own stdin again, some pieces
  will be missing.
 
  I was going to attach a simple proof of concept to this, but I can't
  seem to get it right. So instead, here's what I was trying to do, and
  if someone wants to take it up this might be something useful to work
  from:
 
  (ns fork.core
(:require [clojure.java.io :as io])
(:import (java.io PipedReader PipedWriter))
(:gen-class))
 
  (defn -main [ args]
(println Start typing, I'll cat it back atcha!)
(let [child (- (Runtime/getRuntime) (.exec /bin/cat))
  cin (.getInputStream child)
  cout (.getOutputStream child)
 
  in-pipe-in (PipedReader.)
  in-pipe-out (PipedWriter. in-pipe-in)
 
  out-pipe-in (PipedReader.)
  out-pipe-out (PipedWriter. out-pipe-in)
 
  in *in*, out *out*] ;; avoid dynamic-binding issues
  (future (io/copy in in-pipe-out)) ;; read my stdin...
  (future (io/copy in-pipe-in cout)) ;; write it to child's stdin
 
  (future (io/copy cin out-pipe-out)) ;; read child's stdout...
  @(future (io/copy out-pipe-in out)) ;; write it to my stdout, and
  wait for it to finish
  (let [exit-code (.waitFor child)]
(println Child process finished with exit code exit-code)
exit-code)))

 --
 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 One - Getting Started with ClojureScript

2012-01-12 Thread nchurch
Just wanted to add my thanks on this as well!  It looks beautiful

Nick.

On Jan 12, 11:46 am, Daniel Jomphe danieljom...@gmail.com wrote:
 Will we be able to read the account of the experience of translating the
 app from CoffeeScript to ClojureScript?

 And/or reading both code bases.

 Not sure if this account is covered 
 byhttps://github.com/brentonashworth/one/issues/22

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


defonce is not thread safe (racy)

2012-01-12 Thread Lars Rune Nøstdal
Hi,
defonce is not thread safe (racy).

-- 
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 One and remote development

2012-01-12 Thread Ryan Waters
I ran into an issue with remote development and ClojureScript One and
thought I'd share with others who potentially will run into the same
issue.

If I want to access ClojureScript One on ComputerA from ComputerB then
I have to tunnel or port forward my request to ComputerA's
localhost:8080.  That's pretty self-evident.  However, I couldn't get
(cljs-repl) stuff to live update.  Instead the repl prompt would hang
and I nothing would change in my browser.  It turns out the long poll
XHR request runs over port 9000 so you need to forward or tunnel both
8080 and 9000 for everything to be happy.

This can be accomplished, e.g, with the following from ComputerB:

ssh -N -L localhost:8080:localhost:8080 -L
localhost:9000:localhost:9000 user@computera


- Ryan

-- 
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 One - Getting Started with ClojureScript

2012-01-12 Thread Brenton
We cannot share that information because it was a client project. It
wasn't really a translation process. We simply attempted to solve the
same problem with different tools. I do realize that seeing them side-
by-side would be interesting but we just can't do it.

Issue 22 is not related to this.

On Jan 12, 11:46 am, Daniel Jomphe danieljom...@gmail.com wrote:
 Will we be able to read the account of the experience of translating the
 app from CoffeeScript to ClojureScript?

 And/or reading both code bases.

 Not sure if this account is covered 
 byhttps://github.com/brentonashworth/one/issues/22

-- 
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 One and remote development

2012-01-12 Thread Brenton
This can also be solved by not hard-coding localhost in
one.sample.core as it is now.

There are functions in goog.uri.utils to help with this.

This is on our list of things to do.

Brenton

On Jan 12, 2:30 pm, Ryan Waters ryan.or...@gmail.com wrote:
 I ran into an issue with remote development and ClojureScript One and
 thought I'd share with others who potentially will run into the same
 issue.

 If I want to access ClojureScript One on ComputerA from ComputerB then
 I have to tunnel or port forward my request to ComputerA's
 localhost:8080.  That's pretty self-evident.  However, I couldn't get
 (cljs-repl) stuff to live update.  Instead the repl prompt would hang
 and I nothing would change in my browser.  It turns out the long poll
 XHR request runs over port 9000 so you need to forward or tunnel both
 8080 and 9000 for everything to be happy.

 This can be accomplished, e.g, with the following from ComputerB:

 ssh -N -L localhost:8080:localhost:8080 -L
 localhost:9000:localhost:9000 user@computera

 - Ryan

-- 
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: piccup 1.0.0 - hiccup-style clojurescript dom generation (extracted from pinot)

2012-01-12 Thread Chris Granger
Haha you should've mentioned you were doing this :p It's something
that was going to be happening soon :) I'll be sharing my plans for
pinot soon.

Cheers,
Chris.

On Jan 11, 9:02 pm, Dave Sann daves...@gmail.com wrote:
 Hi all,

 Because I find it useful in it's own right, I have extracted the
 hiccup-style dom generation library from pinot. 
 (https://github.com/ibdknox/pinot)

 clojars [piccup 1.0.0] for the jar

 My other motivation for this is due to the dependency that pinot has on
 goog.dom.query.
 Since this is not part of the std closure library for clojurescript it is
 probably good to have dom generation without requiring any specific setup.
 (easier for others to try...etc).

 All credit to Chris Granger. I made almost no changes.

 source is herehttps://github.com/davesann/piccup

 Cheers

 Dave

-- 
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 One and remote development

2012-01-12 Thread Stan Dyck

On 01/12/2012 11:44 AM, Brenton wrote:

This can also be solved by not hard-coding localhost in
one.sample.core as it is now.

There are functions in goog.uri.utils to help with this.

This is on our list of things to do.

Brenton



Is not hard-coding port 8080 also on this list? This would be a nice to have 
for me.

StanD.

--
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 One - Getting Started with ClojureScript

2012-01-12 Thread Craig Andera
For anyone that wants to hear a bit more about Brenton's thinking
around ClojureScript One, we just published a podcast interview with
him on the Relevance blog. Have a listen if you feel so inclined!

http://thinkrelevance.com/blog/2012/01/12/podcast-episode-003.html

On Thu, Jan 12, 2012 at 2:35 PM, Brenton bashw...@gmail.com wrote:
 We cannot share that information because it was a client project. It
 wasn't really a translation process. We simply attempted to solve the
 same problem with different tools. I do realize that seeing them side-
 by-side would be interesting but we just can't do it.

 Issue 22 is not related to this.

 On Jan 12, 11:46 am, Daniel Jomphe danieljom...@gmail.com wrote:
 Will we be able to read the account of the experience of translating the
 app from CoffeeScript to ClojureScript?

 And/or reading both code bases.

 Not sure if this account is covered 
 byhttps://github.com/brentonashworth/one/issues/22

 --
 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 One and remote development

2012-01-12 Thread Brenton
Yes.

On Jan 12, 3:24 pm, Stan Dyck stan.d...@gmail.com wrote:
 On 01/12/2012 11:44 AM, Brenton wrote:

  This can also be solved by not hard-coding localhost in
  one.sample.core as it is now.

  There are functions in goog.uri.utils to help with this.

  This is on our list of things to do.

  Brenton

 Is not hard-coding port 8080 also on this list? This would be a nice to 
 have for me.

 StanD.

-- 
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 One - Getting Started with ClojureScript

2012-01-12 Thread abaitam
I am dying to try this. However, the script/run script (on MAC) gives
me this error message:

Exception in thread main java.lang.ClassNotFoundException:
clojure.main
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at sun.misc.Launcher$ExtClassLoader.findClass(Launcher.java:229)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:169)
at jline.ConsoleRunner.main(ConsoleRunner.java:73)

I appreciate any help.

On Jan 11, 2:27 pm, Brenton bashw...@gmail.com wrote:
 Today we are releasing ClojureScript One. A project to help you get
 started writing single-page applications in ClojureScript.

 http://clojure.com/blog/2012/01/11/announcing-clojurescript-one.html

 http://clojurescriptone.com/

 https://github.com/brentonashworth/one

 This project is the result of a lot of hard work from the people at
 Relevance. Thanks everyone.

-- 
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 One - Getting Started with ClojureScript

2012-01-12 Thread Brenton
It looks like you don't have Clojure. Did you run script/deps? Do you
have anything in the lib directory?

Try running it again.

Brenton

On Jan 12, 4:28 pm, abaitam abai...@gmail.com wrote:
 I am dying to try this. However, the script/run script (on MAC) gives
 me this error message:

 Exception in thread main java.lang.ClassNotFoundException:
 clojure.main
         at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
         at java.security.AccessController.doPrivileged(Native Method)
         at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
         at sun.misc.Launcher$ExtClassLoader.findClass(Launcher.java:229)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
         at java.lang.Class.forName0(Native Method)
         at java.lang.Class.forName(Class.java:169)
         at jline.ConsoleRunner.main(ConsoleRunner.java:73)

 I appreciate any help.

 On Jan 11, 2:27 pm, Brenton bashw...@gmail.com wrote:







  Today we are releasing ClojureScript One. A project to help you get
  started writing single-page applications in ClojureScript.

 http://clojure.com/blog/2012/01/11/announcing-clojurescript-one.html

 http://clojurescriptone.com/

 https://github.com/brentonashworth/one

  This project is the result of a lot of hard work from the people at
  Relevance. Thanks everyone.

-- 
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 One - Getting Started with ClojureScript

2012-01-12 Thread abaitam
Thanks, but I did run script/deps and it successfully completed I have
all the jars under lib. I cloned CLJS1 several times but always got
the same error.

What information do you need to help me solve the problem?

On Jan 12, 4:50 pm, Brenton bashw...@gmail.com wrote:
 It looks like you don't have Clojure. Did you run script/deps? Do you
 have anything in the lib directory?

 Try running it again.

 Brenton

 On Jan 12, 4:28 pm, abaitam abai...@gmail.com wrote:







  I am dying to try this. However, the script/run script (on MAC) gives
  me this error message:

  Exception in thread main java.lang.ClassNotFoundException:
  clojure.main
          at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
          at java.security.AccessController.doPrivileged(Native Method)
          at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
          at sun.misc.Launcher$ExtClassLoader.findClass(Launcher.java:229)
          at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
          at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
          at java.lang.Class.forName0(Native Method)
          at java.lang.Class.forName(Class.java:169)
          at jline.ConsoleRunner.main(ConsoleRunner.java:73)

  I appreciate any help.

  On Jan 11, 2:27 pm, Brenton bashw...@gmail.com wrote:

   Today we are releasing ClojureScript One. A project to help you get
   started writing single-page applications in ClojureScript.

  http://clojure.com/blog/2012/01/11/announcing-clojurescript-one.html

  http://clojurescriptone.com/

  https://github.com/brentonashworth/one

   This project is the result of a lot of hard work from the people at
   Relevance. Thanks everyone.

-- 
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 One - Getting Started with ClojureScript

2012-01-12 Thread abaitam
Hi,
I removed the reference to jline.ConsoleRunner and the exception
stopped but I get another error now:

2012-01-12 18:05:34.527:INFO::Logging to STDERR via
org.mortbay.log.StdErrLog
2012-01-12 18:05:34.528:INFO::jetty-6.1.25
2012-01-12 18:05:34.545:WARN::failed SocketConnector@0.0.0.0:8080:
java.net.BindException: Address already in use
2012-01-12 18:05:34.545:WARN::failed Server@458e439a:
java.net.BindException: Address already in use
BindException Address already in use
java.net.PlainSocketImpl.socketBind (PlainSocketImpl.java:-2)

I used lsof -i | grep LISTEN to find if there is a process listening
on the 8080 port but there is none. Also, shouldn't the ip be
127.0.0.1 or localhost instead of 0.0.0.0?

Thanks for your help

On Jan 12, 5:03 pm, abaitam abai...@gmail.com wrote:
 Thanks, but I did run script/deps and it successfully completed I have
 all the jars under lib. I cloned CLJS1 several times but always got
 the same error.

 What information do you need to help me solve the problem?

 On Jan 12, 4:50 pm, Brenton bashw...@gmail.com wrote:







  It looks like you don't have Clojure. Did you run script/deps? Do you
  have anything in the lib directory?

  Try running it again.

  Brenton

  On Jan 12, 4:28 pm, abaitam abai...@gmail.com wrote:

   I am dying to try this. However, the script/run script (on MAC) gives
   me this error message:

   Exception in thread main java.lang.ClassNotFoundException:
   clojure.main
           at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
           at java.security.AccessController.doPrivileged(Native Method)
           at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
           at sun.misc.Launcher$ExtClassLoader.findClass(Launcher.java:229)
           at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
           at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
           at java.lang.Class.forName0(Native Method)
           at java.lang.Class.forName(Class.java:169)
           at jline.ConsoleRunner.main(ConsoleRunner.java:73)

   I appreciate any help.

   On Jan 11, 2:27 pm, Brenton bashw...@gmail.com wrote:

Today we are releasing ClojureScript One. A project to help you get
started writing single-page applications in ClojureScript.

   http://clojure.com/blog/2012/01/11/announcing-clojurescript-one.html

   http://clojurescriptone.com/

   https://github.com/brentonashworth/one

This project is the result of a lot of hard work from the people at
Relevance. Thanks everyone.

-- 
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 One - Getting Started with ClojureScript

2012-01-12 Thread abaitam
Apparently I had Jenkins listening on port 8080. I can now see the
CLJS1 application. Will look at the jline problem later. Thanks
Brenton.

On Jan 12, 6:09 pm, abaitam abai...@gmail.com wrote:
 Hi,
 I removed the reference to jline.ConsoleRunner and the exception
 stopped but I get another error now:

 2012-01-12 18:05:34.527:INFO::Logging to STDERR via
 org.mortbay.log.StdErrLog
 2012-01-12 18:05:34.528:INFO::jetty-6.1.25
 2012-01-12 18:05:34.545:WARN::failed SocketConnec...@0.0.0.0:8080:
 java.net.BindException: Address already in use
 2012-01-12 18:05:34.545:WARN::failed Server@458e439a:
 java.net.BindException: Address already in use
 BindException Address already in use
 java.net.PlainSocketImpl.socketBind (PlainSocketImpl.java:-2)

 I used lsof -i | grep LISTEN to find if there is a process listening
 on the 8080 port but there is none. Also, shouldn't the ip be
 127.0.0.1 or localhost instead of 0.0.0.0?

 Thanks for your help

 On Jan 12, 5:03 pm, abaitam abai...@gmail.com wrote:







  Thanks, but I did run script/deps and it successfully completed I have
  all the jars under lib. I cloned CLJS1 several times but always got
  the same error.

  What information do you need to help me solve the problem?

  On Jan 12, 4:50 pm, Brenton bashw...@gmail.com wrote:

   It looks like you don't have Clojure. Did you run script/deps? Do you
   have anything in the lib directory?

   Try running it again.

   Brenton

   On Jan 12, 4:28 pm, abaitam abai...@gmail.com wrote:

I am dying to try this. However, the script/run script (on MAC) gives
me this error message:

Exception in thread main java.lang.ClassNotFoundException:
clojure.main
        at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
        at sun.misc.Launcher$ExtClassLoader.findClass(Launcher.java:229)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:169)
        at jline.ConsoleRunner.main(ConsoleRunner.java:73)

I appreciate any help.

On Jan 11, 2:27 pm, Brenton bashw...@gmail.com wrote:

 Today we are releasing ClojureScript One. A project to help you get
 started writing single-page applications in ClojureScript.

http://clojure.com/blog/2012/01/11/announcing-clojurescript-one.html

http://clojurescriptone.com/

https://github.com/brentonashworth/one

 This project is the result of a lot of hard work from the people at
 Relevance. Thanks everyone.

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


Is this a bug? extending protocol on js/Object

2012-01-12 Thread Dave Sann
code is below.

Basically - if I extend a protocol on js/Object then I get an error when 
calling map on a map with integer keys.

Is this a bug or an error on my part?

Cheers

Dave

Results first:

If the extend-protocol and call to 'fred' is commented, ths console shows

START 
one  
([2 1])
two
three
([:2 1])
four
five
([2 1])
done

If the extend-protocol and call to 'fred' is uncommented I get:

START 
one  
([2 1])
two
three
([:2 1])
four
Uncaught Error: No protocol method ISeqable.-seq defined for type boolean: 
true



Code:

(ns ptest.main)


(defn map-js [m]
  (let [out (js-obj)]
(doseq [[k v] m]
  (aset out (name k) v))
out))


(defn log 
  ([x]
(let [l (if (map? x) (map-js x) x)]
  (.log js/console l)
  x))
  ([m x]
(do (log {:msg m :data x}) x)))

(defn log-str 
  ([x] (do (log (pr-str x)) x))
  ([m x] (do (log-str {:msg m :data x}) x)))


(log-str START)

(defprotocol FRED
  (fred [this] fred))

(log-str one)
(log-str 
  (map (fn [[k v]] [k v])
   {2  1}))

(extend-protocol FRED
  js/Object
  (fred [this] this))

(log-str two)
(fred {})


(log-str three)
(log-str 
  (map (fn [[k v]] [k v])
   {:2 1}))


(log-str four)
(def a (doall (map (fn [[k v]] [k v])
   {2 1})))
 
(log-str five)
(log-str a)
  


(log-str done)

-- 
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: Struggling in making a sub-process work in an interactive way

2012-01-12 Thread jaime
Well actually I also tried commons-exec but it's the same as
clojure.java.shell - they run system command directly, after execution
they return and terminate. That's not the way I want

On Jan 13, 2:42 am, Denis Labaye denis.lab...@gmail.com wrote:
 Hi,

 In Java you would do it with common-exec:http://commons.apache.org/exec/

 So add the deps to your project.clj :

 :dependencies [[org.apache.commons/commons-exec 1.1]]

 And use Clojure's Java interop.

 Keep us posted, I will need to do the same thing soon :)

 Denis







 On Wed, Jan 11, 2012 at 4:05 AM, jaime xiejianm...@gmail.com wrote:
  I didn't read your code carefully yet but I think you're meaning to
  copy streams between my Clojure code and the sub-process, actually
  I've tried this but this is probably not what I want.
  I might not make myself clear. So here I go again:
   1. I writing a program which will open an OS shell (that means cmd
  under Windows and bash under Linux) as sub-process
   2. this shell thing will not terminate while my code is still
  running, all system commands such as dir/ls/cat etc. will be thrown
  into     the shell's input-stream to execute and the result is pulled
  from shell's output-stream/err-stream
   3. because when the shell will finish its execution is
  unpredictable, I chained an echo stop-sign command to original
  command so that the program can get the sign when execution done. E.g.
  for command dir, I will throw dir echo stop-sign to the shell,
  when a stop-sign is captured then it knows the execution finished
   4. it works well so far but when the system command is interactive
  one such as 'time' (in Windows), the program will hang; if there are
  ways to know when to require user input then I can resolve this in the
  code, but the answer is NO. I didn't find a way to detect this
   5. thus I tried to find out any workarounds but failed. I also tried
  the way you mentioned here, it can work in an interactive way but in
  this case I cannot get the control back.

  That's all the things I'm struggling on...

  On Jan 10, 4:54 pm, Alan Malloy a...@malloys.org wrote:
   On Jan 9, 9:24 pm, Phil Hagelberg p...@hagelb.org wrote:

jaime xiejianm...@gmail.com writes:
 Later on I tried to add code that can make this possible but I found
 there's no way to detect if a command requires user's input and thus
  I
 have to find another way to make it work - but I didn't success and
 have been struggling for a workaround for a long while

 anyone has any idea?

As far as I know this is impossible to do without bringing in
third-party libraries; this is just a (rather serious) shortcoming of
the JDK. I haven't looked into it enough to know which libraries would
offer it though.

   This should be possible if you don't mind suiciding your own process's
   stdin/stdout, by blindly forwarding all your input and output through
   the child. But if you send the child some input it didn't need, and it
   terminates, and then later you need your own stdin again, some pieces
   will be missing.

   I was going to attach a simple proof of concept to this, but I can't
   seem to get it right. So instead, here's what I was trying to do, and
   if someone wants to take it up this might be something useful to work
   from:

   (ns fork.core
     (:require [clojure.java.io :as io])
     (:import (java.io PipedReader PipedWriter))
     (:gen-class))

   (defn -main [ args]
     (println Start typing, I'll cat it back atcha!)
     (let [child (- (Runtime/getRuntime) (.exec /bin/cat))
           cin (.getInputStream child)
           cout (.getOutputStream child)

           in-pipe-in (PipedReader.)
           in-pipe-out (PipedWriter. in-pipe-in)

           out-pipe-in (PipedReader.)
           out-pipe-out (PipedWriter. out-pipe-in)

           in *in*, out *out*] ;; avoid dynamic-binding issues
       (future (io/copy in in-pipe-out)) ;; read my stdin...
       (future (io/copy in-pipe-in cout)) ;; write it to child's stdin

       (future (io/copy cin out-pipe-out)) ;; read child's stdout...
       @(future (io/copy out-pipe-in out)) ;; write it to my stdout, and
   wait for it to finish
       (let [exit-code (.waitFor child)]
         (println Child process finished with exit code exit-code)
         exit-code)))

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

Re: Is this a bug? extending protocol on js/Object

2012-01-12 Thread David Nolen
You should never extend js/Object.

On Thursday, January 12, 2012, Dave Sann daves...@gmail.com wrote:
 code is below.
 Basically - if I extend a protocol on js/Object then I get an error when
calling map on a map with integer keys.
 Is this a bug or an error on my part?
 Cheers
 Dave
 Results first:
 If the extend-protocol and call to 'fred' is commented, ths console shows
 START
 one
 ([2 1])
 two
 three
 ([:2 1])
 four
 five
 ([2 1])
 done
 If the extend-protocol and call to 'fred' is uncommented I get:

 START
 one
 ([2 1])
 two
 three
 ([:2 1])
 four
 Uncaught Error: No protocol method ISeqable.-seq defined for type
boolean: true



 Code:
 (ns ptest.main)

 (defn map-js [m]
   (let [out (js-obj)]
 (doseq [[k v] m]
   (aset out (name k) v))
 out))

 (defn log
   ([x]
 (let [l (if (map? x) (map-js x) x)]
   (.log js/console l)
   x))
   ([m x]
 (do (log {:msg m :data x}) x)))
 (defn log-str
   ([x] (do (log (pr-str x)) x))
   ([m x] (do (log-str {:msg m :data x}) x)))

 (log-str START)
 (defprotocol FRED
   (fred [this] fred))
 (log-str one)
 (log-str
   (map (fn [[k v]] [k v])
{2  1}))
 (extend-protocol FRED
   js/Object
   (fred [this] this))
 (log-str two)
 (fred {})

 (log-str three)
 (log-str
   (map (fn [[k v]] [k v])
{:2 1}))

 (log-str four)
 (def a (doall (map (fn [[k v]] [k v])
{2 1})))

 (log-str five)
 (log-str a)


 (log-str done)

 --
 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: Literate Programming in Emacs?

2012-01-12 Thread Andrew
Eric asks: The only function ob-clojure uses from swank-clojure is 
`swank:interactive-eval-region' (used with `slime-eval') in the 
`org-babel-execute:clojure' function. Which function would now be used to 
evaluate a region of clojure code? Would `slime-eval-region' suffice?

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