clojure.test on ClojureScript?

2012-02-25 Thread Shantanu Kumar
Hi,

Has anybody got clojure.test working with ClojureScript? Is it planned
for clojure.test to eventually work on ClojureScript?

Shantanu

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from 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: Bret Victor - Inventing on Principle

2012-02-25 Thread Phil Hagelberg
Craig Brozefsky  writes:

>> Yes, what a great object lesson in the usefulness of being able to
>> disable locals clearing. Gave me a lot to think about regarding what
>> kind of feedback tools should provide.
>
> I don't understand what "disable locals clearing" means.

In order to avoid memory leaks when dealing with lazy seqs, Clojure's
compiler must emit instructions to clear references to locals so they
can be GC'd. This is necessary in production but severely cripples
debuggers since they only have access to locals that haven't been
cleared. It would also probably be necessary for this kind of live
tracing.

There's a patch that fixes this problem waiting to be applied:

http://dev.clojure.org/jira/browse/CLJ-860

-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: Bret Victor - Inventing on Principle

2012-02-25 Thread cameron
Great video,
   it was interesting that the binary search example only really works
with pure functions since you must specify all of the initial state
for the debugger/visualiser.

In non-pure functions (and oo) the user is unlikely to be able to
specify valid values for all the mutable state even if the application
could tell them which variables were being referenced.

In clojure something like this might not be too difficult, perhaps we
could:
  - define a temporary function with the same text
  - use CDT or another debugger to set a break-point in the temporary
function
  - call the function and capture the current stack frame variables at
each invocation & display as in the video

Support for higher order functions and list comprehension (map,
reduce, for, etc.) may be difficult though.


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


[ANN] shrink 0.1.0 - generative testing tool for finding smallest failure

2012-02-25 Thread Alex Baranosky
This is a library for "shrinking" failure cases. All the major
QuickCheck-like testing libraries use a similar approach.  I am building
Midje support for generative testing, and in the process noticed that
test.generative doesn't shrink and (at least at the time) ClojureCheck
didn't either.  Thus I decided a library like this might be of some general
purpose use to the test-library writers in the community.

https://github.com/AlexBaranosky/Shrink

As usual feedback, and involvement in the project are welcome.

Best,
Alex

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

[ANN] clj-json-rpc 0.1: a Ring-compatible handler for JSON-RPC web services

2012-02-25 Thread Daniel Janus
Hi,

I've just released version 0.1 of clj-json-rpc to Clojars. clj-json-rpc is 
a Clojure library that makes it easy to create web services using the 
JSON-RPC protocol and Ring. Check it out 
at https://github.com/nathell/clj-json-rpc

Enjoy,
Daniel

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from 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: Bret Victor - Inventing on Principle

2012-02-25 Thread kovas boguta
This is pretty cool, and definitely something that is needed.

In terms of images etc, I see these as resources that are referenced
by the expressions going over the wire, rather than embedded in the
expressions directly. You can just send the url to the image (or data
later turned into a url), and then the resource is loaded in the
browser via http.

Continuing my html5 repl rationale at
http://groups.google.com/group/clojure-tools/browse_thread/thread/f0ef25f5489b4554?hl=en


