Re: [ANN] new book: "ClojureScript: Up and Running"

2012-11-20 Thread Mimmo Cosenza
For what I know you do not need to explicitly write cljs dependency in 
project.clj if using lein-cljsbuild plugin which should already implicitly 
contain it.

try the following

$ lein new rhinotest

edit project.clj as follow

(defproject rhinotest "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"]]
  :plugins [[lein-cljsbuild "0.2.9"]]
  :cljsbuild {:builds []})

$ cd rhinotest
$ lein trampoline cljsbuild repl-rhino

mimmo


 
On Nov 20, 2012, at 6:34 AM, Mark Engelberg  wrote:

> Ugh, I should have guessed.  My attempts to do clojurescript several months 
> back were foiled by trampolining problems, but that was on lein 1.7.  I was 
> under the impression those problems had been fixed in lein 2.0, so I had 
> expected it to work, but it looks like there is still an issue.  Any easy 
> workaround?
> 
> On Mon, Nov 19, 2012 at 8:48 PM, Sean Corfield  wrote:
> Looks like George nailed it with his note about issue 674 which came in while 
> I was writing my (accurate but not particularly helpful) response...
> 
> 
> On Mon, Nov 19, 2012 at 11:45 PM, Sean Corfield  
> wrote:
> I wonder if it's some aspect of lein trampoline on Windows. As I understand 
> it, trampoline generates a file that is used to fire up the next process and 
> it may well have some *nix-ism that isn't compatible with Windows?
> 
> 
> On Mon, Nov 19, 2012 at 11:18 PM, Mark Engelberg  
> wrote:
> I just received the book today.  I was surprised to see how thin it is, but 
> I'm glad the book exists.  I had a lot of trouble getting up and running 
> several months ago, using only the scattered install instructions on the web. 
>  It's nice to have a clear path to getting started.
> 
> Unfortunately, I can't get past page 8 and would appreciate some additional 
> guidance.
> Using the latest lein 2.0 preview 10, I did "lein new cljs2" to create a new 
> project called cljs2.
> Then, I edited the project.clj file as described in the book, using the 
> latest version number for lein-cljsbuild:
> 
> (defproject cljs2 "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"]
>  [org.clojure/clojurescript "0.0-1450"]]
>   :plugins [[lein-cljsbuild "0.2.9"]]
>   :cljsbuild {:builds []})
> 
> Then, at the command prompt I typed:
> lein trampoline cljs-build repl-rhino
> and got the following error message.  I'm running on Windows.  Any idea 
> what's going wrong?
> Thanks.
> 
> C:\devel\Clojure\lein\cljs2>lein trampoline cljsbuild repl-rhino
> Running Rhino-based ClojureScript REPL.
> Exception in thread "main" clojure.lang.LispReader$ReaderException: 
> java.lang.Ru
> ntimeException: EOF while reading, starting at line 1
> at clojure.lang.LispReader.read(LispReader.java:215)
> at clojure.core$read.invoke(core.clj:3346)
> at clojure.core$read.invoke(core.clj:3344)
> at clojure.main$eval_opt.invoke(main.clj:295)
> at clojure.main$initialize.invoke(main.clj:316)
> at clojure.main$script_opt.invoke(main.clj:340)
> at clojure.main$main.doInvoke(main.clj:427)
> at clojure.lang.RestFn.invoke(RestFn.java:703)
> at clojure.lang.Var.invoke(Var.java:450)
> at clojure.lang.AFn.applyToHelper(AFn.java:212)
> at clojure.lang.Var.applyTo(Var.java:532)
> at clojure.main.main(main.java:37)
> Caused by: java.lang.RuntimeException: EOF while reading, starting at line 1
> at clojure.lang.Util.runtimeException(Util.java:170)
> at clojure.lang.LispReader.readDelimitedList(LispReader.java:1117)
> at clojure.lang.LispReader$ListReader.invoke(LispReader.java:962)
> at clojure.lang.LispReader.read(LispReader.java:180)
> ... 11 more
> 
> 
> -- 
> 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
> 
> 
> 
> -- 
> Sean A Corfield -- (904) 302-SEAN
> An Architect's View -- http://corfield.org/
> World Singles, LLC. -- http://worldsingles.com/
> 
> "Perfection is the enemy of the good."
> -- Gustave Flaubert, French realist novelist (1821-1880)
> 
> 
> 
> -- 
> Sean A Corfield -- (904) 302-SEAN
> An Architect's View -- http://corfield.org/
> World Singles, LLC. -- http://worldsingles.com/
> 
> "Perfection is the enemy of the good."
> -- Gustave Flaubert, French realist nov

Re: [ANN] new book: "ClojureScript: Up and Running"

2012-11-20 Thread Laurent PETIT
2012/11/20 Mark Engelberg 

> Ugh, I should have guessed.  My attempts to do clojurescript several
> months back were foiled by trampolining problems, but that was on lein
> 1.7.  I was under the impression those problems had been fixed in lein 2.0,
> so I had expected it to work, but it looks like there is still an issue.
> Any easy workaround?


What happens if you just don't use trampoline at all ? (Is trampoline
required, or just nice for saving some memory ?)


>
>
> On Mon, Nov 19, 2012 at 8:48 PM, Sean Corfield wrote:
>
>> Looks like George nailed it with his note about issue 674 which came in
>> while I was writing my (accurate but not particularly helpful) response...
>>
>>
>> On Mon, Nov 19, 2012 at 11:45 PM, Sean Corfield 
>> wrote:
>>
>>> I wonder if it's some aspect of lein trampoline on Windows. As I
>>> understand it, trampoline generates a file that is used to fire up the next
>>> process and it may well have some *nix-ism that isn't compatible with
>>> Windows?
>>>
>>>
>>> On Mon, Nov 19, 2012 at 11:18 PM, Mark Engelberg <
>>> mark.engelb...@gmail.com> wrote:
>>>
 I just received the book today.  I was surprised to see how thin it is,
 but I'm glad the book exists.  I had a lot of trouble getting up and
 running several months ago, using only the scattered install instructions
 on the web.  It's nice to have a clear path to getting started.

 Unfortunately, I can't get past page 8 and would appreciate some
 additional guidance.
 Using the latest lein 2.0 preview 10, I did "lein new cljs2" to create
 a new project called cljs2.
 Then, I edited the project.clj file as described in the book, using the
 latest version number for lein-cljsbuild:

 (defproject cljs2 "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"]
  [org.clojure/clojurescript "0.0-1450"]]
   :plugins [[lein-cljsbuild "0.2.9"]]
   :cljsbuild {:builds []})

 Then, at the command prompt I typed:
 lein trampoline cljs-build repl-rhino
 and got the following error message.  I'm running on Windows.  Any idea
 what's going wrong?
 Thanks.

 C:\devel\Clojure\lein\cljs2>lein trampoline cljsbuild repl-rhino
 Running Rhino-based ClojureScript REPL.
 Exception in thread "main" clojure.lang.LispReader$ReaderException:
 java.lang.Ru
 ntimeException: EOF while reading, starting at line 1
 at clojure.lang.LispReader.read(LispReader.java:215)
 at clojure.core$read.invoke(core.clj:3346)
 at clojure.core$read.invoke(core.clj:3344)
 at clojure.main$eval_opt.invoke(main.clj:295)
 at clojure.main$initialize.invoke(main.clj:316)
 at clojure.main$script_opt.invoke(main.clj:340)
 at clojure.main$main.doInvoke(main.clj:427)
 at clojure.lang.RestFn.invoke(RestFn.java:703)
 at clojure.lang.Var.invoke(Var.java:450)
 at clojure.lang.AFn.applyToHelper(AFn.java:212)
 at clojure.lang.Var.applyTo(Var.java:532)
 at clojure.main.main(main.java:37)
 Caused by: java.lang.RuntimeException: EOF while reading, starting at
 line 1
 at clojure.lang.Util.runtimeException(Util.java:170)
 at
 clojure.lang.LispReader.readDelimitedList(LispReader.java:1117)
 at
 clojure.lang.LispReader$ListReader.invoke(LispReader.java:962)
 at clojure.lang.LispReader.read(LispReader.java:180)
 ... 11 more

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

>>>
>>>
>>>
>>> --
>>> Sean A Corfield -- (904) 302-SEAN
>>> An Architect's View -- http://corfield.org/
>>> World Singles, LLC. -- http://worldsingles.com/
>>>
>>> "Perfection is the enemy of the good."
>>> -- Gustave Flaubert, French realist novelist (1821-1880)
>>>
>>
>>
>>
>> --
>> Sean A Corfield -- (904) 302-SEAN
>> An Architect's View -- http://corfield.org/
>> World Singles, LLC. -- http://worldsingles.com/
>>
>> "Perfection is the enemy of the good."
>> -- Gustave Flaubert, French realist novelist (1821-1880)
>>
>> --
>> You received this message because you are subscribed to the Google
>> Groups "Clojure" group.
>> To post to this group, send email to clojure@googlegroups.com
>> Note that posts from new members are moderated - please be patient with
>> your f

Re: Idiomatic equivalent for double dispatch in clojure?

2012-11-20 Thread Thomas Goossens
Thanks. Two months ago I bought that book. So I'll take a look at it !

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


ANN: Upcoming London Clojure Events

2012-11-20 Thread Bruce Durling
Roll up! Roll up!

We have a very full schedule of London Clojurian events coming your way to
take you from the end of November through to the beginning of December. It
should be the perfect way to introduce you to clojure or increase your
knowledge so that you are ready to tackle that fun clojure project you want
to do over the holiday break.

- 27 November - London Clojure Dojo at Thoughtworks (free)

http://london-clojure-dojo-tw-2012-11.eventbrite.co.uk/

- 4 December - Talks at SkillsMatter (free)

http://skillsmatter.com/event/clojure/london-clojure-december

Robert Rees will be discussing the different approaches take by Scala and
Clojure and Phil Potter will be talking about what it is like contributing
code to the core of clojure

- 6 December - Clojure eXchange (paid)

http://skillsmatter.com/event/clojure/clojure-exchange-2012

There are still early bird tickets left!

Speakers include Rich Hickey, David Nolen, Bodil Stokke, Sam Aaron, James
Reeves and more!

- 8 December - Hack the Tower (free)

The London Scala, Salesforce and Clojure communities are getting together
for a weekend of web hacking in Tower 42. Great views and a great time to
be had hacking.

http://www.meetup.com/LondonSalesforceDevelopers/events/91343352/

Phew! I'm going to go have a lie down now and rest up for all the
activities.

cheers,
Bruce
-- 
@otfrom | CTO & co-founder @MastodonC | mastodonc.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

More ClojureScript questions....

2012-11-20 Thread Thomas
Hi,

I am trying to use an existing JS library from CLJS and in JS one needs to 
define some call back functions in the following way. Assuming you have 
written some functions "foo" and "bar" and you have created a client called 
"client", you can do:
var options = new Object();
options.onSuccess = foo;
options.onFailure = bar;
client.connect(options); 

What would be the equivalent in CLJS? When I create a new Object I get the 
following error when I try and run the code:

Uncaught TypeError: Object # has no method 'onSuccess' 

Which is of course not that surprising... But how to do this properly in 
CLJS? 

TIA
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

proposal to exclude some cljs source from being compiled

2012-11-20 Thread Giacomo Cosenza
Hi all,
I'd like to add a new feature to both cljsbuild and clojurescript to allow the 
exclusion of some cljs source from being compiled. the motivation of this 
feature can be found at tthe following links:

- 
https://github.com/magomimmo/modern-cljs/blob/master/doc/tutorial-07.md#get-in-trouble
- https://github.com/emezeske/lein-cljsbuild/issues/157
- http://dev.clojure.org/jira/browse/CLJS-419

My proposal is the following:

- add a new compilation option named :exclude to the regular optimization 
options map. Its value can be a cljs file or a path (that has to be a subdir of 
source-dir). 
- add the same option to the underlying cljs compiler.

cljsbuild example:

