RE: new with clojure, need help!

2012-04-26 Thread Guofeng Zhang
See if the following is helpful:

http://dev.clojure.org/display/doc/Getting+Started+with+Eclipse+and+Counterclockwise


From: clojure@googlegroups.com [mailto:clojure@googlegroups.com] On Behalf Of 
omer
Sent: Wednesday, April 25, 2012 10:37 PM
To: clojure@googlegroups.com
Subject: new with clojure, need help!

hello im need to learn how to use clojure and how it works,
i found some videos the helped me a bit to understand how clojure works,
but i need a more basic guidence on how to install the nessecery plugins
to eclipse, and what to do with them...
any tutorial will do! thats...
p.s. im using windows and i need to learn how to operate it for a course in 
"programing languge pricipals"...
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
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: lein-cljsbuild on Windows?

2012-04-26 Thread Guofeng Zhang
I need to copy or install lein-cljsbuild-0.1.8.jar to LEIN's plugins directory. 
Then each steps works well.

Thanks for your help.

-Original Message-
From: clojure@googlegroups.com [mailto:clojure@googlegroups.com] On Behalf Of 
nchurch
Sent: Friday, April 27, 2012 2:49 AM
To: Clojure
Subject: lein-cljsbuild on Windows?

It sounds like lein deps is not getting all the dependencies (there should be 
four files to .lein-plugins and one to lib); it must be a windows-specific 
issue as I have no problem cloning the project on Mac; and unfortunately I do 
not have access to Windows, so can't say what the problem may be.  There may be 
a Windows issue with lein- cljsbuild; see this thread:

http://groups.google.com/group/clojure/browse_thread/thread/52e41094d69f6577

I wonder if you could copy the dependencies manually.  Another thing you could 
try is to intall lein-cljsbuild globally with lein plugin install.