On Fri, Feb 24, 2012 at 11:39 PM, Chas Emerick  wrote:
> That's a nice summary, and is part of what I'm hoping to enable with 
> nREPL.[1]  I started with it trying to provide a tool-agnostic REPL backend, 
> but I quickly wanted to get past the rigid text orientation of that medium.  
> Yes, Clojure forms are always read as text, and that's the dominant medium of 
> interaction used by programmers everywhere, but it doesn't (and maybe 
> shouldn't) be that way.  Certainly, the leverage provided by well-executed, 
> relevant, perhaps-interactive visualizations is becoming widely appreciated; 
> I don't see why we should allow our programming practice to be segregated in 
> a text ghetto when different mediums are better — or necessary.
>
> Anyway, nREPL has developed to the point where middlewares can be written to 
> easily offer richer representations of data within the REPL.  An example of 
> my earliest (primitive!) experiments around this are available here[2].  
> Images and other data flowing through a REPL isn't a _huge_ deal, except that:
>
> * nREPL is tool-agnostic; reply (and therefore Leiningen v2) or vimclojure or 
> jark or textmate or sublime text can elect to receive those other 
> representations, and present them to the user however is appropriate
>
> * nREPL is transport-agnostic; the default socket transport (bencode[3] with 
> some particular semantics) is very lightweight, and can receive or transmit 
> binary data efficiently (a distinct advantage compared to shipping textual 
> encodings of such data in e.g. s-expressions).
>
> A proof of concept of a tty transport is included in nREPL (so you could 
> connect to an nREPL backend using something as meager as telnet), and I have 
> a sketch of an nREPL ring handler that I'll get out on github soon.  This 
> should allow you to easily drop an nREPL endpoint into any ring app, connect 
> to it with any HTTP or nREPL client, and do anything you'd like to do in a 
> REPL without tunneling, mucking around with ssh tunnels, and taking advantage 
> of all existing webapp security regime you have in place.  And, if you have 
> the right middlewares in place and a suitably-capable client, rich 
> representations of REPL data and rich interactions with the same should be 
> within arm's reach.
>
> I have less of a vision for the HTML5 side of things. I'm certain a killer 
> in-browser nREPL client could be put together to take advantage of all of the 
> above, whether it's connecting to an HTTP nREPL endpoint or a (web)socket 
> transport using nREPL's wire protocol, but I'm personally more interested on 
> "thick clients" (perhaps embedding webviews as necessary!) for various 
> reasons.
>
> FYI, for anyone working on tooling to help support things like this, I'd 
> invite you to join the clojure-tools group I created recently:
>
> http://groups.google.com/group/clojure-tools/browse_thread/thread/48ff47ab5d7ca2c?hl=en
>
> Cheers,
>
> - Chas
>
> [1] http://github.com/clojure/tools.nrepl
> [2] 
> http://cemerick.com/2011/10/26/enabling-richer-interactions-in-the-clojure-repl/
> [3] It turns out that bencode and the way nREPL uses it seems similar to but 
> much simpler than Google's SPDY protocol.
>
> On Feb 24, 2012, at 5:33 PM, kovas boguta wrote:
>
>> That's a great talk, and a great basic principle: that creators need
>> an immediate connection to their creation.
>>
>> I realized this has also been my side project for the last few months,
>> though mostly in "hammock phase".
>>
>> I think the foundational technology we need, as a community, is an
>> "html5 repl". You type code into the browser, and can create output
>> that takes advantage of the host's capabilities - graphics, video, UI
>> etc.
>>
>> The problem is a bit more multifaceted then just html though, as it
>> also involves UI state, persisting the sessions, how to share/reuse
>> the creations, and the general problem of UI description in the
>> context of clojurescript.
>>
>> But where this gets you is this: a clojure interaction environment
>> based on web standards, rather than narrow dialects like elisp and
>> swing. So the lines between programming clojure, extending the clojure
>> programming environment, and deploying webapps goes away. It's
>> possible to see a line between this category of tool, and the demos in
>> the presentation.
>>
>> If the game is tightly coupling data, code, and complex visual
>> representation, we have the building blocks to bust that game wide
>> open. It makes no sense 

Re: Bret Victor - Inventing on Principle

2012-02-25 Thread Craig Brozefsky
Phil Hagelberg  writes:

> Yes, what a great object lesson in the usefulness of being able to
> disable locals clearing. Gave me a lot to think about regarding what
> kind of feedback tools should provide.

I don't understand what "disable locals clearing" means.

-- 
Craig Brozefsky 
Premature reification is the root of all 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: ClojureScript "use" statement not working

2012-02-25 Thread David Nolen
Patches welcome! :)

http://dev.clojure.org/jira/browse/CLJS

David

On Sat, Feb 25, 2012 at 6:14 PM, Chris McBride  wrote:

> Thanks,
>
> Also, having a line number that corresponds to my source would be
> helpful.
>
> On Feb 25, 4:41 pm, Cedric Greevey  wrote:
> > On Sat, Feb 25, 2012 at 4:04 PM, Mark Rathwell 
> wrote:
> > > You must (:use ... :only ...) with ClojureScript
> >
> > "nth not supported on this type: Symbol" is not a very helpful error
> > message for diagnosing this problem.
>
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with
> your first post.
> To unsubscribe from 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 "use" statement not working

2012-02-25 Thread Chris McBride
Thanks,

Also, having a line number that corresponds to my source would be
helpful.

On Feb 25, 4:41 pm, Cedric Greevey  wrote:
> On Sat, Feb 25, 2012 at 4:04 PM, Mark Rathwell  
> wrote:
> > You must (:use ... :only ...) with ClojureScript
>
> "nth not supported on this type: Symbol" is not a very helpful error
> message for diagnosing this problem.

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from 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: Bret Victor - Inventing on Principle