(defproject ...
...
  :cljsbuild {:builds
  {
   :dev
   {
:source-path "src/cljs"
:compiler {
   :output-to "resources/public/js/main_dbg.js"
   :optimizations :whitespace
   :pretty-print true}}
   :prod
   {:source-path "src/cljs"
:compiler {
   :exclude "exlude" ;; exclude a cljs source-dir. or 
"path/to/filename.cljs" to exclude a single file
   :output-to "resources/public/js/modern.js"
   ; advanced optimization
   :optimizations :advanced)

>From cljsc point of view, the call could be

$ cljsc "src/cljs" {:exclude "exclude" :optimizations :advanced...

Is it something useful to you too?

My best

Mimmo

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


what should I use for my webapp?

2012-11-20 Thread John Lawrence Aspden
Hi Guys,

I haven't used Clojure for a year or so (I was busy in C and Verilog),
but I still love it and would like to use it.

I'm going to write a web app. I want to ask users to answer multiple
choice questions and time their responses. I'd like them to be able to
easily make accounts (the sign-in with google id feature of Stack
Overflow is really neat, I think) and store their performance data so
they can watch themselves improve.

I'd like to develop and test it on my own machine, but deploy it to a
virtual server somewhere, which I hope will not be hideously
expensive.

I hope it will be popular, but I think it's better to get a prototype
working than to worry about scaling in advance. However it would be
silly to prototype using a method that is unscalable.

My intutition is telling me to use Python and Flask, but my heart is
telling me to use Clojure and some framework, but I don't know what is
best. Or should I just write the whole server from scratch? The less
code the better, as far as I'm concerned, but I don't like using
things I don't understand.

Do you have any advice? Even comparisons of 'cgi scripts hacked up in
perl vs framework in continuously running VM' are welcome. I'm out of
my depth writing web apps, and will welcome any wisdom from those who
have actually done this sort of thing.

I don't need language comparisons. I've used most languages and
already have opinions on them all.

Thanks in advance,

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: what should I use for my webapp?

2012-11-20 Thread Robert Stuttaford
I reckon you can have this going in a couple hundred lines of code.

webnoir.org: http, routing, html generation. pick it up, tell it what you 
want. couldn't be simpler.

sqlkorma.com: sql query dsl.
clojuremongodb.info: mongodb query dsl.

Probably the most sticky bit is the Google auth, but perhaps by now there 
is code available.

github.com/cemerick/friend should get you started.

or if you're feeling adventurous, you could grab Datomic Free and have some 
fun with it.

We (a team of 3) are currently building a production stack with Datomic and 
Noir. I listed SQL and Mongo just in case :-) Feel free to ask me more here 
or off-list if you like!

On Tuesday, November 20, 2012 3:29:19 PM UTC+2, John Lawrence Aspden wrote:
>
> Hi Guys, 
>
> I haven't used Clojure for a year or so (I was busy in C and Verilog), 
> but I still love it and would like to use it. 
>
> I'm going to write a web app. I want to ask users to answer multiple 
> choice questions and time their responses. I'd like them to be able to 
> easily make accounts (the sign-in with google id feature of Stack 
> Overflow is really neat, I think) and store their performance data so 
> they can watch themselves improve. 
>
> I'd like to develop and test it on my own machine, but deploy it to a 
> virtual server somewhere, which I hope will not be hideously 
> expensive. 
>
> I hope it will be popular, but I think it's better to get a prototype 
> working than to worry about scaling in advance. However it would be 
> silly to prototype using a method that is unscalable. 
>
> My intutition is telling me to use Python and Flask, but my heart is 
> telling me to use Clojure and some framework, but I don't know what is 
> best. Or should I just write the whole server from scratch? The less 
> code the better, as far as I'm concerned, but I don't like using 
> things I don't understand. 
>
> Do you have any advice? Even comparisons of 'cgi scripts hacked up in 
> perl vs framework in continuously running VM' are welcome. I'm out of 
> my depth writing web apps, and will welcome any wisdom from those who 
> have actually done this sort of thing. 
>
> I don't need language comparisons. I've used most languages and 
> already have opinions on them all. 
>
> Thanks in advance, 
>
> 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: what should I use for my webapp?

2012-11-20 Thread John Lawrence Aspden
Awesome, thanks Robert (and anyone else taking the time to read this)

Can I ask you, the current best non-Clojure proposal seems to be
Python/Flask. Have you used them and can you tell me why you chose
Clojure/WebNoir. Is it an even choice as far as you're concerned, or
are there advantages to Python/Flask that you're doing without because
you'd like to use Clojure?

Also, Heroku has been recommended as an ideal host that's free to
develop on and pay for if the app proves popular. That seems to be
cool for either Python or Clojure. Any comments there?

Thanks, John.

On 20/11/2012, Robert Stuttaford  wrote:
> I reckon you can have this going in a couple hundred lines of code.
>
> webnoir.org: http, routing, html generation. pick it up, tell it what you
> want. couldn't be simpler.
>
> sqlkorma.com: sql query dsl.
> clojuremongodb.info: mongodb query dsl.
>
> Probably the most sticky bit is the Google auth, but perhaps by now there
> is code available.
>
> github.com/cemerick/friend should get you started.
>
> or if you're feeling adventurous, you could grab Datomic Free and have some
>
> fun with it.
>
> We (a team of 3) are currently building a production stack with Datomic and
>
> Noir. I listed SQL and Mongo just in case :-) Feel free to ask me more here
>
> or off-list if you like!
>
> On Tuesday, November 20, 2012 3:29:19 PM UTC+2, John Lawrence Aspden wrote:
>>
>> Hi Guys,
>>
>> I haven't used Clojure for a year or so (I was busy in C and Verilog),
>> but I still love it and would like to use it.
>>
>> I'm going to write a web app. I want to ask users to answer multiple
>> choice questions and time their responses. I'd like them to be able to
>> easily make accounts (the sign-in with google id feature of Stack
>> Overflow is really neat, I think) and store their performance data so
>> they can watch themselves improve.
>>
>> I'd like to develop and test it on my own machine, but deploy it to a
>> virtual server somewhere, which I hope will not be hideously
>> expensive.
>>
>> I hope it will be popular, but I think it's better to get a prototype
>> working than to worry about scaling in advance. However it would be
>> silly to prototype using a method that is unscalable.
>>
>> My intutition is telling me to use Python and Flask, but my heart is
>> telling me to use Clojure and some framework, but I don't know what is
>> best. Or should I just write the whole server from scratch? The less
>> code the better, as far as I'm concerned, but I don't like using
>> things I don't understand.
>>
>> Do you have any advice? Even comparisons of 'cgi scripts hacked up in
>> perl vs framework in continuously running VM' are welcome. I'm out of
>> my depth writing web apps, and will welcome any wisdom from those who
>> have actually done this sort of thing.
>>
>> I don't need language comparisons. I've used most languages and
>> already have opinions on them all.
>>
>> Thanks in advance,
>>
>> 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: [ANN] clj-xpath 1.3.3

2012-11-20 Thread John Gabriele

On Monday, November 19, 2012 2:55:40 PM UTC-5, Kyle Burton wrote:
>
> clj-xpath is a library that makes it easier to with XPath from Clojure.
>
> I've never announced this library before (or any for that matter). 
>  Someone recently sent me a pull request to fix an issue in the README 
> (during the Conj) so I thought I'd announce it to solicit feedback.
>
>
Nice. Thanks for posting, Kyle.
 

> The Leiningen coordiates are:
>
>   [org.clojars.kyleburton/clj-xpath "1.3.3"]
>
>
Just curious, why isn't that just [clj-xpath "1.3.3"]? Searching clojars, 
you seem to have uploaded 1.3.0 a while back...

---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: what should I use for my webapp?

2012-11-20 Thread kinleyd
I'm learning Clojure now and am working towards developing a web app or 
desktop app. I've picked Clojure, because after learning the language I've 
found it's simple, powerful, expressive and a pleasure to write. If I felt 
the same way about Python or Ruby or Node, I'd pick that.

If you like Clojure, then go for it. 

Having picked up the language, I'm now working my way up the Clojure web 
stack. Done ring (mostly), compojure, and for html templating tried a bit 
of fleet and learned comb, hiccup and enlive (enlive is powerful and I'm 
going with it). Next up are korma, rethinkdb,datomic (and maybe mongo) on 
the database side, domina/enfocus and other clojurescript libraries for the 
client side, and maybe friend on the oauth if I decide to go that way. It's 
been a lot fun, and I'm looking forward to more of the same. 

Thanks Rich Hickey and all developers of the libraries I'm using. :) 
 
On Tuesday, November 20, 2012 7:55:48 PM UTC+6, John Lawrence Aspden wrote:
>
> Awesome, thanks Robert (and anyone else taking the time to read this) 
>
> Can I ask you, the current best non-Clojure proposal seems to be 
> Python/Flask. Have you used them and can you tell me why you chose 
> Clojure/WebNoir. Is it an even choice as far as you're concerned, or 
> are there advantages to Python/Flask that you're doing without because 
> you'd like to use Clojure? 
>
> Also, Heroku has been recommended as an ideal host that's free to 
> develop on and pay for if the app proves popular. That seems to be 
> cool for either Python or Clojure. Any comments there? 
>
> Thanks, John. 
>
> On 20/11/2012, Robert Stuttaford > 
> wrote: 
> > I reckon you can have this going in a couple hundred lines of code. 
> > 
> > webnoir.org: http, routing, html generation. pick it up, tell it what 
> you 
> > want. couldn't be simpler. 
> > 
> > sqlkorma.com: sql query dsl. 
> > clojuremongodb.info: mongodb query dsl. 
> > 
> > Probably the most sticky bit is the Google auth, but perhaps by now 
> there 
> > is code available. 
> > 
> > github.com/cemerick/friend should get you started. 
> > 
> > or if you're feeling adventurous, you could grab Datomic Free and have 
> some 
> > 
> > fun with it. 
> > 
> > We (a team of 3) are currently building a production stack with Datomic 
> and 
> > 
> > Noir. I listed SQL and Mongo just in case :-) Feel free to ask me more 
> here 
> > 
> > or off-list if you like! 
> > 
> > On Tuesday, November 20, 2012 3:29:19 PM UTC+2, John Lawrence Aspden 
> wrote: 
> >> 
> >> Hi Guys, 
> >> 
> >> I haven't used Clojure for a year or so (I was busy in C and Verilog), 
> >> but I still love it and would like to use it. 
> >> 
> >> I'm going to write a web app. I want to ask users to answer multiple 
> >> choice questions and time their responses. I'd like them to be able to 
> >> easily make accounts (the sign-in with google id feature of Stack 
> >> Overflow is really neat, I think) and store their performance data so 
> >> they can watch themselves improve. 
> >> 
> >> I'd like to develop and test it on my own machine, but deploy it to a 
> >> virtual server somewhere, which I hope will not be hideously 
> >> expensive. 
> >> 
> >> I hope it will be popular, but I think it's better to get a prototype 
> >> working than to worry about scaling in advance. However it would be 
> >> silly to prototype using a method that is unscalable. 
> >> 
> >> My intutition is telling me to use Python and Flask, but my heart is 
> >> telling me to use Clojure and some framework, but I don't know what is 
> >> best. Or should I just write the whole server from scratch? The less 
> >> code the better, as far as I'm concerned, but I don't like using 
> >> things I don't understand. 
> >> 
> >> Do you have any advice? Even comparisons of 'cgi scripts hacked up in 
> >> perl vs framework in continuously running VM' are welcome. I'm out of 
> >> my depth writing web apps, and will welcome any wisdom from those who 
> >> have actually done this sort of thing. 
> >> 
> >> I don't need language comparisons. I've used most languages and 
> >> already have opinions on them all. 
> >> 
> >> Thanks in advance, 
> >> 
> >> 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: what should I use for my webapp?

2012-11-20 Thread John Gabriele
On Tuesday, November 20, 2012 8:29:19 AM UTC-5, John Lawrence Aspden wrote:

>
> My intutition is telling me to use Python and Flask, but my heart is 
> telling me to use Clojure and some framework, but I don't know what is 
> best. Or should I just write the whole server from scratch? The less 
> code the better, as far as I'm concerned, but I don't like using 
> things I don't understand. 
>
> Hi John,

As a first stop, I suggest 
http://clojure-doc.org/articles/tutorials/basic_web_development.html .

---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: [ANN] clj-xpath 1.3.3

2012-11-20 Thread Kyle R. Burton
> Dependency information is at the very bottom of the document? How are
> newcomers
> supposed to find it? Please make it more visible.
>


Good point.  I've moved the dependency info up towards the top of the
README.


Thanks for the feedback.

Best Regards,

Kyle

-- 
Twitter: @kyleburton
Github: https://github.com/kyleburton
Blog: http://asymmetrical-view.com/
Fun: http://snapclean.me/

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

Re: [ANN] clj-xpath 1.3.3

2012-11-20 Thread Kyle R. Burton
> The Leiningen coordiates are:
>>
>>   [org.clojars.kyleburton/clj-**xpath "1.3.3"]
>>
>>
> Just curious, why isn't that just [clj-xpath "1.3.3"]? Searching clojars,
> you seem to have uploaded 1.3.0 a while back...
>
>
That was a mistake.  I didn't want to claim a global 'clj-xpath' namespace
on Clojars so I added a namespace.  I'm not sure if I can remove that.



Kyle

-- 
Twitter: @kyleburton
Github: https://github.com/kyleburton
Blog: http://asymmetrical-view.com/
Fun: http://snapclean.me/

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

Re: [ANN] clj-xpath 1.3.3

2012-11-20 Thread John Gabriele
On Tuesday, November 20, 2012 10:07:15 AM UTC-5, Kyle Burton wrote:
>
>  
>
>> The Leiningen coordiates are:
>>>
>>>   [org.clojars.kyleburton/clj-**xpath "1.3.3"]
>>>
>>>
>> Just curious, why isn't that just [clj-xpath "1.3.3"]? Searching clojars, 
>> you seem to have uploaded 1.3.0 a while back...
>>
>>  
> That was a mistake.  I didn't want to claim a global 'clj-xpath' namespace 
> on Clojars so I added a namespace.  I'm not sure if I can remove that.
>
>
Well, the [Clojars About 
page](https://github.com/ato/clojars-web/wiki/About) has a "How do I delete 
a jar?" section that might be of use to you.

But since you're the original author, it seems to me that the clj-xpath 
group-id is all yours. :)

---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: [ANN] clj-xpath 1.3.3

2012-11-20 Thread Laurent PETIT
2012/11/20 Kyle R. Burton 

>
>
>> The Leiningen coordiates are:
>>>
>>>   [org.clojars.kyleburton/clj-**xpath "1.3.3"]
>>>
>>>
>> Just curious, why isn't that just [clj-xpath "1.3.3"]? Searching clojars,
>> you seem to have uploaded 1.3.0 a while back...
>>
>>
> That was a mistake.  I didn't want to claim a global 'clj-xpath' namespace
> on Clojars so I added a namespace.  I'm not sure if I can remove that.
>

Yeah, you probably shouldn't claim a global 'clj-xpath' namespace.

At least, I believe it. And some other guys too, like
https://twitter.com/richhickey/status/249545807718670336 :-)


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

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

Primitive function boxes and unboxes result value

2012-11-20 Thread Gunnar Völkel
I have written a primitive function for exponentiation with integers as 
power using the multiply-and-square algorithm.
For performance reasons I used primitive type hints for the arguments and 
the return value.
Profiling the whole application I noticed that there are a lot of 
java.lang.Double/valueOf calls.
Looking at the bytecode I see that in Clojure 1.3 as well as in Clojure 1.4 
the result value gets boxed and unboxed like 
Double.valueOf(result).doubleValue().

Am I doing something wrong? Is there a serious bug related to the support 
of primitive functions?

The source code:

(defn first-bit?
  {:inline (fn [n] `(== 1 (clojure.lang.Numbers/and ~n, 1)) )}
  [^long n]
  (== 1 (clojure.lang.Numbers/and n, 1)))

(defn exp-int
  ^double [^double x, ^long c]
  (loop [result 1.0, factor x, c c]
(if (> c 0)
(recur 
 (if (first-bit? c)
   (* result factor)
   result),
 (* factor factor),
 (bit-shift-right c 1))
  result)))

Last lines of the Java bytecode of `exp-int`:
59 dload 5;   /* result */
61 invokestatic 40;   /* java.lang.Double 
java.lang.Double.valueOf(double c) */
64 checkcast 85;  /* java.lang.Number */
67 invokevirtual 89;  /* double doubleValue() */
70 dreturn;

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

Re: [ANN] clj-xpath 1.3.3

2012-11-20 Thread Mark Rathwell
You can contact the maintainers at the address found at the bottom of [1]
and ask them to remove the clj-xpath group, but you probably don't want to
do that if anyone is using the library.

[1] https://github.com/ato/clojars-web/wiki/Contact


On Tue, Nov 20, 2012 at 10:07 AM, Kyle R. Burton wrote:

>
>
>> The Leiningen coordiates are:
>>>
>>>   [org.clojars.kyleburton/clj-**xpath "1.3.3"]
>>>
>>>
>> Just curious, why isn't that just [clj-xpath "1.3.3"]? Searching clojars,
>> you seem to have uploaded 1.3.0 a while back...
>>
>>
> That was a mistake.  I didn't want to claim a global 'clj-xpath' namespace
> on Clojars so I added a namespace.  I'm not sure if I can remove that.
>
>
>
>
> Kyle
>
> --
> Twitter: @kyleburton
> Github: https://github.com/kyleburton
> Blog: http://asymmetrical-view.com/
> Fun: http://snapclean.me/
>
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with
> your first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
>

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

Re: [ANN] clj-xpath 1.3.3

2012-11-20 Thread Laurent PETIT
2012/11/20 Laurent PETIT 

> 2012/11/20 Kyle R. Burton 
>
>
>>
>>> The Leiningen coordiates are:

   [org.clojars.kyleburton/clj-**xpath "1.3.3"]


>>> Just curious, why isn't that just [clj-xpath "1.3.3"]? Searching
>>> clojars, you seem to have uploaded 1.3.0 a while back...
>>>
>>>
>> That was a mistake.  I didn't want to claim a global 'clj-xpath'
>> namespace on Clojars so I added a namespace.  I'm not sure if I can remove
>> that.
>>
>
> Yeah, you probably shouldn't claim a global 'clj-xpath' namespace.
>
> At least, I believe it. And some other guys too, like
> https://twitter.com/richhickey/status/249545807718670336 :-)
>

And also https://twitter.com/stuarthalloway/status/253158176843780096

etc.


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

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

Edit/write Clojure code on Android

2012-11-20 Thread Nico Balestra
Hi there,
as per the subject of this email, supposing that I want to edit, write and 
potentially run a Clojure app on an Android device (Nexus 7), is there any 
way to achieve this or should I stop looking for the right Android app on 
the market?
Unfortunately the Clojure REPL distributed by Sattvik software & technology 
doesn't support editing files (of course.. it's a REPL :) )

Any idea would be more than welcome given that I bought my nexus 7 mainly 
for this :)

Thanks,
Nico

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

Re: [ANN] clj-xpath 1.3.3

2012-11-20 Thread Kyle R. Burton
On Tue, Nov 20, 2012 at 10:35 AM, Mark Rathwell wrote:

> You can contact the maintainers at the address found at the bottom of [1]
> and ask them to remove the clj-xpath group, but you probably don't want to
> do that if anyone is using the library.
>
>
Thanks for the link.  I have no idea if anyone is using the library w/o the
group name.  Is there any way to tell via Clojars?


Regards,

Kyle


-- 
Twitter: @kyleburton
Github: https://github.com/kyleburton
Blog: http://asymmetrical-view.com/
Fun: http://snapclean.me/

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

Sorted Sets With Duplicate Elements

2012-11-20 Thread JvJ
First of all:  I don't EXACTLY mean duplicate elements.  I just mean 
duplicates in those parts of the elements which are compared.

For instance, I recently tried to have a sorted set of 2-element vectors 
where the comparator < was used on the second element, however, something 
like this happened:

(sorted-set-by #(< (second %) (second %2))
[:a 1]
[:b 1]
[:c 1])

==> #{[:a 1]}


Does anyone know how I could have a set that includes all of these elements?

-- 
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: Sorted Sets With Duplicate Elements

2012-11-20 Thread Bronsa
what about using <= as sorting fuction?

2012/11/20 JvJ 

> First of all:  I don't EXACTLY mean duplicate elements.  I just mean
> duplicates in those parts of the elements which are compared.
>
> For instance, I recently tried to have a sorted set of 2-element vectors
> where the comparator < was used on the second element, however, something
> like this happened:
>
> (sorted-set-by #(< (second %) (second %2))
> [:a 1]
> [:b 1]
> [:c 1])
>
> ==> #{[:a 1]}
>
>
> Does anyone know how I could have a set that includes all of these
> elements?
>
> --
> 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

[ANN] lein-sha-version plugin for leiningen project version based on git SHA

2012-11-20 Thread Hugo Duncan

lein-sha-version is a leiningen plugin that sets the project version
based on the git SHA of the HEAD of the current branch. 

It can be used to create jars with a fixed version, but without the
trappings of a "full" release version. It provides a simple way of doing
SNAPSHOT type releases without the disadvantage of having SNAPSHOT
resolve to a moving target version.

It is a leiningen middleware, and does not provide any leiningen
task. It does not modify the project.clj file.

See https://github.com/pallet/lein-sha-version for usage.

Hugo

-- 
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: Sorted Sets With Duplicate Elements

2012-11-20 Thread JvJ
Simple solution.  It works!  Thanks.

On Tuesday, 20 November 2012 10:59:23 UTC-5, Bronsa wrote:
>
> what about using <= as sorting fuction?
>
> 2012/11/20 JvJ >
>
>> First of all:  I don't EXACTLY mean duplicate elements.  I just mean 
>> duplicates in those parts of the elements which are compared.
>>
>> For instance, I recently tried to have a sorted set of 2-element vectors 
>> where the comparator < was used on the second element, however, something 
>> like this happened:
>>
>> (sorted-set-by #(< (second %) (second %2))
>> [:a 1]
>> [:b 1]
>> [:c 1])
>>
>> ==> #{[:a 1]}
>>
>>
>> Does anyone know how I could have a set that includes all of these 
>> elements?
>>  
>> -- 
>> 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: proposal to exclude some cljs source from being compiled

2012-11-20 Thread David Nolen
If someone creates a patch for this I'll happily apply it.


On Tue, Nov 20, 2012 at 7:29 AM, Giacomo Cosenza wrote:

> Hi all,
> I'd like to add a new feature to both cljsbuild and clojurescript to allow
> the exclusion of some cljs source from being compiled. the motivation of
> this feature can be found at tthe following links:
>
> -
> https://github.com/magomimmo/modern-cljs/blob/master/doc/tutorial-07.md#get-in-trouble
> - https://github.com/emezeske/lein-cljsbuild/issues/157
> - http://dev.clojure.org/jira/browse/CLJS-419
>
> My proposal is the following:
>
> - add a new compilation option named :exclude to the regular optimization
> options map. Its value can be a cljs file or a path (that has to be a
> subdir of source-dir).
> - add the same option to the underlying cljs compiler.
>
> cljsbuild example:
>
> (defproject ...
> ...
>   :cljsbuild {:builds
>   {
>:dev
>{
> :source-path "src/cljs"
> :compiler {
>:output-to "resources/public/js/main_dbg.js"
>:optimizations :whitespace
>:pretty-print true}}
>:prod
>{:source-path "src/cljs"
> :compiler {
>:exclude "exlude" ;; exclude a cljs source-dir.
> or "path/to/filename.cljs" to exclude a single file
>:output-to "resources/public/js/modern.js"
>; advanced optimization
>:optimizations :advanced)
>
> From cljsc point of view, the call could be
>
> $ cljsc "src/cljs" {:exclude "exclude" :optimizations :advanced...
>
> Is it something useful to you too?
>
> My best
>
> Mimmo
>
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with
> your first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
>

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

Re: [ANN] lein-sha-version plugin for leiningen project version based on git SHA

2012-11-20 Thread Lee Hinman

Hugo Duncan writes:

> lein-sha-version is a leiningen plugin that sets the project version
> based on the git SHA of the HEAD of the current branch. 
>
> It can be used to create jars with a fixed version, but without the
> trappings of a "full" release version. It provides a simple way of doing
> SNAPSHOT type releases without the disadvantage of having SNAPSHOT
> resolve to a moving target version.
>
> It is a leiningen middleware, and does not provide any leiningen
> task. It does not modify the project.clj file.
>
> See https://github.com/pallet/lein-sha-version for usage.
>
> Hugo

Out of curiosity, doesn't maven's snapshot pining already do this?

; Lee Hinman

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


Re: [ANN] clj-xpath 1.3.3

2012-11-20 Thread John Gabriele
On Tuesday, November 20, 2012 10:35:46 AM UTC-5, lpetit wrote:
>
> 2012/11/20 Laurent PETIT >
>
>> 2012/11/20 Kyle R. Burton >
>>
>>  
>>>
 The Leiningen coordiates are:
>
>   [org.clojars.kyleburton/clj-**xpath "1.3.3"]
>
>
 Just curious, why isn't that just [clj-xpath "1.3.3"]? Searching 
 clojars, you seem to have uploaded 1.3.0 a while back...

  
>>> That was a mistake.  I didn't want to claim a global 'clj-xpath' 
>>> namespace on Clojars so I added a namespace.  I'm not sure if I can remove 
>>> that.
>>>
>>
>> Yeah, you probably shouldn't claim a global 'clj-xpath' namespace.
>>
>> At least, I believe it. And some other guys too, like 
>> https://twitter.com/richhickey/status/249545807718670336 :-)
>>
>
> And also https://twitter.com/stuarthalloway/status/253158176843780096
>
> etc.
>

Oh, thanks. My understanding was that current best practice was to choose a 
good name, and then if you're the original author, your project's group-id 
= artifact-id (and thus you get the https://clojars.org/my-proj url).

(And note, I think this is separate from the discussion of namespaces 
within your project's code).

---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: [ANN] clj-xpath 1.3.3

2012-11-20 Thread Heinz Nikolaus Gies
Po

Sent from my iPhone

On 20.11.2012, at 16:47, "Kyle R. Burton"  wrote:

> 
> On Tue, Nov 20, 2012 at 10:35 AM, Mark Rathwell  
> wrote:
>> You can contact the maintainers at the address found at the bottom of [1] 
>> and ask them to remove the clj-xpath group, but you probably don't want to 
>> do that if anyone is using the library.
>> 
> 
> Uhl
> Thanks for the link.  I have no idea if anyone is using the library w/o the 
> group name.  Is there any way to tell via Clojars?
> Mn
> 
> Regards,orokizu
> Uhrzeit
Myers
M
> Kyle
> I
> 
> -- 
> Twitter: @kyleburton
> Github: https://github.com/kyleburton
> Blog: http://asymmetrical-view.com/
> Fun: http://snapclean.me/
> -- 
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with your 
> first post.
> To unsubscribe from this group, send email vto
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en

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

Re: [ANN] clj-xpath 1.3.3

2012-11-20 Thread Laurent PETIT
2012/11/20 John Gabriele 

> On Tuesday, November 20, 2012 10:35:46 AM UTC-5, lpetit wrote:
>>
>> 2012/11/20 Laurent PETIT 
>>
>>> 2012/11/20 Kyle R. Burton 
>>>
>>>

> The Leiningen coordiates are:
>>
>>   [org.clojars.kyleburton/clj-xpath "1.3.3"]
>>
>>
> Just curious, why isn't that just [clj-xpath "1.3.3"]? Searching
> clojars, you seem to have uploaded 1.3.0 a while back...
>
>
 That was a mistake.  I didn't want to claim a global 'clj-xpath'
 namespace on Clojars so I added a namespace.  I'm not sure if I can remove
 that.

>>>
>>> Yeah, you probably shouldn't claim a global 'clj-xpath' namespace.
>>>
>>> At least, I believe it. And some other guys too, like
>>> https://twitter.com/**richhickey/status/**249545807718670336:-)
>>>
>>
>> And also 
>> https://twitter.com/**stuarthalloway/status/**253158176843780096
>>
>> etc.
>>
>
> Oh, thanks. My understanding was that current best practice was to choose
> a good name, and then if you're the original author, your project's
> group-id = artifact-id (and thus you get the https://clojars.org/my-projurl).
>
> (And note, I think this is separate from the discussion of namespaces
> within your project's code).
>

Maybe, indeed.

I tend to think that the group-id's prefix is your namespace, e.g. if I own
lpetit.org, then group-id is at least org.lpetit (but I could refine more
if I had several categories of products, etc.), and then some clojure
namespaces would be org.lpetit.project-foo.core, etc.

Also, note that in some containers environments, the jars produced contain
only in their names the artefact-id, e.g. if you artefact-id is "file" then
the final jar is file-0.3.4.jar for instance. So I also tend (even if it's
verbose) to repeat the group-id in the artefact-id, even if it's far from
ideal.

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

Problems getting Heroku to accept custom bin/build script

2012-11-20 Thread Michael Berg
Hello,

I'm trying now already for hours to get somehow Heroku to accept a simple 
bin/build script with "lein deps" inside. 
I've got a simple app (just noir test actually) and would like to prevent 
AOT compiling (for my real app, which uses core.match), but whatever I do 
Heroku simply doesn't seam to care.
Actually it can't be that difficult and guess I checked during the last 
hours all kinds of mistakes I could have made.

So just for the record what I did/checked:
In order to let Herokus bin/compile (from the buildpack) use a custom 
BUILD_COMMAND I should just add to my repository a directory named "bin" 
and inside a file named "build" containing the commands to be executed. 
That file should be executable.
I'm trying to do this from Win7, the "build" file is executable, I checked 
this via heroku run bash etc. but, it never gets to select the 
bin/compile-scripts path to set BUILD_COMMAND to the my "build" file. At 
some point I thought that maybe BUILD_COMMAND is magically set already, so 
the bin/compile-script will never attempt to set BUILD_COMMAND, but it's 
not set and setting it manually via "heroku config:add BUILD_COMMAND="lein 
deps"" doesn't help either. My last hope went away when I tried to clone 
the Heroku repository into a fresh local directory and found that my pushed 
"build" file was actually not executable (even though at the server it 
seamed so) and I tried to push it back with the executable bit set. But 
again nothing happend and the only thing left to try would be to do the 
same stuff from a Linux machine, in case it's Win7, but I don't want to 
believe that's true.

Might I have overlooked something? Has anybody an idea what I'm missing? 
:-| 

I just wanna go on with my stuff and not remove core.match code just, to be 
able to deploy to Heroku.

Any hints or help is very much appreciated.

Cheers

Michael


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

Re: [ANN] clj-xpath 1.3.3

2012-11-20 Thread Mark Rathwell
> Thanks for the link.  I have no idea if anyone is using the library w/o the 
> group name.  Is there any way to tell via Clojars?

No.  I think the only real option would be to contact anyone following
the repo on Github and inquire.  Honestly, though, I would just leave
it, I don't see it causing any issues.


On Tue, Nov 20, 2012 at 10:47 AM, Kyle R. Burton  wrote:
>
>
> On Tue, Nov 20, 2012 at 10:35 AM, Mark Rathwell  
> wrote:
>>
>> You can contact the maintainers at the address found at the bottom of [1] 
>> and ask them to remove the clj-xpath group, but you probably don't want to 
>> do that if anyone is using the library.
>>
>
> Thanks for the link.  I have no idea if anyone is using the library w/o the 
> group name.  Is there any way to tell via Clojars?
>
>
> Regards,
>
> Kyle
>
>
> --
> Twitter: @kyleburton
> Github: https://github.com/kyleburton
> Blog: http://asymmetrical-view.com/
> Fun: http://snapclean.me/
>
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with your 
> first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en

-- 
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: Primitive function boxes and unboxes result value

2012-11-20 Thread Gunnar Völkel
I can add some additional information. I compiled the fibonacci example 
with double and long type hints:

(defn fib ^long [^long n]
  (if (<= n 1) 1 (+ (fib (dec n)) (fib (- n 2)

(defn fib ^double [^double n]
  (if (<= n 1) 1 (+ (fib (dec n)) (fib (- n 2)

The one with ^long works as expected but the one with ^double has the 
Double.valueOf(result).
doubleValue() bytecode before the return.

-- 
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: proposal to exclude some cljs source from being compiled

2012-11-20 Thread Giacomo Cosenza
Hi David,
I'll work on it next days.

Thanks
mimmo


On Nov 20, 2012, at 5:06 PM, David Nolen wrote:

> If someone creates a patch for this I'll happily apply it.
> 
> 
> On Tue, Nov 20, 2012 at 7:29 AM, Giacomo Cosenza  
> wrote:
> Hi all,
> I'd like to add a new feature to both cljsbuild and clojurescript to allow 
> the exclusion of some cljs source from being compiled. the motivation of this 
> feature can be found at tthe following links:
> 
> - 
> https://github.com/magomimmo/modern-cljs/blob/master/doc/tutorial-07.md#get-in-trouble
> - https://github.com/emezeske/lein-cljsbuild/issues/157
> - http://dev.clojure.org/jira/browse/CLJS-419
> 
> My proposal is the following:
> 
> - add a new compilation option named :exclude to the regular optimization 
> options map. Its value can be a cljs file or a path (that has to be a subdir 
> of source-dir).
> - add the same option to the underlying cljs compiler.
> 
> cljsbuild example:
> 
> (defproject ...
> ...
>   :cljsbuild {:builds
>   {
>:dev
>{
> :source-path "src/cljs"
> :compiler {
>:output-to "resources/public/js/main_dbg.js"
>:optimizations :whitespace
>:pretty-print true}}
>:prod
>{:source-path "src/cljs"
> :compiler {
>:exclude "exlude" ;; exclude a cljs source-dir. or 
> "path/to/filename.cljs" to exclude a single file
>:output-to "resources/public/js/modern.js"
>; advanced optimization
>:optimizations :advanced)
> 
> From cljsc point of view, the call could be
> 
> $ cljsc "src/cljs" {:exclude "exclude" :optimizations :advanced...
> 
> Is it something useful to you too?
> 
> My best
> 
> Mimmo
> 
> --
> 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: [ANN] lein-sha-version plugin for leiningen project version based on git SHA

2012-11-20 Thread Lee Hinman

Hugo Duncan writes:

> lein-sha-version is a leiningen plugin that sets the project version
> based on the git SHA of the HEAD of the current branch. 
>
> It can be used to create jars with a fixed version, but without the
> trappings of a "full" release version. It provides a simple way of doing
> SNAPSHOT type releases without the disadvantage of having SNAPSHOT
> resolve to a moving target version.
>
> It is a leiningen middleware, and does not provide any leiningen
> task. It does not modify the project.clj file.
>
> See https://github.com/pallet/lein-sha-version for usage.
>
> Hugo

Actually, disregard, I read it wrong. I see why this would be useful
now.

; Lee

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


Re: Idiomatic equivalent for double dispatch in clojure?

2012-11-20 Thread Thomas Goossens
I think it is a bit dull that for every combination [type1 type2] you have 
to define an equivalent method for  [type2 type1]

Is there a way to address this problem? perhaps with sets? 

i need to think about this one :D

On Monday, November 19, 2012 4:32:15 PM UTC+1, Brian Marick wrote:
>
> Here's an example of using multimethods. (Note: I overrode the Clojure 
> defmulti/defmethod macros with my own that play more nicely with the repl, 
> and for other purposes. It's a straightforward translation.) You can see 
> all the code here: 
>
> https://github.com/marick/fp-oo/blob/master/sources/asteroids.clj 
>
> The code's explained in chapter 14 of https://leanpub.com/fp-oo 
>
>
>
> ;;; Objects of interest 
> (def make 
>  (fn [type value-map] 
>(with-meta value-map {:type type}))) 
>
> (def rim-griffon (make ::starship {:name "Rim Griffon", :speed 1000})) 
> (def malse (make ::asteroid {:name "Malse", :speed 0.1, 
> :gravitational-pull 0.5})) 
>
>
> ;;; Collide with multi-arg dispatch 
>
> (defgeneric collide (fn [one two] [(type one) (type two)])) 
>   
> (defspecialized collide [::asteroid ::asteroid] 
>   (fn [& asteroids] asteroids)) 
>
> (defspecialized collide [::asteroid ::starship] 
>   (fn [asteroid starship] 
> [asteroid (stopped starship)])) 
>
> (defspecialized collide [::starship ::asteroid] 
>   (fn [starship asteroid] 
> [(stopped starship) asteroid])) 
>
> (defspecialized collide [::starship ::starship] 
>   (fn [& starships] 
> (let [speed (apply max (map :speed starships))] 
>   (map (partial with-speed speed) starships 
>
>
>
>
>
> - 
> Brian Marick, Artisanal Labrador 
> Contract programming in Ruby and Clojure 
> Occasional consulting on Agile 
> Writing /Functional Programming for the Object-Oriented Programmer/: 
> https://leanpub.com/fp-oo 
>
>
>

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

Problem getting Heroku to accept custom bin/build script

2012-11-20 Thread Michael Berg
Hello,

I'm trying now already for hours to get somehow Heroku to accept a simple 
bin/build script with "lein deps" inside. 
I've got a simple app (just noir test actually) and would like to prevent 
AOT compiling (for my real app, which uses core.match), but whatever I do 
Heroku simply doesn't seam to care.
Actually it can't be that difficult and guess I checked during the last 
hours all kinds of mistakes I could have made.

So just for the record what I did/checked:
In order to let Herokus bin/compile (from the buildpack) use a custom 
BUILD_COMMAND I should just add to my repository a directory named "bin" 
and inside a file named "build" containing the commands to be executed. 
That file should be executable.
I'm trying to do this from Win7, the "build" file is executable, I checked 
this via heroku run bash etc. but, it never gets to select the 
bin/compile-scripts path to set BUILD_COMMAND to the my "build" file. At 
some point I thought that maybe BUILD_COMMAND is magically set already, so 
the bin/compile-script will never attempt to set BUILD_COMMAND, but it's 
not set and setting it manually via "heroku config:add BUILD_COMMAND="lein 
deps"" doesn't help either. My last hope went away when I tried to clone 
the Heroku repository into a fresh local directory and found that my pushed 
"build" file was actually not executable (even though at the server it 
seamed so) and I tried to push it back with the executable bit set. But 
again nothing happend and the only thing left to try would be to do the 
same stuff from a Linux machine, in case it's Win7, but I don't want to 
believe that's true.

Might I have overlooked something? Has anybody an idea what I'm missing? 
:-| 

I just wanna go on with my stuff and not remove core.match code just, to be 
able to deploy to Heroku.

Any hint or help is very much appreciated.

Cheers

Michael

-- 
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: Edit/write Clojure code on Android

2012-11-20 Thread Nenad Seke
You can write your clojure code in some editor and then evaluate that 
code from REPL with load-file function.


On 11/20/2012 4:43 PM, Nico Balestra wrote:

Hi there,
as per the subject of this email, supposing that I want to edit, write 
and potentially run a Clojure app on an Android device (Nexus 7), is 
there any way to achieve this or should I stop looking for the right 
Android app on the market?
Unfortunately the Clojure REPL distributed by Sattvik software & 
technology doesn't support editing files (of course.. it's a REPL :) )


Any idea would be more than welcome given that I bought my nexus 7 
mainly for this :)


Thanks,
Nico
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient 
with your first post.

To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en 


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

Re: [ANN] lein-sha-version plugin for leiningen project version based on git SHA

2012-11-20 Thread Hugo Duncan
Lee Hinman  writes:

> Hugo Duncan writes:
>
>> lein-sha-version is a leiningen plugin that sets the project version
>> based on the git SHA of the HEAD of the current branch. 
>>
>> It can be used to create jars with a fixed version, but without the
>> trappings of a "full" release version. It provides a simple way of doing
>> SNAPSHOT type releases without the disadvantage of having SNAPSHOT
>> resolve to a moving target version.
>
> Out of curiosity, doesn't maven's snapshot pining already do this?

You can pin usage of a snapshot based on upload timestamp. The lifetime
of SNAPSHOT artifacts is however controlled by the repo policies, so a
particular (timestamped) version of SNAPSHOT jar can disappear at any
time. 

Jars produced when using this plugin would be considered release jars in
the maven repo world.

Hugo

-- 
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: Edit/write Clojure code on Android

2012-11-20 Thread Jim foo.bar
The problem with that is that it will only work if there are no external 
dependencies! As long as your code depends only on clojure 1.4 it's all 
good...this is very unlikely though for a descent sized project...


Jim


On 20/11/12 16:14, Nenad Seke wrote:
You can write your clojure code in some editor and then evaluate that 
code from REPL with load-file function.


On 11/20/2012 4:43 PM, Nico Balestra wrote:

Hi there,
as per the subject of this email, supposing that I want to edit, 
write and potentially run a Clojure app on an Android device (Nexus 
7), is there any way to achieve this or should I stop looking for the 
right Android app on the market?
Unfortunately the Clojure REPL distributed by Sattvik software & 
technology doesn't support editing files (of course.. it's a REPL :) )


Any idea would be more than welcome given that I bought my nexus 7 
mainly for this :)


Thanks,
Nico
--
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: what should I use for my webapp?

2012-11-20 Thread John Lawrence Aspden
Thanks very much everyone.

I think I'll try Robert's recommendation of
clojure/webnoir/heroku/sqlkorma . I'm figuring that using heroku rules
out datomic? And that their 'free webserver and pay us if you need to
scale it' offer is as good as it gets.

Any obvious pitfalls ahead?

Off to the various tutorials.

On 20/11/2012, John Gabriele  wrote:
> On Tuesday, November 20, 2012 8:29:19 AM UTC-5, John Lawrence Aspden wrote:
>
>>
>> My intutition is telling me to use Python and Flask, but my heart is
>> telling me to use Clojure and some framework, but I don't know what is
>> best. Or should I just write the whole server from scratch? The less
>> code the better, as far as I'm concerned, but I don't like using
>> things I don't understand.
>>
>> Hi John,
>
> As a first stop, I suggest
> http://clojure-doc.org/articles/tutorials/basic_web_development.html .
>
> ---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: More ClojureScript questions....

2012-11-20 Thread Thomas
At the moment I have this:

 (let [ client (js/Client. )
 connectOptions (new js/Object) ]
   (.onSuccess connectOptions ) (fn [] (js/console.log "Successful 
Connect"))
   (.onFailure connectOptions ) (fn [] (js/console.log "failure 
Connect")))

If you need any more info please let me know.

Thomas

On Tuesday, November 20, 2012 4:07:12 PM UTC, David Nolen wrote:
>
> What does your ClojureScript code look like?
>
>
> On Tue, Nov 20, 2012 at 5:47 AM, Thomas 
> > wrote:
>
>> Hi,
>>
>> I am trying to use an existing JS library from CLJS and in JS one needs 
>> to define some call back functions in the following way. Assuming you have 
>> written some functions "foo" and "bar" and you have created a client called 
>> "client", you can do:
>> var options = new Object();
>> options.onSuccess = foo;
>> options.onFailure = bar;
>> client.connect(options); 
>>
>> What would be the equivalent in CLJS? When I create a new Object I get 
>> the following error when I try and run the code:
>>
>> Uncaught TypeError: Object # has no method 'onSuccess' 
>>
>> Which is of course not that surprising... But how to do this properly in 
>> CLJS? 
>>
>> TIA
>> Thomas
>>
>> -- 
>> 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: [ANN] clj-xpath 1.3.3

2012-11-20 Thread Phil Hagelberg
John Gabriele  writes:

> Oh, thanks. My understanding was that current best practice was to
> choose a good name, and then if you're the original author, your
> project's group-id = artifact-id (and thus you get the
> https://clojars.org/my-proj url).

You're correct that this is the Clojars policy. 

I'd add that if for whatever reason you can't use a name that is likely
to be unique, then you should add a group-id based on another qualifier
such as a corporation name, registered freenode nick/channel, or domain
name, but please don't use org.clojars.* for this as it already has a
specific meaning around non-canonicity.

However, the likelihood that anyone else will come along in the future
and name another library clj-xpath is basically nil in this case.

-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


defpromise?

2012-11-20 Thread Jim foo.bar
I was just wondering...we have a 'defsomething' macro for almost 
everything...


How come there is no 'defpromise'? It is very easy to write one and 
since we always initialize promises like this: (def x (promise)), I 
don't see any reason why not...


(defmacro defpromise [name]
  `(def ~name (promise)))

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: Primitive function boxes and unboxes result value

2012-11-20 Thread Christophe Grand
Hi,

It looks like, because of the recur, the compiler fails to notice that if
returns a primitive.
As far as I understand in Compiler.java, RecurExpr does not implement
MaybePrimitiveExpr and thus causes on canEmitPrimitive the surrounding
IfExpr to return false.

Someone to confirm this analysis?


On Tue, Nov 20, 2012 at 4:34 PM, Gunnar Völkel <
gunnar.voel...@googlemail.com> wrote:

> I have written a primitive function for exponentiation with integers as
> power using the multiply-and-square algorithm.
> For performance reasons I used primitive type hints for the arguments and
> the return value.
> Profiling the whole application I noticed that there are a lot of
> java.lang.Double/valueOf calls.
> Looking at the bytecode I see that in Clojure 1.3 as well as in Clojure
> 1.4 the result value gets boxed and unboxed like
> Double.valueOf(result).doubleValue().
>
> Am I doing something wrong? Is there a serious bug related to the support
> of primitive functions?
>
> The source code:
>
> (defn first-bit?
>   {:inline (fn [n] `(== 1 (clojure.lang.Numbers/and ~n, 1)) )}
>   [^long n]
>   (== 1 (clojure.lang.Numbers/and n, 1)))
>
> (defn exp-int
>   ^double [^double x, ^long c]
>   (loop [result 1.0, factor x, c c]
> (if (> c 0)
> (recur
>  (if (first-bit? c)
>(* result factor)
>result),
>  (* factor factor),
>  (bit-shift-right c 1))
>   result)))
>
> Last lines of the Java bytecode of `exp-int`:
> 59 dload 5;   /* result */
> 61 invokestatic 40;   /* java.lang.Double
> java.lang.Double.valueOf(double c) */
> 64 checkcast 85;  /* java.lang.Number */
> 67 invokevirtual 89;  /* double doubleValue() */
> 70 dreturn;
>
> --
> 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




-- 
Professional: http://cgrand.net/ (fr)
On Clojure: http://clj-me.cgrand.net/ (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: Problems getting Heroku to accept custom bin/build script

2012-11-20 Thread Phil Hagelberg

> I'm trying now already for hours to get somehow Heroku to accept a
> simple bin/build script with "lein deps" inside. 

If you give me the app name I can see what's going wrong.

thanks,
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: [ANN] clj-xpath 1.3.3

2012-11-20 Thread John Gabriele
On Tuesday, November 20, 2012 12:10:09 PM UTC-5, Phil Hagelberg wrote:
>
> John Gabriele > writes: 
>
> > Oh, thanks. My understanding was that current best practice was to 
> > choose a good name, and then if you're the original author, your 
> > project's group-id = artifact-id (and thus you get the 
> > https://clojars.org/my-proj url). 
>
> You're correct that this is the Clojars policy. 
>

I like this policy. Especially given that project maintainership changes 
over time. Although it's nice to get credit by having your name/domain/nick 
in the group-id, I think that --- long-term --- it's probably going to be 
easier to transition between maintainers (and without users having to 
change their dependencies) if group-id = artifact-id.

For example: if the folks at foo.com stop maintaining com.foo/some-proj, 
then the folks at bar.com might be hesitant to pick up maintainership: 
either they maintain com.foo/some-proj (and foo.com gets geek cred in place 
of bar.com), or else they change the project to com.bar/some-proj and now 
users have to change their code to get the newer versions. Just seems like 
it has the potential to cause unnecessary waves.

Heck, domain name ownership may change over time as well.

---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: Primitive function boxes and unboxes result value

2012-11-20 Thread Andy Fingerhut
Any relationship to CLJ-701, other than similar symptoms?

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

Andy

On Nov 20, 2012, at 9:15 AM, Christophe Grand wrote:

> Hi,
> 
> It looks like, because of the recur, the compiler fails to notice that if 
> returns a primitive.
> As far as I understand in Compiler.java, RecurExpr does not implement 
> MaybePrimitiveExpr and thus causes on canEmitPrimitive the surrounding IfExpr 
> to return false.
> 
> Someone to confirm this analysis?
> 
> 
> On Tue, Nov 20, 2012 at 4:34 PM, Gunnar Völkel 
>  wrote:
> I have written a primitive function for exponentiation with integers as power 
> using the multiply-and-square algorithm.
> For performance reasons I used primitive type hints for the arguments and the 
> return value.
> Profiling the whole application I noticed that there are a lot of 
> java.lang.Double/valueOf calls.
> Looking at the bytecode I see that in Clojure 1.3 as well as in Clojure 1.4 
> the result value gets boxed and unboxed like 
> Double.valueOf(result).doubleValue().
> 
> Am I doing something wrong? Is there a serious bug related to the support of 
> primitive functions?
> 
> The source code:
> 
> (defn first-bit?
>   {:inline (fn [n] `(== 1 (clojure.lang.Numbers/and ~n, 1)) )}
>   [^long n]
>   (== 1 (clojure.lang.Numbers/and n, 1)))
> 
> (defn exp-int
>   ^double [^double x, ^long c]
>   (loop [result 1.0, factor x, c c]
> (if (> c 0)
> (recur 
>  (if (first-bit? c)
>(* result factor)
>result),
>  (* factor factor),
>  (bit-shift-right c 1))
>   result)))
> 
> Last lines of the Java bytecode of `exp-int`:
> 59 dload 5;   /* result */
> 61 invokestatic 40;   /* java.lang.Double java.lang.Double.valueOf(double 
> c) */
> 64 checkcast 85;  /* java.lang.Number */
> 67 invokevirtual 89;  /* double doubleValue() */
> 70 dreturn;

-- 
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: defpromise?

2012-11-20 Thread Moritz Ulrich



Jim foo.bar writes:

> I was just wondering...we have a 'defsomething' macro for almost 
> everything...

For everything? 

> How come there is no 'defpromise'? It is very easy to write one and 
> since we always initialize promises like this: (def x (promise)), I 
> don't see any reason why not...
>
> (defmacro defpromise [name]
>`(def ~name (promise)))
>
> Jim

How often do you need a top-level promise? Where are the advantages over
the def-only example?


-- 
Moritz Ulrich


pgpFttgbpDvnz.pgp
Description: PGP signature


Re: Sorted Sets With Duplicate Elements

2012-11-20 Thread Andy Fingerhut
I would be surprised if you are still happy with that solution a few minutes 
after doing some testing with it.

I've added some examples to ClojureDocs.org at the link below, with a suggested 
better comparison function.  Take a look and let me know if it seems clear:

http://clojuredocs.org/clojure_core/clojure.core/sorted-set-by

I've written some text explaining why the simpler comparison functions fail, 
but it is over 100 lines long right now and I should trim it down or find a 
different place for it than ClojureDocs.org.

Andy

On Nov 20, 2012, at 8:01 AM, JvJ wrote:

> Simple solution.  It works!  Thanks.
> 
> On Tuesday, 20 November 2012 10:59:23 UTC-5, Bronsa wrote:
> what about using <= as sorting fuction?
> 
> 2012/11/20 JvJ 
> First of all:  I don't EXACTLY mean duplicate elements.  I just mean 
> duplicates in those parts of the elements which are compared.
> 
> For instance, I recently tried to have a sorted set of 2-element vectors 
> where the comparator < was used on the second element, however, something 
> like this happened:
> 
> (sorted-set-by #(< (second %) (second %2))
> [:a 1]
> [:b 1]
> [:c 1])
> 
> ==> #{[:a 1]}
> 
> 
> Does anyone know how I could have a set that includes all of these elements?

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

Efficiency of Dijkstra's algorithm

2012-11-20 Thread JvJ
I've just implemented Dijkstra's algorithm, and as far as I can tell, it 
works.

However, I'm a little concerned at the efficiency.  Specifically, I am 
using sorted sets, and I can't break apart the set into first/next and keep 
it as a set.  I have to get next as a sequence and then apply sorted-set-by 
to that sequence.  This seems like a lot of wasted time.  Is there a better 
way, or is it not a problem?

Thanks.

;;; The dijkstra's algorithm values look like this!
;;; [end-node [path path-weight]]
;;; [:A [[] 0]]
;;; [:B [[:A :B] 3]]
;;; [:C [[:A :B :C] 5]]
(defn d-comp
  "The comparator for Dijkstra's algorithm!"
  [[_ [_ a]] [_ [_ b]]]
  (<= a b))

(defn dijkstra
  "Computes a shortest-path tree starting at the specified node."
  [graph start-node]
  (loop [acc {}
 q (sorted-set-by d-comp [start-node [[start-node] 0]])]
;; Loop until the queue is empty, then return the accumulator
(if (empty? q)
  acc
  (let [;; Destructure the first element of the queue
[cur-node [cur-path cur-sum]] (first q)

;; Add the first element to the accumulator map
new-acc (conj acc (first q))

;; Pop the first element of the queue
new-q (apply sorted-set-by d-comp (next q)) ;See?  Can't just 
dequeue the first of the set!

;; Get outgoint links from the current node
;; Only those that either aren't in the accumulator,
;; or which have a shorter path than the accumulator's
;; entry.
links (for [[n w] (graph cur-node)
 :when (or (not (acc n))
   (< (+ cur-sum w)
  (second (acc n]
[n [(conj cur-path n)
(+ cur-sum w)]])

;; Get the set of nodes from the links
l-nodes (set (map first links))

;; Filter out the obsolete queue entries.  Now,
;; we have better paths.
new-q (apply sorted-set-by d-comp
 (filter #(not (l-nodes (first %))) new-q))

;; Combine the queue and the links
new-q (reduce conj new-q links)]

;; Recur on the new values!
(recur new-acc
   new-q)

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

Re: [ANN] clj-xpath 1.3.3

2012-11-20 Thread Terje Norderhaug
On Tue, Nov 20, 2012 at 9:07 AM, Phil Hagelberg  wrote:
> However, the likelihood that anyone else will come along in the future
> and name another library clj-xpath is basically nil in this case.

For standards/recommendations like xpath it would be preferable to
avoid that the first Clojure implementation coming along gets to
monopolize the name. In fact, I've been thinking for a while about
implementing an xpath library for Clojure, talking a different
approach than Kyle, as I've implemented XPath in the past in Common
Lisp as part of an XSLT processor/compiler used in my commercial
products. So I second the use of a group-id for clojure libraries that
use the name of a standard/recommendation in their name.

-- Terje Norderhaug

-- 
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: Efficiency of Dijkstra's algorithm

2012-11-20 Thread Andy Fingerhut
Have you tried using first to get the smallest item from the set, and then 
create a new sorted set with the item remove by using (disj my-sorted-set item) 
?

Andy

On Nov 20, 2012, at 9:46 AM, JvJ wrote:

> I've just implemented Dijkstra's algorithm, and as far as I can tell, it 
> works.
> 
> However, I'm a little concerned at the efficiency.  Specifically, I am using 
> sorted sets, and I can't break apart the set into first/next and keep it as a 
> set.  I have to get next as a sequence and then apply sorted-set-by to that 
> sequence.  This seems like a lot of wasted time.  Is there a better way, or 
> is it not a 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: Efficiency of Dijkstra's algorithm

2012-11-20 Thread JvJ
I actually did try that, but somehow disj wasn't working properly.

user> (def test-set (sorted-set-by msinterview/d-comp [:A [[:A] 0]] [:B 
[[:A :B] 10]]))
#'user/test-set
user> test-set
#{[:A [[:A] 0]] [:B [[:A :B] 10]]}
user> (disj test-set (first test-set))
#{[:A [[:A] 0]] [:B [[:A :B] 10]]}

On Tuesday, 20 November 2012 12:50:21 UTC-5, Andy Fingerhut wrote:
>
> Have you tried using first to get the smallest item from the set, and then 
> create a new sorted set with the item remove by using (disj my-sorted-set 
> item) ? 
>
> Andy 
>
> On Nov 20, 2012, at 9:46 AM, JvJ wrote: 
>
> > I've just implemented Dijkstra's algorithm, and as far as I can tell, it 
> works. 
> > 
> > However, I'm a little concerned at the efficiency.  Specifically, I am 
> using sorted sets, and I can't break apart the set into first/next and keep 
> it as a set.  I have to get next as a sequence and then apply sorted-set-by 
> to that sequence.  This seems like a lot of wasted time.  Is there a better 
> way, or is it not a 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: proposal to exclude some cljs source from being compiled

2012-11-20 Thread David Nolen
Great. Be sure to send your CA if you haven't already.

This should be a fairly simple patch to closure.clj.

David


On Tue, Nov 20, 2012 at 11:20 AM, Giacomo Cosenza
wrote:

> Hi David,
> I'll work on it next days.
>
> Thanks
> mimmo
>
>
> On Nov 20, 2012, at 5:06 PM, David Nolen wrote:
>
> If someone creates a patch for this I'll happily apply it.
>
>
> On Tue, Nov 20, 2012 at 7:29 AM, Giacomo Cosenza 
> wrote:
>
>> Hi all,
>> I'd like to add a new feature to both cljsbuild and clojurescript to
>> allow the exclusion of some cljs source from being compiled. the motivation
>> of this feature can be found at tthe following links:
>>
>> -
>> https://github.com/magomimmo/modern-cljs/blob/master/doc/tutorial-07.md#get-in-trouble
>> - https://github.com/emezeske/lein-cljsbuild/issues/157
>> - http://dev.clojure.org/jira/browse/CLJS-419
>>
>> My proposal is the following:
>>
>> - add a new compilation option named :exclude to the regular optimization
>> options map. Its value can be a cljs file or a path (that has to be a
>> subdir of source-dir).
>> - add the same option to the underlying cljs compiler.
>>
>> cljsbuild example:
>>
>> (defproject ...
>> ...
>>   :cljsbuild {:builds
>>   {
>>:dev
>>{
>> :source-path "src/cljs"
>> :compiler {
>>:output-to "resources/public/js/main_dbg.js"
>>:optimizations :whitespace
>>:pretty-print true}}
>>:prod
>>{:source-path "src/cljs"
>> :compiler {
>>:exclude "exlude" ;; exclude a cljs
>> source-dir. or "path/to/filename.cljs" to exclude a single file
>>:output-to "resources/public/js/modern.js"
>>; advanced optimization
>>:optimizations :advanced)
>>
>> From cljsc point of view, the call could be
>>
>> $ cljsc "src/cljs" {:exclude "exclude" :optimizations :advanced...
>>
>> Is it something useful to you too?
>>
>> My best
>>
>> Mimmo
>>
>> --
>> 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
>

-- 
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: A Simple FeedForward NeuralNetwork (using BackPropagation)

2012-11-20 Thread Timothy Washington
Nice. I'm gonna check out the Weka resources, and Russell and Norvig LISP
programs. This is just what I'm looking for.

And that Stanford
resourceI
mentioned, is part of the Coursera regimen. So It sounds like I'm on
the
right course.


Thanks all. This helps.
Tim


On Tue, Nov 20, 2012 at 7:25 AM, Goldritter <
marcus.goldritter.lind...@gmail.com> wrote:

> Here is a link to the LISP programs used in "Artificial Intelligence: A
> Modern Approach" by  Stuart Russell and Peter Norvig.
> There is also an example for a Neural Net. I hope this might help.
>
> http://aima.cs.berkeley.edu/lisp/doc/overview.html
>
>

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

Re: defpromise?

2012-11-20 Thread Jim - FooBar();

On 20/11/12 17:45, Moritz Ulrich wrote:

How often do you need a top-level promise? Where are the advantages over
the def-only example?


if you consider (defn x...) to have an advantage over (def x (fn...)), 
then this is the same case...People don't often need top-level promises 
but sometimes they do...anyway, I was just wondering...


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


Run Counterclockwise nREPL on specific port

2012-11-20 Thread Vladimir Tsichevski
Hi,

I've started a nREPL process embedded into some Java application. I can 
successfully connect to it and execute code remotely from other Clojure 
process.

Now I need a client to provide me interactive REPL session. Since I use 
Counterclockwise, can I force Counterclockwise not to start a Closure 
project, but connect to a remote application already listening at some 
known port?

Regards,
Vladimir

-- 
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: More ClojureScript questions....

2012-11-20 Thread David Nolen
(let [opts (js/Object.)]
  (set! (.-onSuccess opts) (fn [] (js/console.log "Successful Connect"))
  (set! (.-onFailure opts) (fn [] (js/console.log "failure Connect"))
  (.connect client opts))

Is what you want. You weren't setting those properties as your were in JS.
Honestly I'd probably write it more like this:

(.connect client
  (js-obj
 "onSuccess" (fn [] (js/console.log "Success!"))
 "onFailure" (fn [] (js/console.log "Failure!"

or

(let [opts (js-obj
  "onSuccess" (fn [] (js/console.log "Success!"))
  "onFailure" (fn [] (js/console.log "Failure!")))]
  (.connect client opts))



On Tue, Nov 20, 2012 at 11:49 AM, Thomas  wrote:

> At the moment I have this:
>
>  (let [ client (js/Client. )
>  connectOptions (new js/Object) ]
>(.onSuccess connectOptions ) (fn [] (js/console.log "Successful
> Connect"))
>(.onFailure connectOptions ) (fn [] (js/console.log "failure
> Connect")))
>
> If you need any more info please let me know.
>
> Thomas
>
> On Tuesday, November 20, 2012 4:07:12 PM UTC, David Nolen wrote:
>
>> What does your ClojureScript code look like?
>>
>>
>> On Tue, Nov 20, 2012 at 5:47 AM, Thomas  wrote:
>>
>>> Hi,
>>>
>>> I am trying to use an existing JS library from CLJS and in JS one needs
>>> to define some call back functions in the following way. Assuming you have
>>> written some functions "foo" and "bar" and you have created a client called
>>> "client", you can do:
>>> var options = new Object();
>>> options.onSuccess = foo;
>>> options.onFailure = bar;
>>> client.connect(options);
>>>
>>> What would be the equivalent in CLJS? When I create a new Object I get
>>> the following error when I try and run the code:
>>>
>>> Uncaught TypeError: Object # has no method 'onSuccess'
>>>
>>> Which is of course not that surprising... But how to do this properly in
>>> CLJS?
>>>
>>> TIA
>>> Thomas
>>>
>>> --
>>> 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
>

-- 
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: defpromise?

2012-11-20 Thread Duncan McGreggor


On Tuesday, November 20, 2012 9:13:03 AM UTC-8, Jim foo.bar wrote:
>
> I was just wondering...we have a 'defsomething' macro for almost 
> everything... 
>
> How come there is no 'defpromise'? It is very easy to write one and 
> since we always initialize promises like this: (def x (promise)), I 
> don't see any reason why not... 
>
> (defmacro defpromise [name] 
>`(def ~name (promise))) 
>
> Jim 
>

You might want to check this out:
  https://github.com/ztellman/lamina/wiki/Introduction

Promises and Futures are implemented differently pretty much everywhere you 
look, so his approach may or may not meet your needs/expectations.

Regardless, Zach's been doing some brilliant work that some of us from the 
Twisted (Python) community have been keeping an eye on. Good stuff.  

d

-- 
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: defpromise?

2012-11-20 Thread Duncan McGreggor
On Tue, Nov 20, 2012 at 9:12 AM, Jim foo.bar  wrote:

> I was just wondering...we have a 'defsomething' macro for almost
> everything...
>
> How come there is no 'defpromise'? It is very easy to write one and since
> we always initialize promises like this: (def x (promise)), I don't see any
> reason why not...
>
> (defmacro defpromise [name]
>   `(def ~name (promise)))
>
> Jim
>

You might want to check this out:
  https://github.com/ztellman/lamina/wiki/Introduction

Promises and Futures are implemented differently pretty much everywhere you
look, so his approach may or may not meet your needs/expectations.

Regardless, Zach's been doing some brilliant work that some of us from the
Twisted (Python) community have been keeping an eye on. Good stuff.

d

-- 
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: Run Counterclockwise nREPL on specific port

2012-11-20 Thread Jim - FooBar();

On 20/11/12 18:08, Vladimir Tsichevski wrote:
I've started a nREPL process embedded into some Java application. I 
can successfully connect to it and execute code remotely from other 
Clojure process.


I'd be very interested if you could share some code...I want to do 
something similar in one of my projects...


Now I need a client to provide me interactive REPL session. Since I 
use Counterclockwise, can I force Counterclockwise not to start a 
Closure project, but connect to a remote application already listening 
at some known port?


CCW has a 'connect to repl' option under  'Window'. It asks doe an IP 
and a port number...is this what you're looking for?


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: Sorted Sets With Duplicate Elements

2012-11-20 Thread Mark Engelberg
On Tue, Nov 20, 2012 at 8:01 AM, JvJ  wrote:

> Simple solution.  It works!  Thanks.
>

No, it doesn't work.  It may print correctly now, but it won't actually
behave the way you expect.

Clojure's sorted collections must be provided with a sorting function where
items "tie" if and only if they are equal.

(sorted-set-by #(compare [(second %) %] [(second %2) %2]) [:a 1] [:b 1] [:c
1]))

Your use case makes me think you might actually want to investigate
clojure.data.priority-map though:
https://github.com/clojure/data.priority-map
If that's a better fit for what you are trying to do, just insert
[org.clojure/data.priority-map "0.0.2"] into your project.clj dependencies.

-- 
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: Efficiency of Dijkstra's algorithm

2012-11-20 Thread Mark Engelberg
I just responded in your other thread, suggesting you look at
priority-map.  Now that I see this thread, I can tell you that priority-map
is definitely what you want rather than sorted sets -- I created it
specifically for that kind of algorithm.

Check out: http://clj-me.cgrand.net/2010/09/04/a-in-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: Efficiency of Dijkstra's algorithm

2012-11-20 Thread Andy Fingerhut
Perhaps because you are still using a bad comparison function when constructing 
the sorted-set?

(see reply on other thread)

That said, Mark's suggestion of a using a priority queue is also a good one.

Andy

On Nov 20, 2012, at 9:57 AM, JvJ wrote:

> I actually did try that, but somehow disj wasn't working properly.
> 
> user> (def test-set (sorted-set-by msinterview/d-comp [:A [[:A] 0]] [:B [[:A 
> :B] 10]]))
> #'user/test-set
> user> test-set
> #{[:A [[:A] 0]] [:B [[:A :B] 10]]}
> user> (disj test-set (first test-set))
> #{[:A [[:A] 0]] [:B [[:A :B] 10]]}
> 
> On Tuesday, 20 November 2012 12:50:21 UTC-5, Andy Fingerhut wrote:
> Have you tried using first to get the smallest item from the set, and then 
> create a new sorted set with the item remove by using (disj my-sorted-set 
> item) ? 
> 
> Andy 
> 
> On Nov 20, 2012, at 9:46 AM, JvJ wrote: 
> 
> > I've just implemented Dijkstra's algorithm, and as far as I can tell, it 
> > works. 
> > 
> > However, I'm a little concerned at the efficiency.  Specifically, I am 
> > using sorted sets, and I can't break apart the set into first/next and keep 
> > it as a set.  I have to get next as a sequence and then apply sorted-set-by 
> > to that sequence.  This seems like a lot of wasted time.  Is there a better 
> > way, or is it not a 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: Sorted Sets With Duplicate Elements

2012-11-20 Thread JvJ
Thanks for the tip.

On Tuesday, 20 November 2012 13:13:09 UTC-5, puzzler wrote:
>
> On Tue, Nov 20, 2012 at 8:01 AM, JvJ >wrote:
>
>> Simple solution.  It works!  Thanks.
>>
>
> No, it doesn't work.  It may print correctly now, but it won't actually 
> behave the way you expect.
>
> Clojure's sorted collections must be provided with a sorting function 
> where items "tie" if and only if they are equal. 
>
> (sorted-set-by #(compare [(second %) %] [(second %2) %2]) [:a 1] [:b 1] 
> [:c 1]))
>
> Your use case makes me think you might actually want to investigate 
> clojure.data.priority-map though:
> https://github.com/clojure/data.priority-map
> If that's a better fit for what you are trying to do, just insert 
> [org.clojure/data.priority-map "0.0.2"] into your project.clj dependencies.
>

-- 
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: Efficiency of Dijkstra's algorithm

2012-11-20 Thread JvJ
I'll look into this.  Actually, I was thinking of implementing A* as well, 
so thanks!

On Tuesday, 20 November 2012 13:18:08 UTC-5, puzzler wrote:
>
> I just responded in your other thread, suggesting you look at 
> priority-map.  Now that I see this thread, I can tell you that priority-map 
> is definitely what you want rather than sorted sets -- I created it 
> specifically for that kind of algorithm.
>
> Check out: http://clj-me.cgrand.net/2010/09/04/a-in-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: Sorted Sets With Duplicate Elements

2012-11-20 Thread Andy Fingerhut

On Nov 20, 2012, at 10:12 AM, Mark Engelberg wrote:

> Clojure's sorted collections must be provided with a sorting function where 
> items "tie" if and only if they are equal. 
> 
> (sorted-set-by #(compare [(second %) %] [(second %2) %2]) [:a 1] [:b 1] [:c 
> 1]))

Mark, I like the brevity of this way of writing comparison functions with tie 
breakers, and see that it would extend well to multiple sort keys, and 
ascending or descending order on each key can be chosen independently.

My question is perhaps of the 
is-the-number-of-angels-that-can-dance-on-the-head-of-a-pin-finite-or-infinite 
kind.

Does Clojure promise anywhere in its documentation that it compares vectors and 
sequences in lexicographic order?

I know the implementation does in fact do this today, and probably has since 
compare was implemented for vectors, and there is no good reason I know of that 
it might ever change.  For most purposes, I'd say that is good enough to run 
with it and tell the whole world.

The only nagging doubt is relying on undocumented behavior.  I guess my real 
question is: "Would it be good for Clojure to document and promise this 
comparison behavior?"

Andy

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


Will the upcoming Clojure 1.5 stuff be available in Clojurescript too?

2012-11-20 Thread László Török
Hi,

I understand that the development of Clojure and Clojurescript is being
managed separately which makes sense.

However, I also noticed that there has been considerable effort to maintain
some level of compatibility between the two. There is some nice stuff
coming in Clojure 1.5 in core and I was wondering whether that will become
available in Clojurescript as soon as 1.5 is baked.

Las


-- 
László Török

-- 
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: Will the upcoming Clojure 1.5 stuff be available in Clojurescript too?

2012-11-20 Thread David Nolen
I think ClojureScript will be pretty closely tied to Clojure development
for the foreseeable future. 1.5.0 has column data which is critical for
accurate source mapping for example.

Feature Expressions can't come soon enough, fingers crossed for 1.6.0.


On Tue, Nov 20, 2012 at 1:39 PM, László Török  wrote:

> Hi,
>
> I understand that the development of Clojure and Clojurescript is being
> managed separately which makes sense.
>
> However, I also noticed that there has been considerable effort to
> maintain some level of compatibility between the two. There is some nice
> stuff coming in Clojure 1.5 in core and I was wondering whether that will
> become available in Clojurescript as soon as 1.5 is baked.
>
> Las
>
>
> --
> László Török
>
>  --
> 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: Sorted Sets With Duplicate Elements

2012-11-20 Thread Alan Malloy


On Tuesday, November 20, 2012 10:29:18 AM UTC-8, Andy Fingerhut wrote:
>
>
> On Nov 20, 2012, at 10:12 AM, Mark Engelberg wrote: 
>
> > Clojure's sorted collections must be provided with a sorting function 
> where items "tie" if and only if they are equal. 
> > 
> > (sorted-set-by #(compare [(second %) %] [(second %2) %2]) [:a 1] [:b 1] 
> [:c 1])) 
>
> Mark, I like the brevity of this way of writing comparison functions with 
> tie breakers, and see that it would extend well to multiple sort keys, and 
> ascending or descending order on each key can be chosen independently. 
>
> My question is perhaps of the 
> is-the-number-of-angels-that-can-dance-on-the-head-of-a-pin-finite-or-infinite
>  
> kind. 
>
> Does Clojure promise anywhere in its documentation that it compares 
> vectors and sequences in lexicographic order? 
>
>
I hope not, because that's not what it does! Sequences don't implement 
Comparable at all, so unless you supply a comparator they can't be sorted. 
And vectors are compared first by length; only if they have the same length 
are their elements considered for a lexicographical comparison. 

-- 
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: Sorted Sets With Duplicate Elements

2012-11-20 Thread Andy Fingerhut

On Nov 20, 2012, at 11:04 AM, Alan Malloy wrote:

> On Tuesday, November 20, 2012 10:29:18 AM UTC-8, Andy Fingerhut wrote:
> 
> On Nov 20, 2012, at 10:12 AM, Mark Engelberg wrote: 
> 
> > Clojure's sorted collections must be provided with a sorting function where 
> > items "tie" if and only if they are equal. 
> > 
> > (sorted-set-by #(compare [(second %) %] [(second %2) %2]) [:a 1] [:b 1] [:c 
> > 1])) 
> 
> Mark, I like the brevity of this way of writing comparison functions with tie 
> breakers, and see that it would extend well to multiple sort keys, and 
> ascending or descending order on each key can be chosen independently. 
> 
> My question is perhaps of the 
> is-the-number-of-angels-that-can-dance-on-the-head-of-a-pin-finite-or-infinite
>  kind. 
> 
> Does Clojure promise anywhere in its documentation that it compares vectors 
> and sequences in lexicographic order? 
> 
> 
> I hope not, because that's not what it does! Sequences don't implement 
> Comparable at all, so unless you supply a comparator they can't be sorted. 
> And vectors are compared first by length; only if they have the same length 
> are their elements considered for a lexicographical comparison. 

Thanks for the corrections.

Then my question is still: "Would it be good for Clojure to document and 
promise this comparison behavior?"

If not for all cases, at least for equal-length vectors being compared 
lexicographically?

Andy


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

printing for non-human consumption but want *read-eval* false

2012-11-20 Thread Jim - FooBar();
Until recently I was using the following snippet for writing a map on a 
file...basically I was using spit/slurp. Nothing easier



(defn data->string
"Writes the object b on a file f on disk as a string."
[b fname]
(io!  (spit fname b)))

(defn string->data
"Read the file f back on memory safely (#=  forbidden). Contents of f 
should be a clojure data-structure."

[fname]
(io!
 (binding [*read-eval* false]
 (read-string (slurp fname)


However apparently this is not the way to goone has to use 'pr' if 
it is not intended for humans to read, right?


(defn data->string
"Writes the clojure data-structure b on a file f on disk as a string."
[b f]
(io!
(with-open [w (clojure.java.io/writer f)]
  (binding [*out* w *print-dup* true]
(pr b)

what to do though, if I want to keep *read-eval* bound to false when 
reading back? Printing using 'pr' does not  emit literals but their ctor 
funtions instead...I do not want to give to the 'user' the ability to 
pass in arbitrary code...just clojure maps, vectors, lists etc.


what am I missing? the orginal slurp/spit approach works just fine and 
it doesn't allow #=, exxactly how I want it. Why is it wrong?


thanks in advance...

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: [ANN] clj-xpath 1.3.3

2012-11-20 Thread John Gabriele
On Tuesday, November 20, 2012 12:47:49 PM UTC-5, Terje Norderhaug wrote:
>
> On Tue, Nov 20, 2012 at 9:07 AM, Phil Hagelberg 
> > 
> wrote: 
> > However, the likelihood that anyone else will come along in the future 
> > and name another library clj-xpath is basically nil in this case. 
>
> For standards/recommendations like xpath it would be preferable to 
> avoid that the first Clojure implementation coming along gets to 
> monopolize the name. In fact, I've been thinking for a while about 
> implementing an xpath library for Clojure, talking a different 
> approach than Kyle, as I've implemented XPath in the past in Common 
> Lisp as part of an XSLT processor/compiler used in my commercial 
> products. So I second the use of a group-id for clojure libraries that 
> use the name of a standard/recommendation in their name. 
>
>
Aside: perhaps you could instead use some other unique name for your 
project. Like xpathfinder or xml-strider or something?

---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: printing for non-human consumption but want *read-eval* false

2012-11-20 Thread Stuart Sierra
*print-dup* tries to preserve type information. That's why it emits 
constructor functions with #=.

You can still use 'pr' with *print-dup* set to false, which is the default. 
You get machine-readable data of the correct abstract type, e.g. 
list/vector/map/set, but you lose type information like whether it's a 
hash-map or a sorted-map.

-S

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

Re: [ANN] new book: "ClojureScript: Up and Running"

2012-11-20 Thread Stuart Sierra
`lein trampoline` was required to permit the CLJS REPL process to grab 
STDIN/STDOUT. According to a recent thread on the Leiningen mailing list, 
this may have been fixed in the Git master branch of Leiningen.

-S

-- 
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: printing for non-human consumption but want *read-eval* false

2012-11-20 Thread Jim - FooBar();

aaa ok I see...
so I can have my cake and eat it too? :-)

I'm just surprised cos slurp/spit has never failed me before and I've 
tried with maps, vectors & lists but everyone is suggesting it is wrong 
practice...


anyway, thanks for taking the time...

Jim


On 20/11/12 19:58, Stuart Sierra wrote:
*print-dup* tries to preserve type information. That's why it emits 
constructor functions with #=.


You can still use 'pr' with *print-dup* set to false, which is the 
default. You get machine-readable data of the correct abstract type, 
e.g. list/vector/map/set, but you lose type information like whether 
it's a hash-map or a sorted-map.


-S

--
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: Idiomatic equivalent for double dispatch in clojure?

2012-11-20 Thread Brian Marick

On Nov 20, 2012, at 10:22 AM, Thomas Goossens wrote:

> I think it is a bit dull that for every combination [type1 type2] you have to 
> define an equivalent method for  [type2 type1]
> 
> Is there a way to address this problem? perhaps with sets? 


According to http://clojure.org/multimethods only vectors work if you want to 
have a type hierarchy. I wish sets worked, but then you'd have to also have 
some sort of destructuring mechanism to bind the parameters.

-
Brian Marick, Artisanal Labrador
Contract programming in Ruby and Clojure
Occasional consulting on Agile
Writing /Functional Programming for the Object-Oriented Programmer/: 
https://leanpub.com/fp-oo


-- 
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: Run Counterclockwise nREPL on specific port

2012-11-20 Thread Vladimir Tsichevski
Hi Jim,

On Tuesday, November 20, 2012 10:13:02 PM UTC+4, Jim foo.bar wrote:
>
> On 20/11/12 18:08, Vladimir Tsichevski wrote: 
> > I've started a nREPL process embedded into some Java application. I 
> > can successfully connect to it and execute code remotely from other 
> > Clojure process. 
>
> I'd be very interested if you could share some code...I want to do 
> something similar in one of my projects... 
>
Not much of code at the moment, mostly taken from an example on nREPL 
project page:

 String str = "(use '[clojure.tools.nrepl.server :only (start-server 
stop-server)])(defonce server (start-server :port 7888))";
 Compiler.load(new StringReader(text));


> > Now I need a client to provide me interactive REPL session. Since I 
> > use Counterclockwise, can I force Counterclockwise not to start a 
> > Closure project, but connect to a remote application already listening 
> > at some known port? 
>
> CCW has a 'connect to repl' option under  'Window'. It asks doe an IP 
> and a port number...is this what you're looking for? 
>
Exactly! The menu location is quite unusual for Eclipse :-(

>
> 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: Idiomatic equivalent for double dispatch in clojure?

2012-11-20 Thread Thomas Goossens
Then probably something like this will help me out


(defn defmutualmethods [multifn dispatch-val & fn-tail]
(defmethod multifn dispatch-val fn-tail)
(defmethod multifn (reverse dispatch-val) fn-tail))


Nevertheless i'm making things more complex now because it does two things 
now! But it will make it easier for me i guess.

its just a thought


On Tuesday, November 20, 2012 9:19:23 PM UTC+1, Brian Marick wrote:
>
>
> On Nov 20, 2012, at 10:22 AM, Thomas Goossens wrote: 
>
> > I think it is a bit dull that for every combination [type1 type2] you 
> have to define an equivalent method for  [type2 type1] 
> > 
> > Is there a way to address this problem? perhaps with sets? 
>
>
> According to http://clojure.org/multimethods only vectors work if you 
> want to have a type hierarchy. I wish sets worked, but then you'd have to 
> also have some sort of destructuring mechanism to bind the parameters. 
>
> - 
> Brian Marick, Artisanal Labrador 
> Contract programming in Ruby and Clojure 
> Occasional consulting on Agile 
> Writing /Functional Programming for the Object-Oriented Programmer/: 
> https://leanpub.com/fp-oo 
>
>
>

-- 
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: Primitive function boxes and unboxes result value

2012-11-20 Thread Christophe Grand
I think CLJ-701 is about loop in non-terminal position.


On Tue, Nov 20, 2012 at 6:30 PM, Andy Fingerhut wrote:

> Any relationship to CLJ-701, other than similar symptoms?
>
> http://dev.clojure.org/jira/browse/CLJ-701
>
> Andy
>
> On Nov 20, 2012, at 9:15 AM, Christophe Grand wrote:
>
> Hi,
>
> It looks like, because of the recur, the compiler fails to notice that if
> returns a primitive.
> As far as I understand in Compiler.java, RecurExpr does not implement
> MaybePrimitiveExpr and thus causes on canEmitPrimitive the surrounding
> IfExpr to return false.
>
> Someone to confirm this analysis?
>
>
> On Tue, Nov 20, 2012 at 4:34 PM, Gunnar Völkel <
> gunnar.voel...@googlemail.com> wrote:
>
>> I have written a primitive function for exponentiation with integers as
>> power using the multiply-and-square algorithm.
>> For performance reasons I used primitive type hints for the arguments and
>> the return value.
>> Profiling the whole application I noticed that there are a lot of
>> java.lang.Double/valueOf calls.
>> Looking at the bytecode I see that in Clojure 1.3 as well as in Clojure
>> 1.4 the result value gets boxed and unboxed like
>> Double.valueOf(result).doubleValue().
>>
>> Am I doing something wrong? Is there a serious bug related to the support
>> of primitive functions?
>>
>> The source code:
>>
>> (defn first-bit?
>>   {:inline (fn [n] `(== 1 (clojure.lang.Numbers/and ~n, 1)) )}
>>   [^long n]
>>   (== 1 (clojure.lang.Numbers/and n, 1)))
>>
>> (defn exp-int
>>   ^double [^double x, ^long c]
>>   (loop [result 1.0, factor x, c c]
>> (if (> c 0)
>> (recur
>>  (if (first-bit? c)
>>(* result factor)
>>result),
>>  (* factor factor),
>>  (bit-shift-right c 1))
>>   result)))
>>
>> Last lines of the Java bytecode of `exp-int`:
>> 59 dload 5;   /* result */
>> 61 invokestatic 40;   /* java.lang.Double
>> java.lang.Double.valueOf(double c) */
>> 64 checkcast 85;  /* java.lang.Number */
>> 67 invokevirtual 89;  /* double doubleValue() */
>> 70 dreturn;
>>
>
>  --
> 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
>



-- 
Professional: http://cgrand.net/ (fr)
On Clojure: http://clj-me.cgrand.net/ (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: Sorted Sets With Duplicate Elements

2012-11-20 Thread Mark Engelberg
On Tue, Nov 20, 2012 at 11:08 AM, Andy Fingerhut
wrote:

>
> Then my question is still: "Would it be good for Clojure to document and
> promise this comparison behavior?"
>
> If not for all cases, at least for equal-length vectors being compared
> lexicographically?
>
>
I frequently rely on Clojure's behavior that equal-length vectors are
compared lexicographically, so I certainly hope that this is an implicit
promise, but I don't know that I've seen it documented anywhere.

I've thought about how it would be nice to have a library with several
useful comparators for complex objects.  For example:

1. True lexicographic comparison for all sequences (both vectors and lists).
Right now, lists can't be compared.  Vectors compare by length first.

2. Something that can compare all possible Clojure objects in an arbitrary
but consistent way.
There are a lot of times where you just want distinct objects to have some
sort of tiebreaker so that sorting will work, but you don't really care
what order tied items end up in.  For example, I may want to create a
sorted collection out of [[1 :a] [2 :b] [1 "c"]] in a way that guarantees
that the 1 entries are before the 2 entry, but I don't really care about
the exact order of the 1 entries.  Several other languages handle this by
ensuring that all objects can be compared, I think Python is an example of
this.  This way the trick I showed of (sort-by #(compare
[(attribute-I-care-about %) %] [(attribute-I-care-about %2) %2)]) ...) will
always work.


