Re: ClojureScript and development workflow

2012-09-11 Thread Murtaza Husain

Hi Paul,

Thanks for the workflow. 

- use the Clojure REPL as much as possible, even for my CLJS code.  
Afterall, it's just Clojure, right?
This also encourages good program design, keeping browser-specific code 
in a single namespace

How do you achieve the above ? Do you specify your cljs code dir in the 
crossover ? I am assuming that as the cljs src dir is different, one will 
not be able to load the code directly in the repl by typing (use 'abc.bcd) ?

Thanks,
Murtaza

On Tuesday, September 11, 2012 12:36:01 AM UTC+5:30, Paul deGrandis wrote:
>
> Hi Laurent,
>
> I've been putting a few ClojureScript apps into production throughout this 
> year with much success.
> Because of earlier limitations/sensitivities in the browser-repl, my 
> workflow is a little different than those described above.
>
> Typically I:
>  - have cljsbuild-auto running
>  - use the Clojure REPL as much as possible, even for my CLJS code.  
> Afterall, it's just Clojure, right?
> This also encourages good program design, keeping browser-specific 
> code in a single namespace
>  - use the browser-repl only for exploring DOM-related pieces of my 
> application, or debugging
>  - use some sort of browser auto-refresh when I build new assets (HTML, 
> CSS, JS, etc.  For me, I use Ruby for this piece)
>
> I will often just use my browser's console for peeking at quick things in 
> the CLJS code (I only compile in advanced mode when I've locked in an app).
> When I need the browser-repl, I just use repl-listen in cljsbuild.  In 
> future projects I plan to explore and use piggyback.
>
> A lot of the grunt work I've needed to build out is captured in my 
> Shoreleave CLJS libs, including ways to fireoff a browser-repl with 
> query-string args.
>
> Hope this helps!
> Paul
>
>

-- 
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 and development workflow

2012-09-11 Thread Laurent PETIT
2012/9/10 Takahiro Hozumi 

> Hi,
> I refresh browser every time I change cljs files.
>
> > "Using the REPL as the main way to deliver code to the browser means
> never having to refresh the page. One could theoretically build an entire
> application without a single page refresh. If you find yourself refreshing
> the page after every change you make, you're doing it wrong. What is this,
> 2009?"
>
> I think this is somewhat exaggeration.
> REPL isn't good enough to push the all changes into browser.
>

Hello,

While I could learn "the long and hard way" where & when it is necessary to
restart the ClojureScript application (refresh the browser), I'd be
interesting in feedback in this area.

I guess that at least the following require a restart. Please correct /
explain as needed :

- change in CSS file on disk ?
- change in template file (either enfocus / hiccup-on-the-browser -don't
remember the name) ?

and also when doing certain changes to the ClojureScript code itself :
- when I add a new namespace ?
- same problem with multimethods as JVM Clojure ?
- ... ?

Thanks in advance,

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

Re: ClojureScript and development workflow

2012-09-11 Thread Laurent PETIT
2012/9/10 Chas Emerick 

> I've been using a combination of lein-cljsbuild to keep the on-disk
> generated code fresh and piggieback[1] for all of my cljs REPL needs.
>

Hello Chas,

I've tried to use piggieback. My current stack for playing with the
concepts is leiningen2 on the command line (to start the server), with
clsjbuild to compile the browser_repl.cljs to "bootstrap" the REPL
machinery (lein cljsbuild once), regular "lein repl" once project.clj has
been configured with the proper options) and a regular CCW 0.10.0 nrepl
client.

It works OK with the "out of the box" Rhino-backed evaluator, but as you
might guess, I have no interest in this and then I quickly jump to try &
get a Browser-based REPL running.

That's where things broke.
I did not manage to get things compiled correctly.

As it stands, it seems that I'll have to read & understand wiki pages from
ClojureScript project, nrepl documentation, piggieback documentation,
cljsbuild documentation, to really grasp the whole thing.
Seems a little bit daunting just to be able to "play" with it. Is there an
easier way ? A resource somewhere which already explains step-by-step how
to get started with a new project, cljsbuild for compiling from time to
time, and piggieback ?

Just asking before starting digging :-)

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

Re: Lightweight lib/way to strip html from text

2012-09-11 Thread Denis Labaye
Hi,

This thread on the Enlive mailling list may be of some interest to you:

[enlive] How to select all user visible text from webpage?
https://groups.google.com/forum/#!msg/enlive-clj/rrY08JdI4Tc/FmDuNjc6w_oJ


Denis

On Thu, Sep 6, 2012 at 7:41 PM, jamieorc  wrote:

> Hey all, I'm looking for a lightweight way to strip html from a long
> String of text and leave just the text. I've come across JSoup, but at over
> 300kb for the lib, not quite lightweight.
>
> Suggestions?
>
> Cheers,
> Jamie
>
> --
> 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: Plural dispatch

2012-09-11 Thread Chris Ford
Thanks for taking an interest, Brent.

Interesting that you're using atoms rather than vars - it means that method
registration is no longer thread-local. I wonder if there could be a
scenario where method registration was actually used to coordinate between
threads? :-)

That could actually be useful if you were using plural dispatch as an event
dispatching system, though whether it would be wise is another question...

Cheers,

Chris

On 6 September 2012 20:27, Brent Millare  wrote:

> I've made my own take of your plural dispatch system.
>
> https://gist.github.com/3659663
>
> I switched from using vars and a map for determining which pluralfn to
> use, to atoms and metadata tied to the pluralfn. My method reduces the
> amount of indirection and invocations. I originally tried to make a deftype
> version to store the data, but then I'd have to reimplement all of the
> microsyntax of of clojure.core/fn and expand out the args to all the
> arities, not fun.
>
> Also I created defplural-body which doesn't specify the argument arity
> which you can use to avoid sequencing/unsequencing arguments for
> performance. I defined defplural in terms of defplural-body, which
> maintains compatibility with your examples.
>
> My code has the advantage over some implementation details in multimethods
> in that redefining the pluralfn does not cause you to forget all the
> implementations since defplural-body checks for existing implementations.
> This, however, will require the user to run clear-implementations! if one
> does want to forget all the implementations.
>
>
> On Wednesday, September 5, 2012 6:48:36 AM UTC-4, Chris Ford wrote:
>>
>> I was watching David Nolan's talk about predicate 
>> dispatch,
>> and he articulated something that I've found frustrating about multimethods
>> - the set of implementations is open, but the dispatch function is closed.
>> That means that if your dispatch value can't be computed in the same way
>> for all your data, you can't use multimethods.
>>
>> Predicate dispatch allows implementations to be registered with a test
>> that decides whether or not they are applicable, so it can do things that
>> multimethods cannot. For example, predicate dispatch would allow you to
>> write an open function that categorises integers as "prime", "perfect" or
>> some other category without baking them all into the dispatch function.
>>
>> In his talk, David speaks about the problem of overlap. 2 is both "prime"
>> and "even", for example. That got me thinking whether overlap is a bug or a
>> feature.
>>
>> I've hacked together a simple plural dispatch 
>> system,
>> which allows the specification of a custom resolution function that can
>> decide whether to use one or all of the registered implementations. You can
>> use this system to implement both multimethods and predicate dispatch.
>>
>> What practical reason would you have for doing this? Random dispatch!
>> Can't decide which implementation to use? Now you don't have to!
>>
>> (defplural random (fn [implementations args] (-> implementations rand-nth
>> (apply args
>> (defimplementation random #(+ % 100))
>> (defimplementation random #(- % 100))
>> (random 1)
>>
>> It could also be useful for gathering a set of all possible results,
>> quasi-AOP extension points, broadcasting events etc.
>>
>> Cheers,
>>
>> Chris
>>
>  --
> 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

ClojureDocs and Clojure 1.4

2012-09-11 Thread Wolodja Wentland
Hi all,

I was wondering when ClojureDocs might be updated to show documentation for
Clojure 1.4 as well. It is just that I thought that it'll happen "eventually"
but it hasn't yet and I am unsure if there is somebody that can/should be
poked about this. It is just that I consider ClojureDocs to be important
infrastructure and it would be great if we were able to ensure that it is
always up-to-date.

Unfortunately the ClojureDocs mailing list looks pretty dead and I figured
that asking here will reach more people. I and a bunch of other people might
even be willing to donate a little bit of our time to upgrade it, but we are
unsure how that would work. 

Is anybody familiar with ClojureDocs codebase and know what changes are
necessary in order to index 1.4 too? How is the webpage updated?
-- 
Wolodja 

4096R/CAF14EFC
081C B7CD FF04 2BA9 94EA  36B2 8B7F 7D30 CAF1 4EFC


signature.asc
Description: Digital signature


Re: Ideas for interactive tasks

2012-09-11 Thread Zmitro Lapcjonak

On Aug 9, 6:21 pm, Nikita Beloglazov  wrote:
> I'm going to organize little clojure course at my university this year. For
> this I want to implement set of tasks that hopefully will help to practise
> clojure.

Some tasks you may find at 4clojure:
https://www.4clojure.com/problems
Sort by "topic" and select "games, graph, data-analysis"

"Project Euler" has some interesting problems that you
may use to teach Clojure and train math theory also.


> Thank you,

Thank you and good luck!

--
Zmitro Lapcionak

-- 
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 and development workflow

2012-09-11 Thread Chas Emerick
On Sep 11, 2012, at 4:00 AM, Laurent PETIT wrote:

> 2012/9/10 Chas Emerick 
> I've been using a combination of lein-cljsbuild to keep the on-disk generated 
> code fresh and piggieback[1] for all of my cljs REPL needs.
> 
> Hello Chas,
> 
> I've tried to use piggieback. My current stack for playing with the concepts 
> is leiningen2 on the command line (to start the server), with clsjbuild to 
> compile the browser_repl.cljs to "bootstrap" the REPL machinery (lein 
> cljsbuild once), regular "lein repl" once project.clj has been configured 
> with the proper options) and a regular CCW 0.10.0 nrepl client.
> 
> It works OK with the "out of the box" Rhino-backed evaluator, but as you 
> might guess, I have no interest in this and then I quickly jump to try & get 
> a Browser-based REPL running.
> 
> That's where things broke. 
> I did not manage to get things compiled correctly.
> 
> As it stands, it seems that I'll have to read & understand wiki pages from 
> ClojureScript project, nrepl documentation, piggieback documentation, 
> cljsbuild documentation, to really grasp the whole thing.
> Seems a little bit daunting just to be able to "play" with it. Is there an 
> easier way ? A resource somewhere which already explains step-by-step how to 
> get started with a new project, cljsbuild for compiling from time to time, 
> and piggieback ?
> 
> Just asking before starting digging :-)

There is a how-to in piggieback's README for using a browser-repl environment 
rather than Rhino.  Nelson Morris was actually the first one to get that 
working, and I'm using it regularly, so it *does* work, though there's no doubt 
there's a lot of pieces you need to put together (for my part, I blew nearly an 
hour tearing my hair out before re-reading the browser-repl tutorial,[1] and 
seeing near the bottom that loading the HTML page from disk wouldn't work; once 
I served the page from localhost, everything fell together).

FWIW, I've found ClojureScript itself to be very solid so far; there are some 
unfortunate (IMO unnecessary) incompatibilities between it and Clojure, but [2] 
is the only thing I've really tripped up on from a technical standpoint.

I think your assessment that the learning curve is "daunting" is just about 
right, but that largely lays with the state of tooling, and the disjointed 
nature of the development process.  With Clojure, you always have a single 
environment (the JVM or CLR), into which you can load code all day from nearly 
anywhere without having to think much about the logistics of it.  ClojureScript 
necessarily implies a more complicated setup: there's your REPL environment, 
probably a browser, and maybe a connection between the two; you *must* have 
your code on disk and in the right place in order for Google Closure / 
lein-cljsbuild to get at it (not strictly true, but driving the compiler from a 
Clojure REPL isn't any easier outside of simple cases); your Ring webapp needs 
to be configured to be serving the gclosure output; and, you'd obviously like 
to be able to control and monitor all of this from your editor/environment of 
choice.

(I'd like to eventually do a 'Starting ClojureScript' screencast similar to 
[3], but the logistics of "going from zero to hero" with ClojureScript are IMO 
far too hard and nuanced still in order to present them well in that sort of 
medium.)

I think the contrast is so stark in part because of how good we've had it on 
the Clojure side.  I suspect that CoffeeScript programming must be similarly 
disjointed, since all the same moving pieces are necessary (and perhaps without 
the benefit of upsides like a browser-connected REPL and so on).  Welcome to 
the wonderful world of modern web development! :-P

I think that's all a long way of saying: start digging!

Cheers,

- Chas

[1] 
https://github.com/clojure/clojurescript/wiki/The-REPL-and-Evaluation-Environments
[2] http://dev.clojure.org/jira/browse/CLJS-358
[3] http://cemerick.com/2012/05/02/starting-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: Noob Question - Clojure number rounding

2012-09-11 Thread Pascal Chatterjee
This doesn't seem to work for non-terminating decimals like 1/3:

(defn round [s n] 
>   (.setScale (bigdec n) s java.math.RoundingMode/HALF_EVEN)) 
> #'user/round
> user=> (round 3 (/ 1 3))
> ArithmeticException Non-terminating decimal expansion; no exact 
> representable decimal result.  java.math.BigDecimal.divide 
> (BigDecimal.java:1603)


 Is there a way of sending the scale to the bigdec function instead of 
setting it afterwards? It doesn't seem so from the docs..

// Pascal. 

On Wednesday, 23 March 2011 20:59:18 UTC+1, Brenton wrote:
>
> You may also consider using java interop here. 
>
> (defn round [s n] 
>   (.setScale (bigdec n) s java.math.RoundingMode/HALF_EVEN)) 
>
> => (round 3 78.37898794) 
> => 78.379 
>
> see 
>
> http://download.oracle.com/javase/1.5.0/docs/api/java/math/BigDecimal.html 
>
> Brenton 
>
> On Mar 23, 11:08 am, JDuPreez  wrote: 
> > I'm trying to round a decimal number like 78.37898794 to say 78.379, 
> > without converting it to a string. I've been struggling to get this 
> > right and to get info on it. The closest that I've found is to use: 
> > format "%.3f". But format converts the number to a string. Not exactly 
> > what I'm trying to do. 
> > 
> > How can I do this in Clojure, or where is info on how to do it? 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

Re: ClojureScript and development workflow

2012-09-11 Thread Laurent PETIT
2012/9/11 Chas Emerick 

> On Sep 11, 2012, at 4:00 AM, Laurent PETIT wrote:
>
> 2012/9/10 Chas Emerick 
>
>> I've been using a combination of lein-cljsbuild to keep the on-disk
>> generated code fresh and piggieback[1] for all of my cljs REPL needs.
>>
>
> Hello Chas,
>
> I've tried to use piggieback. My current stack for playing with the
> concepts is leiningen2 on the command line (to start the server), with
> clsjbuild to compile the browser_repl.cljs to "bootstrap" the REPL
> machinery (lein cljsbuild once), regular "lein repl" once project.clj has
> been configured with the proper options) and a regular CCW 0.10.0 nrepl
> client.
>
> It works OK with the "out of the box" Rhino-backed evaluator, but as you
> might guess, I have no interest in this and then I quickly jump to try &
> get a Browser-based REPL running.
>
> That's where things broke.
> I did not manage to get things compiled correctly.
>
> As it stands, it seems that I'll have to read & understand wiki pages from
> ClojureScript project, nrepl documentation, piggieback documentation,
> cljsbuild documentation, to really grasp the whole thing.
> Seems a little bit daunting just to be able to "play" with it. Is there an
> easier way ? A resource somewhere which already explains step-by-step how
> to get started with a new project, cljsbuild for compiling from time to
> time, and piggieback ?
>
> Just asking before starting digging :-)
>
>
> There is a how-to in piggieback's README for using a browser-repl
> environment rather than Rhino.
>

Yeah, I read it. During my first trial with ClojureScript yesterday, I
assumed following piggieback's README would be sufficient. I was wrong,
there is more to it :-)


> Nelson Morris was actually the first one to get that working, and I'm
> using it regularly, so it *does* work, though there's no doubt there's a
> lot of pieces you need to put together (for my part, I blew nearly an hour
> tearing my hair out before re-reading the browser-repl tutorial,[1] and
> seeing near the bottom that loading the HTML page from disk wouldn't work;
> once I served the page from localhost, everything fell together).
>
> FWIW, I've found ClojureScript itself to be very solid so far; there are
> some unfortunate (IMO unnecessary) incompatibilities between it and
> Clojure, but [2] is the only thing I've really tripped up on from a
> technical standpoint.
>
> I think your assessment that the learning curve is "daunting" is just
> about right,
>

I'm ok with that, as long as its the only way to go right now. I would not
have missed something, that's why I asked.


> but that largely lays with the state of tooling, and the disjointed nature
> of the development process.  With Clojure, you always have a single
> environment (the JVM or CLR), into which you can load code all day from
> nearly anywhere without having to think much about the logistics of it.
>  ClojureScript necessarily implies a more complicated setup: there's your
> REPL environment, probably a browser, and maybe a connection between the
> two; you *must* have your code on disk and in the right place in order for
> Google Closure / lein-cljsbuild to get at it (not strictly true, but
> driving the compiler from a Clojure REPL isn't any easier outside of simple
> cases); your Ring webapp needs to be configured to be serving the gclosure
> output; and, you'd obviously like to be able to control and monitor all of
> this from your editor/environment of choice.
>
> (I'd like to eventually do a 'Starting ClojureScript' screencast similar
> to [3], but the logistics of "going from zero to hero" with ClojureScript
> are IMO far too hard and nuanced still in order to present them well in
> that sort of medium.)
>
> I think the contrast is so stark in part because of how good we've had it
> on the Clojure side.  I suspect that CoffeeScript programming must be
> similarly disjointed, since all the same moving pieces are necessary (and
> perhaps without the benefit of upsides like a browser-connected REPL and so
> on).  Welcome to the wonderful world of modern web development! :-P
>
> I think that's all a long way of saying: start digging!
>


I will. One of my goals for Counterclockwise, right now, is to even better
integrate it with Leiningen2. But I'd like also to know more about
ClojureScript dev workflow, since in the end the integration with Leiningen
2 is just a means towards an end. ClojureScript in Counterclockwise being
an important part of this end.

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

Re: ClojureDocs and Clojure 1.4

2012-09-11 Thread John Gabriele
On Tuesday, September 11, 2012 7:01:39 AM UTC-4, Wolodja Wentland wrote:
>
> Hi all, 
>
> I was wondering when ClojureDocs might be updated to show documentation 
> for 
> Clojure 1.4 as well. It is just that I thought that it'll happen 
> "eventually" 
> but it hasn't yet and I am unsure if there is somebody that can/should be 
> poked about this. It is just that I consider ClojureDocs to be important 
> infrastructure and it would be great if we were able to ensure that it is 
> always up-to-date. 
>
>
My vague understanding is that clojuredocs is currently written in Ruby and 
there have been plans to rewrite it in Clojure.

Perhaps the 1.4 updates (and other updates) will be made once the rewrite 
happens?

---John

-- 
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: ClojureDocs and Clojure 1.4

2012-09-11 Thread Andy Fingerhut
Except for the fact that github is down right now, you can get the source code 
for ClojureDocs linked to from the home page (links near the bottom).

I haven't heard anything definitive from the creators of ClojureDocs, but I 
would guess they are busy with other things, and adding Clojure 1.4 to 
ClojureDocs is not high on their list of priorities.  They do say you can fork 
their code and send them a pull request if you like, but it would probably be 
best to first find out whether they are actually in the process of rewriting 
the server code.

Andy

On Sep 11, 2012, at 4:01 AM, Wolodja Wentland wrote:

> Hi all,
> 
> I was wondering when ClojureDocs might be updated to show documentation for
> Clojure 1.4 as well. It is just that I thought that it'll happen "eventually"
> but it hasn't yet and I am unsure if there is somebody that can/should be
> poked about this. It is just that I consider ClojureDocs to be important
> infrastructure and it would be great if we were able to ensure that it is
> always up-to-date.
> 
> Unfortunately the ClojureDocs mailing list looks pretty dead and I figured
> that asking here will reach more people. I and a bunch of other people might
> even be willing to donate a little bit of our time to upgrade it, but we are
> unsure how that would work. 
> 
> Is anybody familiar with ClojureDocs codebase and know what changes are
> necessary in order to index 1.4 too? How is the webpage updated?

-- 
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: ForkJoinTask not found under Java 7?

2012-09-11 Thread Wolodja Wentland
On Tue, Aug 21, 2012 at 19:40 +0100, Jim - FooBar(); wrote:
> Hi everyone,
> 
> I get this very strange error even though I'm using clojure 1.5
> alpha3 and java version "1.7.0_02" on Java HotSpot(TM) 64-Bit Server
> VM !
> 
> ClassNotFoundException jsr166y.ForkJoinTask

I've just filed http://dev.clojure.org/jira/browse/CLJ-1066 on this and you
might want to add additional information if you think that something is
missing.
-- 
Wolodja 

4096R/CAF14EFC
081C B7CD FF04 2BA9 94EA  36B2 8B7F 7D30 CAF1 4EFC


signature.asc
Description: Digital signature


Re: ClojureDocs and Clojure 1.4

2012-09-11 Thread Wolodja Wentland
On Tue, Sep 11, 2012 at 08:24 -0700, John Gabriele wrote:

>My vague understanding is that clojuredocs is currently written in Ruby
>and there have been plans to rewrite it in Clojure.

It would be good to know what the plans are as I find ClojureDocs to be quite
an important tool when I develop in Clojure. The main reason for that is that
I find it hard to search for specific functions on
http://clojure.github.com/clojure/clojure.set-api.html or that the official
documentation lacks the wonderful usage examples.
-- 
Wolodja 

4096R/CAF14EFC
081C B7CD FF04 2BA9 94EA  36B2 8B7F 7D30 CAF1 4EFC


signature.asc
Description: Digital signature


Help - I am doing something wrong (lein cljsbuild fails)

2012-09-11 Thread Thomas
Dear all,

I wanted to give ClojureScript a try in combination with Noir so after 
reading the various descriptions on the interweb I came up with the 
following project.clj file:

(defproject x "0.1.0-SNAPSHOT"
  :description "FIXME: write description"
  :url "http://example.com/FIXME";
  :license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
  :dependencies [[org.clojure/clojure "1.4.0"]
 [noir "1.2.2"]
 [org.clojure/data.zip "0.1.1"]]
  :dev-dependencies [[lein-cljsbuild "0.2.7"]] ; cljsbuild plugin
  :cljsbuild
{:builds
 [{:builds nil,
   :source-path "src-cljs",
   :compiler
   {:pretty-print true,
:output-to "resources/public/js/cljs.js",
:optimizations :simple}}]}
)


and when I run "lein cljsbuild once" (and auto mode as well) I get the 
following exception:

lein cljsbuild once
Compiling ClojureScript.
Exception in thread "main" java.lang.RuntimeException: 
java.io.FileNotFoundException: Could not locate clojure/instant__init.class 
or clojure/instant.clj on classpath: 
at clojure.lang.Util.runtimeException(Util.java:165)
at clojure.lang.Compiler.eval(Compiler.java:6476)
at clojure.lang.Compiler.eval(Compiler.java:6455)
at clojure.lang.Compiler.load(Compiler.java:6902)
at clojure.lang.RT.loadResourceScript(RT.java:357)
at clojure.lang.RT.loadResourceScript(RT.java:348)
at clojure.lang.RT.load(RT.java:427)
at clojure.lang.RT.load(RT.java:398)
at clojure.core$load$fn__4610.invoke(core.clj:5386)
at clojure.core$load.doInvoke(core.clj:5385)
at clojure.lang.RestFn.invoke(RestFn.java:408)
at clojure.core$load_one.invoke(core.clj:5200)
at clojure.core$load_lib.doInvoke(core.clj:5237)
at clojure.lang.RestFn.applyTo(RestFn.java:142)
at clojure.core$apply.invoke(core.clj:602)
at clojure.core$load_libs.doInvoke(core.clj:5271)
at clojure.lang.RestFn.applyTo(RestFn.java:137)
at clojure.core$apply.invoke(core.clj:602)
at clojure.core$require.doInvoke(core.clj:5352)
at clojure.lang.RestFn.invoke(RestFn.java:457)
at cljs.compiler$eval113$loading__4505__auto114.invoke(compiler.clj:11)
at cljs.compiler$eval113.invoke(compiler.clj:11)
at clojure.lang.Compiler.eval(Compiler.java:6465)
at clojure.lang.Compiler.eval(Compiler.java:6455)
at clojure.lang.Compiler.load(Compiler.java:6902)
at clojure.lang.RT.loadResourceScript(RT.java:357)
at clojure.lang.RT.loadResourceScript(RT.java:348)
at clojure.lang.RT.load(RT.java:427)
at clojure.lang.RT.load(RT.java:398)
at clojure.core$load$fn__4610.invoke(core.clj:5386)
at clojure.core$load.doInvoke(core.clj:5385)
at clojure.lang.RestFn.invoke(RestFn.java:408)
at clojure.core$load_one.invoke(core.clj:5200)
at clojure.core$load_lib.doInvoke(core.clj:5237)
at clojure.lang.RestFn.applyTo(RestFn.java:142)
at clojure.core$apply.invoke(core.clj:602)
at clojure.core$load_libs.doInvoke(core.clj:5271)
at clojure.lang.RestFn.applyTo(RestFn.java:137)
at clojure.core$apply.invoke(core.clj:602)
at clojure.core$require.doInvoke(core.clj:5352)
at clojure.lang.RestFn.invoke(RestFn.java:457)
at cljs.closure$eval105$loading__4505__auto106.invoke(closure.clj:9)
at cljs.closure$eval105.invoke(closure.clj:9)
at clojure.lang.Compiler.eval(Compiler.java:6465)
at clojure.lang.Compiler.eval(Compiler.java:6455)
at clojure.lang.Compiler.load(Compiler.java:6902)
at clojure.lang.RT.loadResourceScript(RT.java:357)
at clojure.lang.RT.loadResourceScript(RT.java:348)
at clojure.lang.RT.load(RT.java:427)
at clojure.lang.RT.load(RT.java:398)
at clojure.core$load$fn__4610.invoke(core.clj:5386)
at clojure.core$load.doInvoke(core.clj:5385)
at clojure.lang.RestFn.invoke(RestFn.java:408)
at clojure.core$load_one.invoke(core.clj:5200)
at clojure.core$load_lib.doInvoke(core.clj:5237)
at clojure.lang.RestFn.applyTo(RestFn.java:142)
at clojure.core$apply.invoke(core.clj:602)
at clojure.core$load_libs.doInvoke(core.clj:5271)
at clojure.lang.RestFn.applyTo(RestFn.java:137)
at clojure.core$apply.invoke(core.clj:604)
at clojure.core$use.doInvoke(core.clj:5363)
at clojure.lang.RestFn.invoke(RestFn.java:421)
at cljsbuild.compiler$eval5$loading__4505__auto6.invoke(compiler.clj:1)
at cljsbuild.compiler$eval5.invoke(compiler.clj:1)
at clojure.lang.Compiler.eval(Compiler.java:6465)
at clojure.lang.Compiler.eval(Compiler.java:6455)
at clojure.lang.Compiler.load(Compiler.java:6902)
at clojure.lang.RT.loadResourceScript(RT.java:357)
at clojure.lang.RT.loadResourceScript(RT.java:348)
at clojure.lang.RT.load(RT.java:427)
at clojure.lang.RT.load(RT.java:398)
at clojure.core$load$fn__4610.invoke(core.clj:5386)
at clojure.core$load.doInvoke(core.clj:5385)
at clojure.lang.RestFn.invoke(RestFn.java:408)
at clojure.core$load_one.invoke(core.clj:5200)
at clojure.core$load_lib.doInvoke(core.clj:5237)
at clojure.lang.RestFn.applyTo(RestFn.java:142)
at clojure.core$apply.invoke(core.clj:602)
at clojure.core$load_libs.doInvoke(core.clj:5271)
at clojure.lang.RestFn.applyTo(RestFn.java:137)
at clojure.core$apply.invoke(co

Re: ClojureScript and development workflow

2012-09-11 Thread Takahiro Hozumi
Hi,

> I guess that at least the following require a restart. Please correct /
> explain as needed :
>
> - change in CSS file on disk ?
> - change in template file (either enfocus / hiccup-on-the-browser -don't
> remember the name) ?
>
> and also when doing certain changes to the ClojureScript code itself :
> - when I add a new namespace ?
> - same problem with multimethods as JVM Clojure ?
> - ... ?

You need to refresh the browser every time you update cljs/css/js file
on disk as with normal javascript webapp development.
Personally I don't use browser-repl frequently because I refresh the
browser in a short time interval.

> - same problem with multimethods as JVM Clojure ?
Sorry, I don't understand what this means.
Anyway I don't recommend using multimethods in cljs because it is not
fast.

Cheers,

- Takahiro

On Sep 11, 4:52 pm, Laurent PETIT  wrote:
> 2012/9/10 Takahiro Hozumi 
>
> > Hi,
> > I refresh browser every time I change cljs files.
>
> > > "Using the REPL as the main way to deliver code to the browser means
> > never having to refresh the page. One could theoretically build an entire
> > application without a single page refresh. If you find yourself refreshing
> > the page after every change you make, you're doing it wrong. What is this,
> > 2009?"
>
> > I think this is somewhat exaggeration.
> > REPL isn't good enough to push the all changes into browser.
>
> Hello,
>
> While I could learn "the long and hard way" where & when it is necessary to
> restart the ClojureScript application (refresh the browser), I'd be
> interesting in feedback in this area.
>
> I guess that at least the following require a restart. Please correct /
> explain as needed :
>
> - change in CSS file on disk ?
> - change in template file (either enfocus / hiccup-on-the-browser -don't
> remember the name) ?
>
> and also when doing certain changes to the ClojureScript code itself :
> - when I add a new namespace ?
> - same problem with multimethods as JVM Clojure ?
> - ... ?
>
> Thanks in advance,
>
> --
> 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


Re: Question about sets

2012-09-11 Thread Rich Hickey
I understand your frustration.

But it is important to note that timeliness and feedback are a two-way street. 
There was a time when changes to Clojure were tried immediately by users, and 
I'd know within hours if not minutes if I'd introduced something that caused 
problems for someone. That matters as much to me now as it did then. But now it 
can be months or, as in this case, years before someone issues a complaint. 
That's quite frustrating as well.

It is equally important that we continue to presume the best of one another. 
I've had to reconcile myself to the fact that Clojure users are busy using 
Clojure, and primarily from release artifacts. They have less time to spend 
evaluating the latest code. I, too, am busy using Clojure, something that is 
quite good for Clojure, even though it may give me less time for participating 
in the threads.

Rest assured that the threads are being seen and considered. If you've had 
someone from core chime in on a thread (as Stu did, the day after your first 
post), then it's been seen. He and I have spoken about it several times. That 
doesn't mean it's become an action item, even if there's a long thread (long 
threads can mean little more than everyone has an opinion), or that the 
majority seems to agree (people happy with how things are are least motivated 
to chime in). The fact is, this was very old code, and if someone was catching 
fire because of it, presumably it would have come up already.

That said, I am very interested in the idea of getting more leverage out of the 
JIRA voting system. As the volume on the lists and in JIRA etc continues to 
grow (as it does), triage becomes critical, and more difficult. Any effort to 
organize and prioritize the work and opinions of the community is much 
appreciated (thanks Andy, et al). Voting can be a self-serve, self-tuning 
option. I've already made a JIRA view that orders tickets by votes. It will be 
essential though, that people be limited (or, more likely, limit themselves) to 
e.g. 3 active votes (i.e. on open tickets) at a time, else it's not triage, 
it's just a venting exercise :)

The simple fact is that people's desire to work with a stable Clojure, and to 
continue to produce a solid one, coupled with a growing community, means that 
things will take longer, and not everything can be personally addressed.

Rich

On Sep 3, 2012, at 9:06 PM, Mark Engelberg wrote:

> In the early days of Clojure, it was clear that Rich was reading every post 
> on the Clojure mailing list.  He didn't respond to every single thread, of 
> course, but when new issues were raised, he would frequently chime in, 
> "That's a good point, please create a patch for that" or "That's something 
> that's never going to change."
> 
> This created a clear path for bug reports, feature requests, and improvement 
> suggestions.  Basically, the path was to post on the mailing list.  If it was 
> something that had been already discussed in the past, one could count on the 
> community to point to the relevant thread.  If it was something new, one 
> could count on it eventually being evaluated by Rich and an official judgment 
> made.  The community was instructed not to submit any kind of patch without a 
> go-ahead from Rich.
> 
> I don't know what the path is now.  I feel that in the past year, there have 
> been several times where people have raised meaningful issues about Clojure 
> and received no official response.  It's hard to know whether this is an 
> intentional "rejection through ignoring", or whether it's just that those 
> messages happened to slip beneath the radar.  Maybe Rich didn't see them, and 
> without his go-ahead, no one moved forward with them.
> 
> As a recent example, consider the issue I raised last month about sets, which 
> in 1.3 were changed so that via several methods of construction (either 
> literal notation or the hash-set constructor), they now throw an error, 
> breaking code that previously worked, reducing the utility of set notation, 
> and imposing on users the need to remember the idiosyncrasies of which 
> methods of set construction impose this constraint and which don't.  The 
> majority of those who weighed in on the issue agreed with my complaint.
> 
> The set issue was even discussed on the Mostly Lazy podcast as an example of 
> how, even though Clojure gets a lot of the "big ideas" right, there seem to 
> be a lot of "little things" that Clojure still hasn't nailed.  
> 
> In any case, there was a great deal of useful discussion about the set issue, 
> and then... silence.
> 
> There are a couple of points here:
> 
> 1.  I use Clojure regularly.  The "little things" may be little, but when you 
> use Clojure regularly, those little things do start to grate after a while.  
> I would very much like to see Clojure on a path to resolve the little things, 
> so that the language becomes increasingly pleasurable to use.  To do this, 
> the community would benefit for a very clear 

[ANN] Immutant 0.3.0 released

2012-09-11 Thread Jim Crossley
We released our third official version of Immutant today!

With this release we now publish the Immutant namespaces to Clojars. They 
are of limited use when run outside of Immutant, of course, but they'll at 
least compile so you can mock/stub/redefine them in your unit tests. You 
can render some of them mostly functional by adding the relevant jars to 
your project.clj, e.g. Infinispan, HornetQ, etc, and we expect to add more 
"container-less" functionality in future releases.

Obviously, they're completely functional *inside* an Immutant container, so 
we've published a library to facilitate integration testing, and continued 
to improve our nrepl/swank support so you can now add dependencies to your 
project on the fly without having to redeploy it.

Here's the announcement: http://bit.ly/immutant030

Enjoy and thanks,
Jim

-- 
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: Help - I am doing something wrong (lein cljsbuild fails)

2012-09-11 Thread Thomas
I have just downloaded the lein cljsbuild from here: 
https://github.com/emezeske/lein-cljsbuild and build the simple project and 
that worked 

Then I build an uberjar from my project file and noticed that clojure 1.3.0 
was included in it I suspect that is the problem ((Noir needs it 
apperently)... but how to work around it?


Thomas

-- 
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: appengine-magic: Argument must not be null.

2012-09-11 Thread Rostislav Svoboda
Ok, it has nothing to do with clojure it's a GAE issue. Just in case
someone trips over it too, the app must be started using
  lein appengine-prepare
  lein appengine-dev-appserver foo-dev

from bash, instead of
  (use 'foo.core)
  (in-ns 'foo.core)
  (ae/serve foo-app)

from REPL. See the section "Managing multiple environments"  in
README.md. And yea as you might have guessed an access to REPL using
vimclojure with nailgun doesn't work anymore. Sweet, isn't it?

Bost

-- 
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: Help - I am doing something wrong (lein cljsbuild fails)

2012-09-11 Thread James Reeves
On 11 September 2012 19:54, Thomas  wrote:
>   :dev-dependencies [[lein-cljsbuild "0.2.7"]] ; cljsbuild plugin



> having googled for this problem people who hit this in the past ran older
> versions of both Clojure and lein cljsbuild (I run the latest lein2)

You should use :plugins for plugins. :dev-dependencies doesn't do
anything in Lein 2.

e.g. :plugins [[lein-cljsbuild "0.2.7"]]

This might solve your problem.

- James

-- 
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 org-babel (ob-clojure.el) is broken under nrepl.el

2012-09-11 Thread Gary Johnson
I just put together a simple example repo on GitHub, containing a literate 
programming solution to the Potter Kata  
(http://codingdojo.org/cgi-bin/wiki.pl?KataPotter) using Emacs' org-babel 
mode. You can check it out here:

  https://github.com/lambdatronic/org-babel-example

Also be sure to take a look at the canonical online org-babel docs:

  http://orgmode.org/worg/org-contrib/babel/

In particular the intro section:

  http://orgmode.org/worg/org-contrib/babel/intro.html

And even though it's a little bit dated w.r.t. the current org-mode version 
in Emacs 24, this journal article on Org-Mode's literate programming and 
reproducible research features is really, really cool to work through (lots 
of nice code examples):

  http://www.jstatsoft.org/v46/i03

Happy hacking,
  ~Gary

On Saturday, September 8, 2012 4:24:38 AM UTC-4, Denis Labaye wrote:
>
>
>
> On Thu, Sep 6, 2012 at 6:42 PM, lambdatronic 
> > wrote:
>
>> For those people (like myself) who do a lot of Literate Programming in 
>> Emacs using Clojure and org-babel, migrating to nrepl and nrepl.el is 
>> somewhat non-trivial. This is because the existing Clojure support in 
>> org-babel (ob-clojure.el) relies on slime and swank-clojure when running 
>> org-babel-execute-src-block (which redirects to org-babel-execute:clojure 
>> in ob-clojure.el).
>>
>> So clearly this is actually an issue for both nrepl.el and ob-clojure.el, 
>> not simply one or the other. All the same, I've hacked together a simple 
>> workaround that fixes the problem and makes Literate Programming under 
>> nrepl possible once again. If there is some slick way this could be worked 
>> into nrepl.el's codebase that wouldn't break its existing behavior (as this 
>> does), I'd be excited to see it.
>>
>> Here we go:
>>
>> ;; Patch result table rendering bug in ob-clojure (NREPL version)
>> (defun nrepl-send-request-sync (request)
>>   "Send a request to the backend synchronously (discouraged).
>> The result is a plist with keys :value, :stderr and :stdout."
>>   (with-current-buffer "*nrepl-connection*"
>> (setq nrepl-sync-response nil)
>> (nrepl-send-request request (nrepl-sync-request-handler 
>> (current-buffer)))
>> (while (not (plist-get nrepl-sync-response :done))
>>   (accept-process-output))
>> nrepl-sync-response))
>>
>> (defun org-babel-execute:clojure (body params)
>>   "Execute a block of Clojure code with Babel."
>>   (let ((result-plist (nrepl-send-string-sync 
>> (org-babel-expand-body:clojure body params) nrepl-buffer-ns))
>> (result-type  (cdr (assoc :result-type params
>> (org-babel-script-escape
>>  (cond ((eq result-type 'value)  (plist-get result-plist :value))
>>((eq result-type 'output) (plist-get result-plist :value))
>>(t(message "Unknown :results 
>> type!"))
>>
>> Have fun!
>>
>
> It seems to be very interesting, I am already using Emacs / org-mode / 
> clojure a lot, I was aware of org-babel, but never used it.
> Would you have a simple example project (on github, ...) on how to 
> bootstrap this ? 
>
> Thanks, 
>
> Denis
>
>  
>
>>  -- 
>> You received this message because you are subscribed to the Google
>> Groups "Clojure" group.
>> To post to this group, send email to clo...@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+u...@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: Help - I am doing something wrong (lein cljsbuild fails)

2012-09-11 Thread Thomas

>
>
> You should use :plugins for plugins. :dev-dependencies doesn't do 
> anything in Lein 2. 
>
> e.g. :plugins [[lein-cljsbuild "0.2.7"]] 
>
> This might solve your problem. 
>

Tried that as well, and it didn't work :(

Thomas 

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

can someone explain me how is this evaluated?

2012-09-11 Thread Erlis Vidal
I don't understand how is this expression evaluated to get the shown result

(apply map list (partition 2 [ 1 2 3 4 5 ])) => ((1 3) (2 4))

removing the apply I got this:

(map list (partition 2 [ 1 2 3 4 5 ])) => (((1 2)) ((3 4)))

how is the apply changing the result? I'm not able to see the reasoning
behind this code. Can someone help me with this?

Thanks,
Erlis

-- 
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: can someone explain me how is this evaluated?

2012-09-11 Thread Baishampayan Ghose
> I don't understand how is this expression evaluated to get the shown result
>
> (apply map list (partition 2 [ 1 2 3 4 5 ])) => ((1 3) (2 4))

This is equivalent to -

(map list '(1 2) '(2 4) '(5))

> removing the apply I got this:
>
> (map list (partition 2 [ 1 2 3 4 5 ])) => (((1 2)) ((3 4)))
>
> how is the apply changing the result? I'm not able to see the reasoning
> behind this code. Can someone help me with this?

As you can see, apply here is kind of "unwrapping" the input list (the
one returned by partition).

Apply takes a function, some (optional) arguments to the fn and a list
of more args which it unwraps and calls the function on.

For example -

(apply + '(1 2 3 4))

is equivalent to

(+ 1 2 3 4)

We can also do -

(apply + 1 2 '( 3 4))

which is equivalent to -

(+ 1 2 3 4)

Hope this helps.

Regards,
BG

-- 
Baishampayan Ghose
b.ghose at 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: can someone explain me how is this evaluated?

2012-09-11 Thread Neale Swinnerton
> > (apply map list (partition 2 [ 1 2 3 4 5 ])) => ((1 3) (2 4))
>
> This is equivalent to -
>
> (map list '(1 2) '(2 4) '(5))

Actually, since no pad collection is supplied,  the partition call returns

((1 2) (3 4))

So the apply variant (unwrapping the collection) is equivalent to

(map list '(1 2) '(3 4))

Which is different to the plain call which looks like:

(map list '((1 2) (3 4)))

Now, map has a cool feature when called with multiple collections. From the
docs 

map
(map f coll)
(map f c1 c2)
(map f c1 c2 c3)
(map f c1 c2 c3 & colls)

Returns a lazy sequence consisting of the result of applying f to the
set of first items of each coll, followed by applying f to the set
of second items in each coll, until any one of the colls is
exhausted. Any remaining items in other colls are ignored. Function
f should accept number-of-colls arguments.

so the final result is equivalent to

((list (first '(1 2)) (first (3 4))) (list (second '(1 2)) (second '(3 4)))

Which becomes:

((list 1 3) (list 2 4))

Which is the result you see - hope that helps

Neale
{t: @sw1nn, w:sw1nn.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

ANN edn-java

2012-09-11 Thread Ben Smith-Mannschott
I've posted a first rough cut of an edn parser written in plain Java
here: https://github.com/bpsm/edn-java

The parser itself is Wirthian, which is to say it's a hand-written
LL(2) scanner coupled with a hand-written LL(1) recursive decent
parser. This is easy enough to do for edn's uncomplicated grammar.

The parser can be configured with custom tag handlers. Handlers from
#uuid and #inst are provided. (The handler for #inst, however, is the
kind of code no one can love and has no unit tests.) There are hooks
available to control which collections are created by [], (), #{} and
{}.

The design, package structure, naming, public interfaces -- everything
-- is still subject to change. There are probably some bugs.
Clarification of some of the open issues on
https://github.com/edn-format/edn may bring tweaks to the parser.
Javadocs are currently MIA. I'll wait with that until I'm more
confident that I've found a design I like.

Feedback welcome. Tell me what sucks about it so that I can make it better.

// Ben

-- 
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: Immutant 0.3.0 released

2012-09-11 Thread Takahiro Hozumi
Hi,

Forgive my ignorance, although I think the project must be useful, but
I still don't understand what is the benefit of using application
server.
What is the difference between using a particular library(e.g.
HornetQ) with JBoss AS7 and using the same one without JBoss AS7?

Cheers,

- Takahiro

On Sep 12, 4:30 am, Jim Crossley  wrote:
> We released our third official version of Immutant today!
>
> With this release we now publish the Immutant namespaces to Clojars. They
> are of limited use when run outside of Immutant, of course, but they'll at
> least compile so you can mock/stub/redefine them in your unit tests. You
> can render some of them mostly functional by adding the relevant jars to
> your project.clj, e.g. Infinispan, HornetQ, etc, and we expect to add more
> "container-less" functionality in future releases.
>
> Obviously, they're completely functional *inside* an Immutant container, so
> we've published a library to facilitate integration testing, and continued
> to improve our nrepl/swank support so you can now add dependencies to your
> project on the fly without having to redeploy it.
>
> Here's the announcement:http://bit.ly/immutant030
>
> Enjoy and thanks,
> Jim

-- 
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: Question about sets

2012-09-11 Thread Andy Fingerhut
Rich:

I'm not sure what you mean by the not-fastest-path possible that exists in 
today's Clojure code, so if you get a chance, see if the below is what you mean.

As far as I can tell (i.e. putting debug println's in the Java code of RT.map), 
when someone enters a map literal in, say, a function definition, and all keys 
*and* values are compile time constants, it calls RT.map() while the function 
is being compiled, but never again when the function is called.

If I make a similar function with run-time variable keys or values, RT.map() is 
called every time the function is invoked.  Each of these calls repeats the 
check that the keys are unique.

Do you mean that you want a new code path where if the keys are compile time 
constants, but the values are variables at compile-time, then at run time this 
map should be created with a method that avoids the unnecessary check for 
unique keys?

And by the word "restore" do you mean to imply that it was this way at one time 
before?

Thanks,
Andy


On Sep 8, 2012, at 5:29 AM, Rich Hickey wrote:

> Thanks!
> 
> I'm still interested in patch for recommendation #3:
> 
>  Restore the fastest path possible for those cases where the keys are 
> compile-time detectable unique constants
> 
> I'd like to see all three recommendations go into a release as a set.
> 
> 
> On Sep 8, 2012, at 2:22 AM, Andy Fingerhut wrote:
> 
>> The new ticket CLJ-1065 has a patch that I think implements the desired 
>> behavior on the dev wiki page.
>> 
>> i.e. set/map literals with duplicates are invalid (status quo)
>> 
>> All constructor functions for sets and maps allow duplicates, and for maps, 
>> always take the value associated with the last occurrence of the same key.  
>> All constructor functions explicitly say this in their doc strings.
>> 
>> Andy
>> 
>> On Sep 7, 2012, at 2:06 PM, Rich Hickey wrote:
>> 
>>> 
>>> On Sep 7, 2012, at 3:35 PM, Sean Corfield wrote:
>>> 
 On Fri, Sep 7, 2012 at 10:49 AM, Rich Hickey  wrote:
> I've added my feedback there  
> (http://dev.clojure.org/display/design/Allow+duplicate+map+keys+and+set+elements)
 
 Thanx Rich! So the recommendation is:
 
 * set/map literals with duplicates are invalid (status quo)
 
 * hash-set/hash-map should change (to last key wins, as if conj'd/assoc'd)
 
 * sorted-set/sorted-map should not change (last key wins, as if 
 conj'd/assoc'd)
 
 * array-map should not change (throws on dupes)?
 
 Highlighting that last one since it's not mentioned on the wiki and
 would then be the "odd one out" but perhaps there's a good reason?
>>> 
>>> No, array-map should be the same too.
>> 
>> -- 
>> 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: ClojureScript and development workflow

2012-09-11 Thread Brent Millare
I emit the clojurescript code myself by calling cljs.closure/build myself 
and put this into the html file. I cache the code using 
clojure.core.memoize/memo-fifo with my own function that takes the 
dependent files timestamps as args (so that changes result in recompiles). 
Using ring, pages with refreshes automatically update if the source is 
updated.

I also use cemerick.piggieback for the liverepl between refreshes.

See dj.cljs/cljs-repl as part of 'dj', the library I wrote to manage some 
of these things.

https://github.com/bmillare/dj/blob/library/src/dj/cljs.clj

Note that it is sufficient to just use the inserted js code emitted from 
cljs.closure/build from a cljs file with (clojure.browser.repl/connect 
"http://localhost:/repl") and dj.cljs/cljs-repl to get a liverepl. 
You do not need any other files in the html file. (The example 
https://github.com/clojure/clojurescript/wiki/The-REPL-and-Evaluation-Environments
 can 
be misleading since it includes the "out/goog/base.js" and other statements.

-- 
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 org-babel (ob-clojure.el) is broken under nrepl.el

2012-09-11 Thread Giorgio Valoti

Il giorno 07/set/2012, alle ore 15:45, lambdatronic ha scritto:

> Thanks, Tim. This looks great.
> 
> For those of you who don't want to go digging through the thread, here's the 
> summary:
> 
> Step 1. Download nrepl-0.1.4-preview from Marmalade or MELPA (depends on 
> clojure-mode 1.11).
> 
> Step 2. Add this code to your .emacs file:

Thank you! Will your patch be needed from now on to use Org with nrepl?

> […]

--
Giorgio Valoti

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

Any recent library similar to contrib.accumulators?

2012-09-11 Thread Ignacio Thayer
 I haven't been using it since it's in contrib, but I miss some of the 
functionality. The wrappers around Coda/Hale don't feel right. Any 
suggestions?

Thanks
Ignacio

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

Clojure on embedded java?

2012-09-11 Thread Marko Kocić
As you might know, Oracle recently released Embedded Java which purpose is to 
be used on memory and CPU constrained devices. I see that some people reported 
that Clojure works with it, and that performance is excellent, but the question 
is have someone tried using it for non trivial applications. One possible use 
case would be to use it with Heroku since Heroku dyno might be considered as 
embedded device. Custom built pack would be needed though.

Cheers,
Marko

-- 
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] ACCU 2013 conference, 9-13 April 2013, Oxford UK -- call for papers

2012-09-11 Thread Giovanni Asproni

Hi,

I'm sending this on behalf of Jon Jagger, the conference chair.

ACCU invites you to propose a session for its leading software
development conference.
The conference will be held in Bristol, England, from the 9th to the
13th April inclusive.
Our opening keynote speakers will be Eben Upton, Mr Raspberry Pi.

To propose a session please email the following information to
confere...@accu.org

* Title (a working title if necessary)
* Type (tutorial, case-study, workshop, etc.)
* Duration (45/90 min)
* Speaker name(s)
* Speaker biography (max 150 words)
* Description (approx 250 words)

We have a long tradition of high quality sessions covering many
aspects of software development, from programming languages (e.g.,
Java, C#, Python, Erlang, Haskell, Ruby, Groovy, C, C++, etc.), and
technologies (libraries, frameworks, databases, etc.) to subjects
about the wider development environment such as testing, architecture
and design, development process, analysis, patterns, project
management, and softer aspects such as team building, communication
and leadership.

Sessions are usually tutorial-based, presentations of case studies, or
interactive workshops, but we are always open to novel formats. Most
sessions are 90 minutes. To encourage less experienced speakers to
speak without the pressure of filling a full 90 minutes, we reserve a
number of shorter 45 minute sessions.

Speakers running one or more full 90 minute sessions receive a special
conference package including free attendance, and assistance with
their travel and accommodation costs. Speakers filling a 45 minute
slot qualify for free conference attendance on the day of their
session.

For more information about location, travel, fees, accommodation,
restaurants, etc, please see
http://www.cvent.com/events/save-the-date-/event-summary-8539404013564465b7aba6a2ce241323.aspx

The conference has always benefited from the strength of its programme.
Please help us make 2013 another successful event.
Thank you
Jon Jagger
(ACCU conference chair)

--
Asprotunity Limited
http://asprotunity.com
Twitter: @gasproni
Mobile: +44 (0) 791 746 0453


--
Asprotunity Limited
http://asprotunity.com
Twitter: @gasproni
Mobile: +44 (0) 791 746 0453

--
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 and development workflow

2012-09-11 Thread Steve Buikhuizen
Hi Laurent,

I've been using CCW and cljsbuild for three months and it is working well 
for me but I suspect that my workflow can improve.

I run cljsbuild auto (incremental mode) and edit cljs files in CCW, then 
refresh the browser (approx 6sec compile time)

I suspect that I could improve my workflow in the following ways:

   1. TDD: cljs support for TDD is bad so I use crossovers and abstract all 
   the language specific features behind a protocol so I can use midje in 
   jvm/clj for my UI controllers
   2. I plan to abstract my views behind a protocol as well to keep them 
   really simple i.e. MVP
   3. piggieback and CCW : I've struggled to make this work and it sounds 
   like the holy grail. It would really help if someone would write a step by 
   step description of making this work. cemerick mentioned somewhere that 
   it's easiest to start a (browser connected) repl from lein and then attach 
   from CCW. I have not been able to work out how to do this. I'll buy beers 
   all night for anyone that helps me make this work.

That's my 10c. I'm happy to provide more info if it helps.

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: ClojureScript and development workflow

2012-09-11 Thread Chris Granger
FWIW, I'm working on this with Light Table, which removes a lot of the 
difficulties here - it will be include this script tag and you're ready to 
go. There's no reason that we need to jump through a bunch of hoops here. 
My plan is that the next release (sometime after strange loop) will include 
a nice way to work with CLJS such that a very nice getting started video 
could be created. :)

Cheers,
Chris.

On Tuesday, September 11, 2012 6:10:29 AM UTC-7, Chas Emerick wrote:
>
> On Sep 11, 2012, at 4:00 AM, Laurent PETIT wrote:
>
> 2012/9/10 Chas Emerick >
>
>> I've been using a combination of lein-cljsbuild to keep the on-disk 
>> generated code fresh and piggieback[1] for all of my cljs REPL needs.
>>
>
> Hello Chas,
>
> I've tried to use piggieback. My current stack for playing with the 
> concepts is leiningen2 on the command line (to start the server), with 
> clsjbuild to compile the browser_repl.cljs to "bootstrap" the REPL 
> machinery (lein cljsbuild once), regular "lein repl" once project.clj has 
> been configured with the proper options) and a regular CCW 0.10.0 nrepl 
> client.
>
> It works OK with the "out of the box" Rhino-backed evaluator, but as you 
> might guess, I have no interest in this and then I quickly jump to try & 
> get a Browser-based REPL running.
>
> That's where things broke. 
> I did not manage to get things compiled correctly.
>
> As it stands, it seems that I'll have to read & understand wiki pages from 
> ClojureScript project, nrepl documentation, piggieback documentation, 
> cljsbuild documentation, to really grasp the whole thing.
> Seems a little bit daunting just to be able to "play" with it. Is there an 
> easier way ? A resource somewhere which already explains step-by-step how 
> to get started with a new project, cljsbuild for compiling from time to 
> time, and piggieback ?
>
> Just asking before starting digging :-)
>
>
> There is a how-to in piggieback's README for using a browser-repl 
> environment rather than Rhino.  Nelson Morris was actually the first one to 
> get that working, and I'm using it regularly, so it *does* work, though 
> there's no doubt there's a lot of pieces you need to put together (for my 
> part, I blew nearly an hour tearing my hair out before re-reading the 
> browser-repl tutorial,[1] and seeing near the bottom that loading the HTML 
> page from disk wouldn't work; once I served the page from localhost, 
> everything fell together).
>
> FWIW, I've found ClojureScript itself to be very solid so far; there are 
> some unfortunate (IMO unnecessary) incompatibilities between it and 
> Clojure, but [2] is the only thing I've really tripped up on from a 
> technical standpoint.
>
> I think your assessment that the learning curve is "daunting" is just 
> about right, but that largely lays with the state of tooling, and the 
> disjointed nature of the development process.  With Clojure, you always 
> have a single environment (the JVM or CLR), into which you can load code 
> all day from nearly anywhere without having to think much about the 
> logistics of it.  ClojureScript necessarily implies a more complicated 
> setup: there's your REPL environment, probably a browser, and maybe a 
> connection between the two; you *must* have your code on disk and in the 
> right place in order for Google Closure / lein-cljsbuild to get at it (not 
> strictly true, but driving the compiler from a Clojure REPL isn't any 
> easier outside of simple cases); your Ring webapp needs to be configured to 
> be serving the gclosure output; and, you'd obviously like to be able to 
> control and monitor all of this from your editor/environment of choice.
>
> (I'd like to eventually do a 'Starting ClojureScript' screencast similar 
> to [3], but the logistics of "going from zero to hero" with ClojureScript 
> are IMO far too hard and nuanced still in order to present them well in 
> that sort of medium.)
>
> I think the contrast is so stark in part because of how good we've had it 
> on the Clojure side.  I suspect that CoffeeScript programming must be 
> similarly disjointed, since all the same moving pieces are necessary (and 
> perhaps without the benefit of upsides like a browser-connected REPL and so 
> on).  Welcome to the wonderful world of modern web development! :-P
>
> I think that's all a long way of saying: start digging!
>
> Cheers,
>
> - Chas
>
> [1] 
> https://github.com/clojure/clojurescript/wiki/The-REPL-and-Evaluation-Environments
> [2] http://dev.clojure.org/jira/browse/CLJS-358
> [3] http://cemerick.com/2012/05/02/starting-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: can someone explain me how is this evaluated?

2012-09-11 Thread Erlis Vidal
Hi BG and Neale,

Thanks for taking the time to answer my question. Now I can read that code
thanks to you.

These was key to understand what was going on:

*(apply + 1 2 '( 3 4))
 which is equivalent to -* *
(+ 1 2 3 4)*

and

*so the final result is equivalent to*

*((list (first '(1 2)) (first (3 4))) (list (second '(1 2)) (second '(3
4))) *
I knew about map with multiple collections but somehow when combined with
the apply I was unable to read that code, I was lost with to many
parameters to the apply function...

Thanks once again for helping me out with this
Erlis

On Tue, Sep 11, 2012 at 6:19 PM, Neale Swinnerton wrote:

> > > (apply map list (partition 2 [ 1 2 3 4 5 ])) => ((1 3) (2 4))
> >
> > This is equivalent to -
> >
> > (map list '(1 2) '(2 4) '(5))
>
> Actually, since no pad collection is supplied,  the partition call returns
>
> ((1 2) (3 4))
>
> So the apply variant (unwrapping the collection) is equivalent to
>
> (map list '(1 2) '(3 4))
>
> Which is different to the plain call which looks like:
>
> (map list '((1 2) (3 4)))
>
> Now, map has a cool feature when called with multiple collections. From
> the docs 
>
> map
> (map f coll)
> (map f c1 c2)
> (map f c1 c2 c3)
> (map f c1 c2 c3 & colls)
>
> Returns a lazy sequence consisting of the result of applying f to the
> set of first items of each coll, followed by applying f to the set
> of second items in each coll, until any one of the colls is
> exhausted. Any remaining items in other colls are ignored. Function
> f should accept number-of-colls arguments.
>
> so the final result is equivalent to
>
> ((list (first '(1 2)) (first (3 4))) (list (second '(1 2)) (second '(3
> 4)))
>
> Which becomes:
>
> ((list 1 3) (list 2 4))
>
> Which is the result you see - hope that helps
>
> Neale
> {t: @sw1nn, w:sw1nn.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

Re: Plural dispatch

2012-09-11 Thread Brent Millare
Actually since you are using def, I believe your method registrations are 
global. You should be using binding with dynamic vars to get thread locals. 
Also with mine, since I have the user specify the pluralfn symbol and since 
it can be called in another namespace, the namespace of the pluralfn is 
preserved. You can define multiple pluralfn's with the same name but in 
different namespaces. I don't think you can do that with your 
implementation. All this harping from me is really nothing though. Just 
details. Your approach well describes the point you are trying to make with 
little code. (Although you can remove the anonymous fn call in the 
update-in line, update-in accepts fns and the args it will pass to it :-P ).

Back to details though, I think that we still specify too much. For 
example, I think to make this more flexible and performant, we must not 
specify the data structure we choose to use. A vector may not provide the 
best data structure for fast lookup as we would like in a multimethod 
imitator. Also, when we reload a namespace, do we clobber all 
implementations? or save them? 

Probably some sort of protocol would be best, but I don't know what that 
approach should look like.

-- 
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 and development workflow

2012-09-11 Thread Chas Emerick
dj looks interesting, thanks for the link. :-)

- Chas

On Sep 10, 2012, at 8:31 PM, Brent Millare wrote:

> I emit the clojurescript code myself by calling cljs.closure/build myself and 
> put this into the html file. I cache the code using 
> clojure.core.memoize/memo-fifo with my own function that takes the dependent 
> files timestamps as args (so that changes result in recompiles). Using ring, 
> pages with refreshes automatically update if the source is updated.
> 
> I also use cemerick.piggieback for the liverepl between refreshes.
> 
> See dj.cljs/cljs-repl as part of 'dj', the library I wrote to manage some of 
> these things.
> 
> https://github.com/bmillare/dj/blob/library/src/dj/cljs.clj
> 
> Note that it is sufficient to just use the inserted js code emitted from 
> cljs.closure/build from a cljs file with (clojure.browser.repl/connect 
> "http://localhost:/repl") and dj.cljs/cljs-repl to get a liverepl. You 
> do not need any other files in the html file. (The example 
> https://github.com/clojure/clojurescript/wiki/The-REPL-and-Evaluation-Environments
>  can be misleading since it includes the "out/goog/base.js" and other 
> statements.
> 
> 
> -- 
> 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: Immutant 0.3.0 released

2012-09-11 Thread Jim Crossley
Hi Takahiro,

When considering a specific library in isolation, e.g. HornetQ, there is 
little difference between using it within or without an app server.

Benefits of an app server include uniform deployment, centralized 
configuration, monitoring, and control, clustering capabilities to support 
scaling and high availability, multi-resource transactions, and in-process 
services like caching, messaging, and scheduling. Things that matter to 
larger organizations in which different groups produce applications that 
need to coordinate, often deployed to environments controlled by still 
other groups.

For certain applications, I would recommend using libraries to access 
external processes like Memcached, RabbitMQ, or cron, for example. And for 
others, I would recommend an app server.

As always, it depends on the requirements of the application and the 
capabilities of the organization to support it.

Thanks,
Jim

On Tuesday, September 11, 2012 7:26:21 PM UTC-4, Takahiro Hozumi wrote:
>
> Hi, 
>
> Forgive my ignorance, although I think the project must be useful, but 
> I still don't understand what is the benefit of using application 
> server. 
> What is the difference between using a particular library(e.g. 
> HornetQ) with JBoss AS7 and using the same one without JBoss AS7? 
>
> Cheers, 
>
> - Takahiro 
>
> On Sep 12, 4:30 am, Jim Crossley  wrote: 
> > We released our third official version of Immutant today! 
> > 
> > With this release we now publish the Immutant namespaces to Clojars. 
> They 
> > are of limited use when run outside of Immutant, of course, but they'll 
> at 
> > least compile so you can mock/stub/redefine them in your unit tests. You 
> > can render some of them mostly functional by adding the relevant jars to 
> > your project.clj, e.g. Infinispan, HornetQ, etc, and we expect to add 
> more 
> > "container-less" functionality in future releases. 
> > 
> > Obviously, they're completely functional *inside* an Immutant container, 
> so 
> > we've published a library to facilitate integration testing, and 
> continued 
> > to improve our nrepl/swank support so you can now add dependencies to 
> your 
> > project on the fly without having to redeploy it. 
> > 
> > Here's the announcement:http://bit.ly/immutant030 
> > 
> > Enjoy and thanks, 
> > Jim 
>

-- 
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: Immutant 0.3.0 released

2012-09-11 Thread Takahiro Hozumi
Hi Jim,

Thank you for comprehensible explanation.
I understand.

Thanks,
- Takahiro

On Sep 12, 10:45 am, Jim Crossley  wrote:
> Hi Takahiro,
>
> When considering a specific library in isolation, e.g. HornetQ, there is
> little difference between using it within or without an app server.
>
> Benefits of an app server include uniform deployment, centralized
> configuration, monitoring, and control, clustering capabilities to support
> scaling and high availability, multi-resource transactions, and in-process
> services like caching, messaging, and scheduling. Things that matter to
> larger organizations in which different groups produce applications that
> need to coordinate, often deployed to environments controlled by still
> other groups.
>
> For certain applications, I would recommend using libraries to access
> external processes like Memcached, RabbitMQ, or cron, for example. And for
> others, I would recommend an app server.
>
> As always, it depends on the requirements of the application and the
> capabilities of the organization to support it.
>
> Thanks,
> Jim
>
>
>
>
>
>
>
> On Tuesday, September 11, 2012 7:26:21 PM UTC-4, Takahiro Hozumi wrote:
>
> > Hi,
>
> > Forgive my ignorance, although I think the project must be useful, but
> > I still don't understand what is the benefit of using application
> > server.
> > What is the difference between using a particular library(e.g.
> > HornetQ) with JBoss AS7 and using the same one without JBoss AS7?
>
> > Cheers,
>
> > - Takahiro
>
> > On Sep 12, 4:30 am, Jim Crossley  wrote:
> > > We released our third official version of Immutant today!
>
> > > With this release we now publish the Immutant namespaces to Clojars.
> > They
> > > are of limited use when run outside of Immutant, of course, but they'll
> > at
> > > least compile so you can mock/stub/redefine them in your unit tests. You
> > > can render some of them mostly functional by adding the relevant jars to
> > > your project.clj, e.g. Infinispan, HornetQ, etc, and we expect to add
> > more
> > > "container-less" functionality in future releases.
>
> > > Obviously, they're completely functional *inside* an Immutant container,
> > so
> > > we've published a library to facilitate integration testing, and
> > continued
> > > to improve our nrepl/swank support so you can now add dependencies to
> > your
> > > project on the fly without having to redeploy it.
>
> > > Here's the announcement:http://bit.ly/immutant030
>
> > > Enjoy and thanks,
> > > Jim

-- 
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: Ideas for interactive tasks

2012-09-11 Thread Murtaza Husain

This is really interesting. I am wondering if the idea could be broadened 
to not just teach CS, but also maths, physics and chemistry. 

A curriculum in which programming is used as a tool to explore the 
different sciences. An integrated curriculum to teach the different 
sciences. 

Please keep us posted on your progress.

On Tuesday, September 11, 2012 6:00:43 PM UTC+5:30, Zmitro Lapcjonak wrote:
>
>
> On Aug 9, 6:21 pm, Nikita Beloglazov  wrote: 
> > I'm going to organize little clojure course at my university this year. 
> For 
> > this I want to implement set of tasks that hopefully will help to 
> practise 
> > clojure. 
>
> Some tasks you may find at 4clojure: 
> https://www.4clojure.com/problems 
> Sort by "topic" and select "games, graph, data-analysis" 
>
> "Project Euler" has some interesting problems that you 
> may use to teach Clojure and train math theory also. 
>
>
> > Thank you, 
>
> Thank you and good luck! 
>
> -- 
> Zmitro Lapcionak 
>

-- 
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: Ideas for interactive tasks

2012-09-11 Thread Murtaza Husain

Thinking aloud, clojure could be used to create a DSL using which the 
students can experiment with concepts from different sciences, and see the 
results / effects in a graphical manner !!  

On Wednesday, September 12, 2012 11:03:04 AM UTC+5:30, Murtaza Husain wrote:
>
>
> This is really interesting. I am wondering if the idea could be broadened 
> to not just teach CS, but also maths, physics and chemistry. 
>
> A curriculum in which programming is used as a tool to explore the 
> different sciences. An integrated curriculum to teach the different 
> sciences. 
>
> Please keep us posted on your progress.
>
> On Tuesday, September 11, 2012 6:00:43 PM UTC+5:30, Zmitro Lapcjonak wrote:
>>
>>
>> On Aug 9, 6:21 pm, Nikita Beloglazov  wrote: 
>> > I'm going to organize little clojure course at my university this year. 
>> For 
>> > this I want to implement set of tasks that hopefully will help to 
>> practise 
>> > clojure. 
>>
>> Some tasks you may find at 4clojure: 
>> https://www.4clojure.com/problems 
>> Sort by "topic" and select "games, graph, data-analysis" 
>>
>> "Project Euler" has some interesting problems that you 
>> may use to teach Clojure and train math theory also. 
>>
>>
>> > Thank you, 
>>
>> Thank you and good luck! 
>>
>> -- 
>> Zmitro Lapcionak 
>>
>

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