2012-02-25 Thread Phil Hagelberg
Raju Bitter  writes:

>  Didn't have the time to watch thevideo yesterday, and just watched
> it. Visualizing code in such a way is amazing, could be extremely
> useful when teaching how to program.

Yes, what a great object lesson in the usefulness of being able to
disable locals clearing. Gave me a lot to think about regarding what
kind of feedback tools should provide.

It's funny to hear a half-hour talk on Cybernetics without mentioning
the term at all, but I'm glad the ideas are getting exposure.

-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: clj-webdriver: Clojure API for Selenium-WebDriver

2012-02-25 Thread Devin Walters
Nicely written library from what I can tell. Thanks for this. (inc) for 
including a screencast and providing such great documentation. Looking forward 
to using this in the future. 

Cheers,
'(Devin Walters)


On Saturday, February 25, 2012 at 12:19 AM, Yan Aung wrote:

> Sweet! I'm excited to do browser testing again using this.
> Screencast is awesome. Thanks for putting it together.
> -Yan
> 
> On Feb 18, 4:57 pm, semperos http://gmail.com)> 
> wrote:
> > Though this library has been in development for several months, I'd like to
> > publicly announce the availability of clj-webdriver, a Clojure library for
> > using web browsers from Clojure for the purposes of automated web testing
> > (leveraging Selenium-WebDriver under the hood).
> > 
> > I've released a brief screencast introducing
> > clj-webdriver:http://blip.tv/semperos/introduction-to-clj-webdriver-taxi-api-5967872
> > 
> > The current version is [clj-webdriver "0.6.0-alpha2"]. The project is hosted
> > on Github  with an extensive 
> > wiki.
> > Feedback welcome and pull requests encouraged!
> > 
> > -Daniel
> 
> -- 
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com 
> (mailto:clojure@googlegroups.com)
> Note that posts from new members are moderated - please be patient with your 
> first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com 
> (mailto: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 "use" statement not working

2012-02-25 Thread Cedric Greevey
On Sat, Feb 25, 2012 at 4:04 PM, Mark Rathwell  wrote:
> You must (:use ... :only ...) with ClojureScript

"nth not supported on this type: Symbol" is not a very helpful error
message for diagnosing this problem.

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from 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: Next vs. rest (and reduce)

2012-02-25 Thread Stephen Compall
On Sat, 2012-02-25 at 03:32 -0800, JuanManuel Gimeno Illa wrote:
> The source code of reduce is (I've marked in 
> red the calls than I do not understand).

Please keep in mind that some mail readers are viewing the plain text
part, so can't see HTML markup, especially among an audience likely to
be using exotic mail readers.

> (def  
> reduce
>  (fn r

First, this is a bootstrapping reduce.  Normally:

>([f coll]
>  (let [s (seq coll)]

You could put a `loop' right here, but the implementation of `loop'
itself uses reduce!  (This has since been changed in core.clj to rename
this reduce to a private "reduce1" so its status is clearer.)

You could use the bootstrapping loop, but...ugh.

With a loop over s here:

>(if s
>  (r f (first s) (next s))

and a `recur' here, you would avoid that extra seq.

And the second `seq' follows the fast path out, so is not much worth
worrying about.

> (next s) == (seq (rest s))

They are semantically equivalent, but implementers of ISeq may provide
implementations with different performance characteristics.

> Could the same recur call be done using rest?

Yes.

> What is more idiomatic?

Use `next' when you are definitely about to force it with `seq',
`empty?', or something anyway, `rest' otherwise.  `reduce' qualifies for
the former.

-- 
Stephen Compall
^aCollection allSatisfy: [:each|aCondition]: less is better

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from 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 "use" statement not working

2012-02-25 Thread Mark Rathwell
You must (:use ... :only ...) with ClojureScript

On Sat, Feb 25, 2012 at 3:31 PM, Chris McBride  wrote:
> I have a namespace statement like this:
>
> (ns alephtest.websocket
>  (:require [alephtest.js-utils :as util]))
>
> If I change this to:
>
> (ns alephtest.websocket
>  (:use alephtest.js-utils))
>
> I get this stack trace from the cljsbuild plugin (it took me a while
> to figure what was causing this):
>
> java.lang.UnsupportedOperationException: nth not supported on this
> type: Symbol
>                  RT.java:835 clojure.lang.RT.nthFrom
>                  RT.java:785 clojure.lang.RT.nth
>             compiler.clj:820 cljs.compiler/eval1118[fn]
>                core.clj:2432 clojure.core/map[fn]
>              LazySeq.java:42 clojure.lang.LazySeq.sval
>              LazySeq.java:60 clojure.lang.LazySeq.seq
>                  RT.java:466 clojure.lang.RT.seq
>                 core.clj:133 clojure.core/seq
>                 core.clj:600 clojure.core/apply
>                core.clj:2459 clojure.core/mapcat
>              RestFn.java:423 clojure.lang.RestFn.invoke
>             compiler.clj:820 cljs.compiler/eval1118[fn]
>             protocols.clj:64 clojure.core.protocols/fn
>             protocols.clj:11 clojure.core.protocols/fn[fn]
>                core.clj:5995 clojure.core/reduce
>             compiler.clj:831 cljs.compiler/eval1118[fn]
>             MultiFn.java:177 clojure.lang.MultiFn.invoke
>            compiler.clj:1040 cljs.compiler/analyze-seq
>            compiler.clj:1093 cljs.compiler/analyze
>            compiler.clj:1086 cljs.compiler/analyze
>            compiler.clj:1153 cljs.compiler/compile-file*
>            compiler.clj:1191 cljs.compiler/compile-file
>            compiler.clj:1251 cljs.compiler/compile-root
>              closure.clj:350 cljs.closure/compile-dir
>              closure.clj:382 cljs.closure/eval1687[fn]
>              closure.clj:261 cljs.closure/eval1618[fn]
>              closure.clj:396 cljs.closure/eval1674[fn]
>              closure.clj:261 cljs.closure/eval1618[fn]
>              closure.clj:830 cljs.closure/build
>                  core.clj:71 cljsbuild.core/compile-cljs
>                 core.clj:183 cljsbuild.core/run-compiler
>             NO_SOURCE_FILE:1 user/eval2057[fn]
>                 core.clj:158 cljsbuild.core/in-threads[fn]
>                core.clj:1817 clojure.core/binding-conveyor-fn[fn]
>                  AFn.java:18 clojure.lang.AFn.call
>          FutureTask.java:303 java.util.concurrent.FutureTask
> $Sync.innerRun
>          FutureTask.java:138 java.util.concurrent.FutureTask.run
>  ThreadPoolExecutor.java:886 java.util.concurrent.ThreadPoolExecutor
> $Worker.runTask
>  ThreadPoolExecutor.java:908 java.util.concurrent.ThreadPoolExecutor
> $Worker.run
>              Thread.java:662 java.lang.Thread.run
>
> Are use statements support in ClojureScript?
>
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with your 
> first post.
> To unsubscribe from 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


ClojureScript "use" statement not working

2012-02-25 Thread Chris McBride
I have a namespace statement like this:

(ns alephtest.websocket
  (:require [alephtest.js-utils :as util]))

If I change this to:

(ns alephtest.websocket
  (:use alephtest.js-utils))

I get this stack trace from the cljsbuild plugin (it took me a while
to figure what was causing this):

java.lang.UnsupportedOperationException: nth not supported on this
type: Symbol
  RT.java:835 clojure.lang.RT.nthFrom
  RT.java:785 clojure.lang.RT.nth
 compiler.clj:820 cljs.compiler/eval1118[fn]
core.clj:2432 clojure.core/map[fn]
  LazySeq.java:42 clojure.lang.LazySeq.sval
  LazySeq.java:60 clojure.lang.LazySeq.seq
  RT.java:466 clojure.lang.RT.seq
 core.clj:133 clojure.core/seq
 core.clj:600 clojure.core/apply
core.clj:2459 clojure.core/mapcat
  RestFn.java:423 clojure.lang.RestFn.invoke
 compiler.clj:820 cljs.compiler/eval1118[fn]
 protocols.clj:64 clojure.core.protocols/fn
 protocols.clj:11 clojure.core.protocols/fn[fn]
core.clj:5995 clojure.core/reduce
 compiler.clj:831 cljs.compiler/eval1118[fn]
 MultiFn.java:177 clojure.lang.MultiFn.invoke
compiler.clj:1040 cljs.compiler/analyze-seq
compiler.clj:1093 cljs.compiler/analyze
compiler.clj:1086 cljs.compiler/analyze
compiler.clj:1153 cljs.compiler/compile-file*
compiler.clj:1191 cljs.compiler/compile-file
compiler.clj:1251 cljs.compiler/compile-root
  closure.clj:350 cljs.closure/compile-dir
  closure.clj:382 cljs.closure/eval1687[fn]
  closure.clj:261 cljs.closure/eval1618[fn]
  closure.clj:396 cljs.closure/eval1674[fn]
  closure.clj:261 cljs.closure/eval1618[fn]
  closure.clj:830 cljs.closure/build
  core.clj:71 cljsbuild.core/compile-cljs
 core.clj:183 cljsbuild.core/run-compiler
 NO_SOURCE_FILE:1 user/eval2057[fn]
 core.clj:158 cljsbuild.core/in-threads[fn]
core.clj:1817 clojure.core/binding-conveyor-fn[fn]
  AFn.java:18 clojure.lang.AFn.call
  FutureTask.java:303 java.util.concurrent.FutureTask
$Sync.innerRun
  FutureTask.java:138 java.util.concurrent.FutureTask.run
  ThreadPoolExecutor.java:886 java.util.concurrent.ThreadPoolExecutor
$Worker.runTask
  ThreadPoolExecutor.java:908 java.util.concurrent.ThreadPoolExecutor
$Worker.run
  Thread.java:662 java.lang.Thread.run

Are use statements support in ClojureScript?

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from 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: Major lein-cljsbuild update: 0.1.0

2012-02-25 Thread Moritz Ulrich
Nice update! Especially because the crossover files don't pollute my
cljs-sources anymore :)

One suggestion: Wouldn't it be nicer if the default value for
:crossover-path would be a hidden (dot-) directory?

On Sat, Feb 25, 2012 at 10:06, Evan Mezeske  wrote:
> Hey,
>
> I just released a major update to the lein-cljsbuild plugin for
> Leiningen (version 0.1.0).  On top of a bunch of bug fixes and minor
> improvements, there are a couple new features:
>
> * Support for running ClojureScript tests, with an example using
> PhantomJS.
>
> * Support for running ClojureScript REPLs, with examples using Firefox
> and PhantomJS.
>
> * Early support for Leiningen Version 2.  (Unstable)
>
> If you're already using lein-cljsbuild, you'll want to review the
> documentation for migrating to the new version.  Hopefully it should
> be pretty painless:
>
> https://github.com/emezeske/lein-cljsbuild/blob/master/doc/MIGRATING-TO-0.1.0.md
>
> Thanks,
> -Evan
>
> https://github.com/emezeske/lein-cljsbuild
> http://clojars.org/lein-cljsbuild
>
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with your 
> first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en



-- 
Moritz Ulrich

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from 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: "-function" special?

2012-02-25 Thread Moritz Ulrich
It's the default prefix for methods in classes generated by gen-class:
http://clojure.github.com/clojure/clojure.core-api.html#clojure.core/gen-class

On Sat, Feb 25, 2012 at 15:17, ClusterCat  wrote:
> Hi there,
>
> in some clojure examples I see function names with a leading dash like
> -main()
> -getFoo() (in backing bean)
> -setBar() (in backing bean)
>
> Are these functions with leading dash anything special? Or is this dash
> required for some interop?
> I didn't find any documentation about it.
>
> Thanks in advance,
> Marcel
>
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with your
> first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en



-- 
Moritz Ulrich

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from 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: clj-webdriver: Clojure API for Selenium-WebDriver

2012-02-25 Thread Yan Aung
Sweet! I'm excited to do browser testing again using this.
Screencast is awesome. Thanks for putting it together.
-Yan

On Feb 18, 4:57 pm, semperos  wrote:
> Though this library has been in development for several months, I'd like to
> publicly announce the availability of clj-webdriver, a Clojure library for
> using web browsers from Clojure for the purposes of automated web testing
> (leveraging Selenium-WebDriver under the hood).
>
> I've released a brief screencast introducing
> clj-webdriver:http://blip.tv/semperos/introduction-to-clj-webdriver-taxi-api-5967872
>
> The current version is [clj-webdriver "0.6.0-alpha2"]. The project is hosted
> on Github  with an extensive 
> wiki.
> Feedback welcome and pull requests encouraged!
>
> -Daniel

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


Major lein-cljsbuild update: 0.1.0

2012-02-25 Thread Evan Mezeske
Hey,

I just released a major update to the lein-cljsbuild plugin for
Leiningen (version 0.1.0).  On top of a bunch of bug fixes and minor
improvements, there are a couple new features:

* Support for running ClojureScript tests, with an example using
PhantomJS.

* Support for running ClojureScript REPLs, with examples using Firefox
and PhantomJS.

* Early support for Leiningen Version 2.  (Unstable)

If you're already using lein-cljsbuild, you'll want to review the
documentation for migrating to the new version.  Hopefully it should
be pretty painless:

https://github.com/emezeske/lein-cljsbuild/blob/master/doc/MIGRATING-TO-0.1.0.md

Thanks,
-Evan

https://github.com/emezeske/lein-cljsbuild
http://clojars.org/lein-cljsbuild

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from 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: ns :import / reflection

2012-02-25 Thread ClusterCat

Yes, that did the trick.
Thank you.


Am 21.02.2012 02:53, schrieb Sean Corfield:

On Sat, Feb 18, 2012 at 1:29 PM, ClusterCat  wrote:

(ns test (:import (java.io File)))


This says import the File class from the package java.io


(ns test (:import (java.io.File)))


Try:

(ns test (:import java.io.File))


  (let [filename (first *command-line-args*)]
(println filename)
(let [file (File. filename)])))


I get an
"Reflection warning, X:\workspace\ClojureTest\bin\test.clj:9 - call to
java.io.File ctor can't be resolved."
which I also don't understand.


Clojure relies on type hints to avoid reflection - introspecting Java
class types to figure out calls. If you add ^String in let binding for
filename, it should remove the warning:

(let [^String filename (first *command-line-args*)] ...

HTH?


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


"-function" special?

2012-02-25 Thread ClusterCat

Hi there,

in some clojure examples I see function names with a leading dash like
-main()
-getFoo() (in backing bean)
-setBar() (in backing bean)

Are these functions with leading dash anything special? Or is this dash 
required for some interop?

I didn't find any documentation about it.

Thanks in advance,
Marcel

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


Hanging ClojureScript REPL in both inferior-lisp and slime-clojure (with latest clojure-mode and clojurescript-mode)

2012-02-25 Thread Lyndon Tremblay
REPL started; server listening on localhost port 6907
user=> nil
user=> nil
user=> "Type: " :cljs/quit " to quit"
WARNING: The form (. this toString) is no longer a property access.
Maybe you meant (. this -toString) instead?
WARNING: The form (. this toString) is no longer a property access.
Maybe you meant (. this -toString) instead?
WARNING: The form (. (js-keys hashobj) sort) is no longer a property
access. Maybe you meant (. (js-keys hashobj) -sort) instead?
ClojureScript:cljs.user> (+ 1 2)
<.hangs>

What can I do?

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from 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: Bret Victor - Inventing on Principle

2012-02-25 Thread Raju Bitter
 Didn't have the time to watch thevideo yesterday, and just watched
it. Visualizing code in such a way is amazing, could be extremely
useful when teaching how to program.

I think the browser-connected REPL in ClojureScript is already a good
step into the right direction, since it makes testing changes to the
code for visual effects A LOT easier. When I did a bit of Flex
development back in 2008 the application took 6 minutes to compile,
which meant a huge waste of time trying to improve UI effects. I've
heard of people who had compile times of up to 12-15 minutes for their
Flex apps. Imagine how much time you waste with such a workflow
(although that's more the case for very large enterpise apps, and not
a casual game).

Thanks again for the link!

- Raju

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


Next vs. rest (and reduce)

2012-02-25 Thread JuanManuel Gimeno Illa
I'm trying to understand the difference between next and rest, so I've 
taken clojure's implementation of some of the collection functions to view 
how those functions use them. The source code of reduce is (I've marked in 
red the calls than I do not understand).

(def  
reduce
 (fn r
   ([f coll]
 (let [s (seq coll)]
   (if s
 (r f (first s) (next s))
 (f
   ([f val coll]
  (let [s (seq coll)]
(if s
  (if (chunked-seq? s)
(recur f 
   (.reduce (chunk-first s) f val)
   (chunk-next s))
(recur f (f val (first s)) (next s)))
  val)

In the recur calls, the implementation uses next but the first think we do 
with the collection is seq. I've always been told that (next s) == (seq 
(rest s)) so, do we execute seq twice? Could the same recur call be done 
using rest? What is more idiomatic?

Thanks,

Juan Manuel

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