Haven't gotten around to implementing said library, although I probably
should since I seem to end up re-implementing bits and pieces of these
ideas in my own code all the time.

-- 
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: Run Counterclockwise nREPL on specific port

2012-11-20 Thread Laurent PETIT
2012/11/20 Vladimir Tsichevski 

> Hi Jim,
>
>
> On Tuesday, November 20, 2012 10:13:02 PM UTC+4, Jim foo.bar wrote:
>>
>> On 20/11/12 18:08, Vladimir Tsichevski wrote:
>> > I've started a nREPL process embedded into some Java application. I
>> > can successfully connect to it and execute code remotely from other
>> > Clojure process.
>>
>> I'd be very interested if you could share some code...I want to do
>> something similar in one of my projects...
>>
> Not much of code at the moment, mostly taken from an example on nREPL
> project page:
>
>  String str = "(use '[clojure.tools.nrepl.server :only (start-server
> stop-server)])(defonce server (start-server :port 7888))";
>  Compiler.load(new StringReader(text));
>
>
>> > Now I need a client to provide me interactive REPL session. Since I
>> > use Counterclockwise, can I force Counterclockwise not to start a
>> > Closure project, but connect to a remote application already listening
>> > at some known port?
>>
>> CCW has a 'connect to repl' option under  'Window'. It asks doe an IP
>> and a port number...is this what you're looking for?
>>
> Exactly! The menu location is quite unusual for Eclipse :-(
>

Hi,

Quite right. What would you have expected it to be under?


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

-- 
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: Run Counterclockwise nREPL on specific port

2012-11-20 Thread Chas Emerick
On Nov 20, 2012, at 3:22 PM, Vladimir Tsichevski wrote:

> CCW has a 'connect to repl' option under  'Window'. It asks doe an IP 
> and a port number...is this what you're looking for? 
> Exactly! The menu location is quite unusual for Eclipse :-(

Heh, this one's on me; I put it in the Window menu.  I honestly couldn't find a 
good place for it.  Eclipse is deeply wedded to operations being related to a 
project, so this project-insensitive operation didn't naturally slot in 
anywhere.  Suggestions welcome, of course.

- Chas

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

Re: Run Counterclockwise nREPL on specific port

2012-11-20 Thread Laurent PETIT
2012/11/20 Chas Emerick 

> On Nov 20, 2012, at 3:22 PM, Vladimir Tsichevski wrote:
>
> CCW has a 'connect to repl' option under  'Window'. It asks doe an IP
>> and a port number...is this what you're looking for?
>>
> Exactly! The menu location is quite unusual for Eclipse :-(
>
>
> Heh, this one's on me; I put it in the Window menu.  I honestly couldn't
> find a good place for it.  Eclipse is deeply wedded to operations being
> related to a project, so this project-insensitive operation didn't
> naturally slot in anywhere.  Suggestions welcome, of course.
>

If it belongs to a top menu, then let's try them in turn:

File: no, though idiomatic usage of it by other apps suggest that it's a
"throw misc things in" sort of menu :-)
Editor: no
Source: no
Refactor: no
Navigate: no
Search: no
Project: no, since it's not inherently contextual to a project (unless
we're connected to a remote server whose source code is in the project ?)
Run: Actually, maybe this makes sense, isn't this a bit like the "remote
connection java launcher" ? Several remotes could be saved in different
launch configurations. Some other configuration options could come up
quickly, like "things to prepend on each launch - via a potential
additional op to nrepl", etc. This would require creating a specific kind
of launch configuration.
Window: current. Not bad once you know where it is, hard to guess at first
Help: no





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

-- 
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: syntax for defrecord literals and tagged literals

2012-11-20 Thread Steve Miner
CLJ-1100 "Reader literals cannot contain periods" has a patch that will allow 
tags to have periods. It does not address the issue of allowing a space after 
the record type for record literals.

My patch for CLJ-1100 would also allow *default-readers* to override a 
defrecord definition.  That's   wasn't explicitly the intention, but it fell 
out of the implementation.  If people don't like letting *default-readers* 
dominate records, please comment in the bug.  I think it's acceptable in order 
to support the desired periods in tags, but it might be good to have some other 
people take a look.

Regarding the original issue for this thread, it's interesting to note that the 
code for the record reader has a commented out section that would have allowed 
whitespace for the record literals.  See LispReader.java, readRecord.

https://github.com/clojure/clojure/commit/21175bc95d5f64e8142cb368e39ccd171debc56a

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


Re: [ANN] Clojars Releases repository

2012-11-20 Thread Wes Freeman
On Monday, November 19, 2012 12:53:32 PM UTC-5, Phil Hagelberg wrote:

>
> If you turn off :sign-releases inside your :repositories entry when 
> deploying libraries everything will work for you as before. But your 
> libraries won't qualify for the Releases repo in this case. So once your 
> users upgrade to Leiningen 2.0.0 they will have to include a separate 
> :repositories entry for the classic repo to indicate that they are OK 
> with pulling in dependencies that don't meet the higher standards of the 
> new repo. 
>

Can you give some example syntax for :repositories and ":sign-releases 
false" specifically for clojars? I was hoping to test deploy without 
signing and then try again with signing, to see if that fixes my project.

Thanks,
Wes

-- 
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] Hermes, wrapper around Titan (0.2.2)

2012-11-20 Thread Zack Maril
Ma chere Mailing List, it is with deepest pride 
and greatest pleasure that we email you tonight. 
And now we invite you to relax, let us pull up 
a chair as Game Closure  proudly presents - 
Hermes !

Be our guest! Be our guest!
Put our library to the test!
Titan is a wonderful new graph 
database[0], 
cherie
And we'll provide the rest.
Transactions du jour,
Hot upserts,
Why, we only live to serve
Try upconnect! 

Hermes is auspicious!

Don't believe me? Ask the 
tests
They can sing, they can dance[1]
After all, Miss, this is Game Closure!
And a project here is never second best
Go on, and open up the source
Take a glance and then you'll
Be our guest
Oui, our guest
Be our guest!

---

A few weeks ago, we got really excited when we realized we could write
a wrapper around Titan in Clojure. And so, after some polish, we've
open sourced Hermes. Hermes provides access to smart transaction
management and classic operations like upsert and upconnect. The test
suite exists (yay!) AND covers most aspects of the library so far.
Documentation is admittedly sparse, but should rapidly improve within
the next few weeks. It's a blast to work with and lets you build some
great systems quite quickly[2].

And so. 

Be our guest! 
Be our guest! 
Be our guest! 
Please, be our guest!
-Zack Maril

[0] Actually, I think it is a transactor like Datomic, but it's easier to 
say database. 
[1] May depend upon your definition of sing and/or dance. 
[2] If you like working with Clojure, graph databases, or puppies you 
should really send me email and introduce yourself (z...@gameclosure.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: [ANN] Clojars Releases repository

2012-11-20 Thread Wes Freeman
Ok, if you do a signed deploy, you can scp the pom and jar over to get it
working, directly after.

Like:
scp pom.xml target/clojurithms-0.1.0.jar cloj...@clojars.org:
/repo/clojurithms/clojurithms/0.1.0/

On Tue, Nov 20, 2012 at 7:10 PM, Wes Freeman  wrote:

> On Monday, November 19, 2012 12:53:32 PM UTC-5, Phil Hagelberg wrote:
>
>>
>> If you turn off :sign-releases inside your :repositories entry when
>> deploying libraries everything will work for you as before. But your
>> libraries won't qualify for the Releases repo in this case. So once your
>> users upgrade to Leiningen 2.0.0 they will have to include a separate
>> :repositories entry for the classic repo to indicate that they are OK
>> with pulling in dependencies that don't meet the higher standards of the
>> new repo.
>>
>
> Can you give some example syntax for :repositories and ":sign-releases
> false" specifically for clojars? I was hoping to test deploy without
> signing and then try again with signing, to see if that fixes my project.
>
> Thanks,
> Wes
>
> --
> 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: Nested/inner classes with gen-class

2012-11-20 Thread Stephen Compall
On Thu, 2012-11-15 at 18:06 -0800, Jonathan Bryant wrote:
> (gen-class 'foo.Bar$Baz
>   ; ... stuff ... )
> Any solution?

Relevant bits from gen-class's docstring:

clojure.core/gen-class
([& options])

  :name aname

  The package-qualified name of the class to be generated

Write it like (gen-class :name foo.bar$Baz) and you'll be fine.  This
works for me on Clojure 1.4.

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


-- 
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: printing for non-human consumption but want *read-eval* false

2012-11-20 Thread Stuart Sierra
`spit` calls `str` on its argument, which has the same behavior as `print` 
or `println` with regard to quoting strings:

user=> (println "I say, \"Hello, World!\"")
I say, "Hello, World!"
nil

To preserve data in its `read`able form, you need `pr` or `prn`:

user=> (prn "I say, \"Hello, World!\"")
"I say, \"Hello, World!\""
nil

Note that with `prn` the string is enclosed in double-quotes and quotation 
marks inside the string are backslash-escaped.

You can still use `spit` as you were before, just call `pr-str` on the data 
first:

user=> (pr-str "I say, \"Hello, World!\"")
"\"I say, \\\"Hello, World!\\\"\""


-S

-- 
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: Run Counterclockwise nREPL on specific port

2012-11-20 Thread Dave Ray
> Run: Actually, maybe this makes sense, isn't this a bit like the "remote
> connection java launcher" ? Several remotes could be saved in different
> launch configurations. Some other configuration options could come up
> quickly, like "things to prepend on each launch - via a potential additional
> op to nrepl", etc. This would require creating a specific kind of launch
> configuration.

+1. I think the custom launch config is the idiomatic Eclipse way to
do it. To put it another way, as a long-time Eclipse user, I would
look in the launch configs first if I was going to connect to a remote
repl. Of course, as a long-time Eclipse user, my mind is also
irreparably mutilated.

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


Help required to test `lein upgrade` feature on Windows

2012-11-20 Thread Shantanu Kumar
Hi,

I have implemented the `lein upgrade` feature for Windows that seems
to be working for me on 64-bit Windows 7. I need help from others to
test on other Windows versions.

https://github.com/kumarshantanu/leiningen/raw/preview/bin/lein.bat

Please follow the steps here to test:

https://github.com/technomancy/leiningen/issues/794#issuecomment-10585029

Once this is reported to work for others I will send the pull request
to merge it in Leiningen.

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: Run Counterclockwise nREPL on specific port

2012-11-20 Thread Mark
My first thought is to make it a launch configuration similar to remote 
debug of Java problems.

On Tuesday, November 20, 2012 2:21:12 PM UTC-8, Chas Emerick wrote:
>
> On Nov 20, 2012, at 3:22 PM, Vladimir Tsichevski wrote:
>
> CCW has a 'connect to repl' option under  'Window'. It asks doe an IP 
>> and a port number...is this what you're looking for? 
>>
> Exactly! The menu location is quite unusual for Eclipse :-(
>
>
> Heh, this one's on me; I put it in the Window menu.  I honestly couldn't 
> find a good place for it.  Eclipse is deeply wedded to operations being 
> related to a project, so this project-insensitive operation didn't 
> naturally slot in anywhere.  Suggestions welcome, of course.
>
> - Chas
>

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

Re: Run Counterclockwise nREPL on specific port

2012-11-20 Thread Mark
My first thought is to make it a launch configuration similar to remote 
debug of Java programs.

On Tuesday, November 20, 2012 2:21:12 PM UTC-8, Chas Emerick wrote:
>
> On Nov 20, 2012, at 3:22 PM, Vladimir Tsichevski wrote:
>
> CCW has a 'connect to repl' option under  'Window'. It asks doe an IP 
>> and a port number...is this what you're looking for? 
>>
> Exactly! The menu location is quite unusual for Eclipse :-(
>
>
> Heh, this one's on me; I put it in the Window menu.  I honestly couldn't 
> find a good place for it.  Eclipse is deeply wedded to operations being 
> related to a project, so this project-insensitive operation didn't 
> naturally slot in anywhere.  Suggestions welcome, of course.
>
> - Chas
>

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

Re: [ANN] Clojars Releases repository

2012-11-20 Thread Phil Hagelberg
Wes Freeman  writes:

> Can you give some example syntax for :repositories and ":sign-releases
> false" specifically for clojars? I was hoping to test deploy without
> signing and then try again with signing, to see if that fixes my
> project.

Sure; it would just be something like this:

:repositories [["clojars" {:url "https://clojars.org/repo";
   :sign-releases false}]]

-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: [ANN] Clojars Releases repository

2012-11-20 Thread Phil Hagelberg
Peter Taoussanis  writes:

> I'd caution anyone against trying to redeploy their libraries right
> now since there seems to be some serious unresolved issues. I just
> tried a redeploy myself and am also getting the
> "ReasonPhrase:Forbidden" error.

Sorry about this. We've tracked it down to concurrency issues with the
underlying sqlite database driver. I have a fix that reduces the
contention by having an explicit "promote" button instead of
automatically promoting upon deployment, but a proper fix will be more
involved; might need to port to a new DB. My fix is currently blocked on
an anti-forgery issue, but I hope to have it out tomorrow.

> Unfortunately this seems to leave the repo in a bad state, since
> dependency pull requests now come back with a "Checksum validation
> failed".

If you have to deploy before then I would recommend using an scp-based
deployment.

Sorry for the inconvenience.

-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: [ANN] Clojars Releases repository

2012-11-20 Thread Peter Taoussanis


> Sorry for the inconvenience. 
>

No problem at all Phil. You're doing us all a huge service with all your 
work on this; teething issues are to be expected. Just wanted to suggest 
library authors proceed cautiously for now to avoid unknowingly 
breaking dependents in the wild.

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

Re: [ANN] Hermes, wrapper around Titan (0.2.2)

2012-11-20 Thread Michael Klishin
2012/11/21 Zack Maril 

> Documentation is admittedly sparse, but should rapidly improve within
> the next few weeks.
>

There is no dependency/installation information in the README.
Please add it or beginners won't be able to use your library.

If you need an example:
https://github.com/michaelklishin/welle#maven-artifacts

I'd also recommend not using def in examples where a local will do.
-- 
MK

http://github.com/michaelklishin
http://twitter.com/michaelklishin

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

Re: ANN: lein-clr 0.2.0 for ClojureCLR

2012-11-20 Thread dmiller
Shantanu,

This has been much requested.  I plan to give a test-drive over the 
imminent holiday weekend.  

-David
 

On Sunday, November 18, 2012 3:03:03 PM UTC-6, Shantanu Kumar wrote:
>
> Hi,
>
> I pushed lein-clr 0.2.0 https://github.com/kumarshantanu/lein-clr JARs to 
> Clojars a little while ago. The focus of this release is to
>
> 1. add dependency support (via NuGet/wget/curl, Leiningen :dependencies)
> 2. lower the bar to get started with ClojureCLR (with automated download 
> of ClojureCLR)
> 3. remove the need to call `assembly-load-from` in code
>
> The changelog and TODO are here: 
> https://github.com/kumarshantanu/lein-clr/blob/master/CHANGES.md
>
> I hope this release is usable enough to start building ClojureCLR apps and 
> libraries with it. This is an early project and can certainly use feedback 
> and contribution. Please let me know what you think.
>
> 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

  1   2   >