On Apr 26, 2:36 am, Guofeng Zhang  wrote:
> Trying ctest.
>
> if I clone the project then run " lein cljsbuild auto" in it, I got:
> Copying 3 files to D:\projects\app\clojure\contrib\ctest\.lein-plugins
> Compiling ClojureScript.
> Error: Could not find or load main class clojure.main
>
> If I run "lein deps", then run "lein cljsbuild auto", I got:
> That's not a task. Use "lein help" to list all tasks.
>
> Do I need extra configuration for my environment?
>
> Leiningen 1.7.1 on Java 1.7.0_03 Java HotSpot(TM) 64-Bit Server VM
>  Windows 7
>
> Thanks
>
>
>
>
>
>
>
> -Original Message-
> From: clojure@googlegroups.com [mailto:clojure@googlegroups.com] On 
> Behalf Of nchurch
> Sent: Thursday, April 26, 2012 12:49 PM
> To: Clojure
> Subject: Re: Having trouble running clojurescript repl
>
> BTW, I pushed a minimal lein-cljsbuild project with REPL here:
>
> https://github.com/nchurch/ctest
>
> On Apr 25, 9:30 pm, Sean Neilan  wrote:
> > Holy shnikes! That did it!
>
> > Thank you so much!
>
> > I'll submit a patch to the documentation.
>
> > On Wed, Apr 25, 2012 at 11:27 PM, David Nolen wrote:
>
> > > sounds like you didn't set CLOJURESCRIPT_HOME or that it was set 
> > > incorrectly.
>
> > > On Wed, Apr 25, 2012 at 9:40 PM, Sean Neilan  wrote:
>
> > >> Hi All,
>
> > >> I'm not sure if this has been asked before.
>
> > >> I followed the quickstart guide:
> > >>https://github.com/clojure/clojurescript/wiki/Quick-Startanddid
>
> > >> git clone git://github.com/clojure/clojurescript.git
> > >> cd clojurescript
> > >> ./script/bootstrap
>
> > >> Then I tried
> > >> rmc-235-244:clojurescript seanneilan$ ./script/repl Clojure
> > >> 1.3.0-beta1 user=> which worked
>
> > >> But, when I did
> > >> user=> (require '[cljs.repl :as repl]) I got 
> > >> FileNotFoundException Could not locate cljs/repl__init.class or 
> > >> cljs/repl.clj on
> > >> classpath:   clojure.lang.RT.load (RT.java:430)
>
> > >> I tried running
> > >> rmc-235-244:clojurescript seanneilan$ ./script/repljs
>
> > >> But I got
> > >> Exception in thread "main" java.lang.RuntimeException:
> > >> java.io.FileNotFoundException: Could not locate 
> > >> cljs/repl__init.class or cljs/repl.clj on classpath:
> > >>  at clojure.lang.Util.runtimeException(Util.java:153)
> > >> at clojure.lang.Compiler.eval(Compiler.java:6417)
> > >>  at clojure.lang.Compiler.eval(Compiler.java:6372)
> > >> at clojure.core$eval.invoke(core.clj:2745)
> > >>  at clojure.main$eval_opt.invoke(main.clj:296)
> > >> at clojure.main$initialize.invoke(main.clj:315)
> > >>  at clojure.main$null_opt.invoke(main.clj:348)
> > >> at clojure.main$main.doInvoke(main.clj:426)
> > >>  at clojure.lang.RestFn.invoke(RestFn.java:421)
> > >> at clojure.lang.Var.invoke(Var.java:405)
> > >>  at clojure.lang.AFn.applyToHelper(AFn.java:163)
> > >> at clojure.lang.Var.applyTo(Var.java:518)
> > >>  at clojure.main.main(main.java:37) Caused by:
> > >> java.io.FileNotFoundException: Could not locate 
> > >> cljs/repl__init.class or cljs/repl.clj on classpath:
> > >>  at clojure.lang.RT.load(RT.java:430) at
> > >> clojure.lang.RT.load(RT.java:398)
> > >>  at clojure.core$load$fn__4636.invoke(core.clj:5377)
> > >> at clojure.core$load.doInvoke(core.clj:5376)
> > >>  at clojure.lang.RestFn.invoke(RestFn.java:408)
>

RE: Having trouble running clojurescript repl

2012-04-26 Thread Guofeng Zhang
Trying ctest.

if I clone the project then run " lein cljsbuild auto" in it, I got:
Copying 3 files to D:\projects\app\clojure\contrib\ctest\.lein-plugins
Compiling ClojureScript.
Error: Could not find or load main class clojure.main

If I run "lein deps", then run "lein cljsbuild auto", I got:
That's not a task. Use "lein help" to list all tasks.

Do I need extra configuration for my environment?

Leiningen 1.7.1 on Java 1.7.0_03 Java HotSpot(TM) 64-Bit Server VM
 Windows 7

Thanks

-Original Message-
From: clojure@googlegroups.com [mailto:clojure@googlegroups.com] On Behalf Of 
nchurch
Sent: Thursday, April 26, 2012 12:49 PM
To: Clojure
Subject: Re: Having trouble running clojurescript repl

BTW, I pushed a minimal lein-cljsbuild project with REPL here:

https://github.com/nchurch/ctest

On Apr 25, 9:30 pm, Sean Neilan  wrote:
> Holy shnikes! That did it!
>
> Thank you so much!
>
> I'll submit a patch to the documentation.
>
> On Wed, Apr 25, 2012 at 11:27 PM, David Nolen wrote:
>
>
>
>
>
>
>
> > sounds like you didn't set CLOJURESCRIPT_HOME or that it was set 
> > incorrectly.
>
> > On Wed, Apr 25, 2012 at 9:40 PM, Sean Neilan  wrote:
>
> >> Hi All,
>
> >> I'm not sure if this has been asked before.
>
> >> I followed the quickstart guide:
> >>https://github.com/clojure/clojurescript/wiki/Quick-Startand did
>
> >> git clone git://github.com/clojure/clojurescript.git
> >> cd clojurescript
> >> ./script/bootstrap
>
> >> Then I tried
> >> rmc-235-244:clojurescript seanneilan$ ./script/repl Clojure 
> >> 1.3.0-beta1 user=> which worked
>
> >> But, when I did
> >> user=> (require '[cljs.repl :as repl]) I got FileNotFoundException 
> >> Could not locate cljs/repl__init.class or cljs/repl.clj on 
> >> classpath:   clojure.lang.RT.load (RT.java:430)
>
> >> I tried running
> >> rmc-235-244:clojurescript seanneilan$ ./script/repljs
>
> >> But I got
> >> Exception in thread "main" java.lang.RuntimeException:
> >> java.io.FileNotFoundException: Could not locate 
> >> cljs/repl__init.class or cljs/repl.clj on classpath:
> >>  at clojure.lang.Util.runtimeException(Util.java:153)
> >> at clojure.lang.Compiler.eval(Compiler.java:6417)
> >>  at clojure.lang.Compiler.eval(Compiler.java:6372)
> >> at clojure.core$eval.invoke(core.clj:2745)
> >>  at clojure.main$eval_opt.invoke(main.clj:296)
> >> at clojure.main$initialize.invoke(main.clj:315)
> >>  at clojure.main$null_opt.invoke(main.clj:348)
> >> at clojure.main$main.doInvoke(main.clj:426)
> >>  at clojure.lang.RestFn.invoke(RestFn.java:421)
> >> at clojure.lang.Var.invoke(Var.java:405)
> >>  at clojure.lang.AFn.applyToHelper(AFn.java:163)
> >> at clojure.lang.Var.applyTo(Var.java:518)
> >>  at clojure.main.main(main.java:37) Caused by: 
> >> java.io.FileNotFoundException: Could not locate 
> >> cljs/repl__init.class or cljs/repl.clj on classpath:
> >>  at clojure.lang.RT.load(RT.java:430) at 
> >> clojure.lang.RT.load(RT.java:398)
> >>  at clojure.core$load$fn__4636.invoke(core.clj:5377)
> >> at clojure.core$load.doInvoke(core.clj:5376)
> >>  at clojure.lang.RestFn.invoke(RestFn.java:408)
> >> at clojure.core$load_one.invoke(core.clj:5191)
> >>  at clojure.core$load_lib.doInvoke(core.clj:5228)
> >> at clojure.lang.RestFn.applyTo(RestFn.java:142)
> >>  at clojure.core$apply.invoke(core.clj:602)
> >> at clojure.core$load_libs.doInvoke(core.clj:5262)
> >>  at clojure.lang.RestFn.applyTo(RestFn.java:137)
> >> at clojure.core$apply.invoke(core.clj:602)
> >>  at clojure.core$require.doInvoke(core.clj:5343)
> >> at clojure.lang.RestFn.invoke(RestFn.java:408)
> >>  at user$eval1.invoke(NO_SOURCE_FILE:1)
> >> at clojure.lang.Compiler.eval(Compiler.java:6406)
> >>  ... 11 more
>
> >> I'm not sure what's going on. Thank you for your time!
>
> >> -Sean
> >> s...@seanneilan.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
>
> >  --
> > You received this message because you are subscribed to the Google 
> > Groups "Clojure" group.
> > 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
cl

clojurescript: generating the JavaScript on the fly?

2011-10-27 Thread Guofeng Zhang
Hi,

Suppose there is a ajax request comes to the server. The server code process it 
and then send some JavaScript codes as the response.

Could clojurescript be using in the case? For example, given a string 
representing the Clojurescript code, then build it into Javascript codes in the 
memeory, then the codes are send back to the client as the response.

Thanks!

Guofeng

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
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

when quotes and when syntax-quotes?

2011-10-17 Thread Guofeng Zhang
Hi,

I am reading Joy of Clojure, there is the following sample in 8.1.1:
(defn contextual-eval [ctx expr]
  (eval
`(let [~@(mapcat (fn [[k v]] [k `'~v]) ctx)]
   ~expr)))

And the sample output:
(contextual-eval {'a 1, 'b 2} '(+ a b))
;=> 3
(contextual-eval {'a 1, 'b 2} '(let [b 1000] (+ a b)))
;=> 1001

I do not understand why "`'~v" has be to used this way. If I used "`~v" instead 
(that is, remove the quote), it still works. So my question is, why "~v" needs 
to be first quoted and then syntax-quoted?

Thanks 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