Re: [ANN] Replete ClojureScript REPL iOS app available

2015-07-21 Thread Andrew Keedle
Brilliant Mike. Well done with this. Very impressive.

On Monday, 20 July 2015 21:28:51 UTC, Mike Fikes  wrote:
> Replete 1.0 is now in the App Store
> 
>
> http://blog.fikesfarm.com/posts/2015-07-20-ios-clojurescript-repl-available-in-app-store.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
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ANN] Afterglow 0.1.0, an open-source live-coding Clojure environment for light shows

2015-07-21 Thread Devin Walters
Great logo, and stellar work. Thanks so much for your contribution.
On Sun, Jul 19, 2015 at 10:09 PM James Elliott  wrote:

> I just released version 0.1.0 of Afterglow so that other interested people
> can start exploring it. I simply cannot believe I have been able to create
> a system like this in a couple of months, after being inspired by the
> example of Overtone. Thank you, Clojure community, for making software
> development so powerful and so much fun again!
>
> Interested parties can find the repository here:
> https://github.com/brunchboy/afterglow
>
> From the online manual:
>
>> Afterglow is a lighting controller designed to support live coding
>> , written in Clojure
>> , intended to enable people to produce spectacular
>> and highly customizable light shows using modern stage and effect lighting,
>> and which are related in deep ways to the phrasing of music being played.
>> (Its creator  is a DJ and producer of light
>> and laser shows by avocation.) Currently, the lighting effects
>> 
>>  and fixture definitions
>> 
>>  are
>> written and organized through Clojure code, so you will either need to
>> learn Clojure or work with a Clojure programmer to create new ones, but
>> they are controlled through MIDI control surfaces or Open Sound Control, so
>> once they are set up, there is great flexibility in how you can perform
>> them.
>>
>> Someday a user interface for building shows and fixture definitions may
>> be created, either within Afterglow, or as a companion project, but that is
>> not currently planned. For now the focus is on building rich user
>> interfaces for controlling shows, such as the Ableton Push mapping
>> 
>>  and web interface
>> ,
>> while using the concise expressive power of Clojure for writing the fixture
>> definitions, effects, and cues.
>>
>> Afterglow communicates with the lighting hardware using the Open
>> Lighting Architecture , so it
>> supports a wide variety of communication methods and interfaces.
>> Information about installing OLA
>>  is included in the
>> project README .
>>
>
>>  --
> 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 unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


ClojureWpf can't compile.

2015-07-21 Thread cada


Hi,


I would like to try ClojureWpf 
here: https://github.com/aaronc/ClojureWpf,


It is just that I can't open the open it in my visual studio. It seems 
that aaronc forgot to commit .nuget folder?






I tried removing it from csproj so I can open proj in vs, but I don't 
know how to compile it. Anyone can help 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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


As far as I understand, 'completing' won't produce a valid transducer from a reducing function.

2015-07-21 Thread crocket
It doesn't attach a 0-arity signature to a reducing function, and a 
transducer needs a 0-arity signature.

Is it a bug?

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: As far as I understand, 'completing' won't produce a valid transducer from a reducing function.

2015-07-21 Thread crocket
completing doesn't seem to produce a valid transducer that can be used with 
other transducers.

On Tuesday, July 21, 2015 at 9:09:53 PM UTC+9, crocket wrote:
>
> It doesn't attach a 0-arity signature to a reducing function, and a 
> transducer needs a 0-arity signature.
>
> Is it a bug?
>

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ANN] Replete ClojureScript REPL iOS app available

2015-07-21 Thread Shahrdad Shadab
Awesome!, Thanks a lot Mike.

On Tue, Jul 21, 2015 at 4:30 AM, Andrew Keedle  wrote:

> Brilliant Mike. Well done with this. Very impressive.
>
> On Monday, 20 July 2015 21:28:51 UTC, Mike Fikes  wrote:
> > Replete 1.0 is now in the App Store
> >
> >
> http://blog.fikesfarm.com/posts/2015-07-20-ios-clojurescript-repl-available-in-app-store.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
> ---
> You received this message because you are subscribed to the Google Groups
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Software Architect & Computer Scientist

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: As far as I understand, 'completing' won't produce a valid transducer from a reducing function.

2015-07-21 Thread crocket
After venturing out a little further, I discovered that completing is meant 
to be used on a function passed to the second argument to transduce, but 
not the first arguement.

For example,
(transduce (map inc)
   (completing (fn
 ([m v] (+ m v))
 ([] 0)))
   [1 2 3 4 5])

On Tuesday, July 21, 2015 at 9:09:53 PM UTC+9, crocket wrote:
>
> It doesn't attach a 0-arity signature to a reducing function, and a 
> transducer needs a 0-arity signature.
>
> Is it a bug?
>

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


How to make a static variable dynamic at runtime?

2015-07-21 Thread Yuri Govorushchenko
The problem I'm trying to solve is how to stub a variable (e.g. a function 
from a third-party lib) in tests so that the stubbing occurs only in the 
current thread with other threads continuing using var's root value. It's 
important because unit tests may be run in parallel. Without thread-local 
binding two threads stubbing the same function will lead to race conditions:

(binding [somelib/foo foo-stub] ; throws java.lang.IllegalStateException: 
Can't dynamically bind non-dynamic var
  ; invoke tested code which depends on foo
  ; assert stuff
  )

I've tried to use *.setDynamic* (as described in blog post [1]) but it 
doesn't work without direct *deref*-ing of the var:

(def static-var 123)
(defn quz[]
  (.setDynamic #'static-var true)
  (binding [static-var 1000]
(println "static-var =" static-var "deref =" @#'static-var)))

(quz) ; => static-var = 123 deref = 1000

This approach seems to be used in a recent *bolth* lib [2]. And The strange 
thing is that in REPL running this code line by line works:

user=> (def static-var 123)
> #'user/static-var
> user=> (.setDynamic #'static-var true)
> #'user/static-var
> user=> (binding [static-var 1000] (println "static-var =" static-var))
> static-var = 1000


Looking at Var class implementation I couldn't figure out why .*setDynamic* 
call wouldn't work. My guess is that compiler somehow caches initial static 
Var value for performance reasons?..

So the questions are:
1) Is it a bug that *.setDynamic* + *binding* don't work?
2) Is there any other way to temporally rebind static variable 
thread-locally? Considering I can't add *^:dynamic* into third-party lib 
and don't want to write a wrapper or use dependency injection in order to 
explicitly substitute the dependency in my unit tests.
3) Is there a Clojure parallel test runner which runs tests in new 
processes instead of threads? This would eliminate any race conditions. 
Python's *nose* test runner works this way [3].
4) Maybe crazy: does Clojure allow dynamically rebinding the symbol to a 
new Var instance so that I could set *'static-var* to point at *(.setDynamic 
(Var/create)*?
5) Even crazier idea: can I change the nature of the var so that it behaves 
like an InheritedThreadLocal instead of ThreadLocal, but without forcing a 
user to *deref* it (as it was described in [4])?

Links:
[1] http://blog.zolotko.me/2012/06/making-variable-dynamic-in-clojure.html
[2] 
https://github.com/yeller/bolth/blob/323532683e3f66ae11566db5423c1e927e51818e/src/bolth/runner.clj#L99
[3] 
http://nose.readthedocs.org/en/latest/doc_tests/test_multiprocess/multiprocess.html
[4] https://aphyr.com/posts/240-configuration-and-scope  - see 
"Thread-inheritable dynamic vars 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
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [:ann :book] ClojureScript Unraveled

2015-07-21 Thread Alejandro Gómez
Thanks to everybody for the kind words and suggestions!

A few comments to Bozhidar's suggestions below:

On Mon, Jul 20, 2015, at 07:07, Bozhidar Batsov wrote:
> That's a really exciting project, as a lot of people are looking to
> get started with ClojureScript and are finding it kind of hard because
> of the lack of such resources.
>
> My advise would be to put a bit heavier focus on the differences
> between Clojure & ClojureScript and add some section about setting up
> various editors/IDEs.

I think the differences from Clojure could be an appendix although it's
well-documented in the ClojureScript wiki, we'll make sure to mention
the bigger ones and link to the wiki page
(https://github.com/clojure/clojurescript/wiki/Differences-from-Clojure)
.

About the editor/IDE part I agree it'd be nice although is difficult for
us to write about non-Emacs editors since is what we both use; in my
case with inferior-clojure mode. It'd be great if Cursive, Light Table,
vim & co users contribute an appendix about their setup.

> A chapter like "ClojureScript for Clojure devs" would be great IMO.
>
>
> On 20 July 2015 at 00:51, Alejandro Gómez
>  wrote:
>> __
>> We just released the second revision which includes a lot of
>> corrections, an Acknowledgments section and an almost finished
>> chapter about CSP & core.async which covers all its API and
>> introduces the CSP concepts.
>>
>>
>> - Leanpub: https://leanpub.com/clojurescript-unraveled
- GitHub repository: https://github.com/funcool/clojurescript-unraveled
- HTML version: http://funcool.github.io/clojurescript-unraveled/
>>
>>
>> On Sun, Jul 19, 2015, at 14:51, Nando Breiter wrote:
>>> I'm a Clojure beginner and wanted to compliment the authors on a
>>> very clear yet concise text. Thank you.
>>
>>
>> Thanks a lot, any feedback will be greatly appreciated since one of
>> the goals of the project is to make ClojureScript accesible to
>> newcomers.
>>
>>>
>>>
>>>
>>> Aria Media Sagl
>>>
Via Rompada 40
>>>
6987 Caslano
>>>
Switzerland
>>>
>>> +41 (0)91 600 9601[1] +41 (0)76 303 4477[2] cell skype: ariamedia
>>>
>>> On Fri, Jul 17, 2015 at 7:30 PM, Alejandro Gómez
>>>  wrote:
 Hello everybody,

 I'm happy to announce that Andrey Antoukh (@niwinz) and I published
 the book about ClojureScript that we have been writing lately on
 Leanpub. It's not still 100% complete but the sections about the
 language and compiler are almost done. We'd greatly appreciate any
 feedback, errata or suggestions for the book.

 It is an open source book licensed under a Creative Commons BY-SA
 license and will forever remain free and open to community
 participation. Publishing it on Leanpub is a convenient way for
 readers to be notified whenever a new release comes out and not to
 go through the process of generating the book themselves. If you
 feel like it and can afford it you can make a donation and buy us a
 beer too!

 - Leanpub: https://leanpub.com/clojurescript-unraveled
 - GitHub repository:
   https://github.com/funcool/clojurescript-unraveled
 - HTML version: http://funcool.github.io/clojurescript-unraveled/

 Yours,

 Alejandro

 --
 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[3] 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 unsubscribe from this group and stop
 receiving emails from it, send an email to
 clojure+unsubscr...@googlegroups.com[4]. For more options, visit
 https://groups.google.com/d/optout.
>>>
>>>


>>> --
>>> 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[5] 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 unsubscribe from this group and stop
>>> receiving emails from it, send an email to
>>> clojure+unsubscr...@googlegroups.com. For more options, visit
>>> https://groups.google.com/d/optout.
>>
>>


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

Re: [ANN] Replete ClojureScript REPL iOS app available

2015-07-21 Thread Eric Normand

Nice

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [:ann :book] ClojureScript Unraveled

2015-07-21 Thread Bozhidar Batsov
Sounds like a plan to me. :-)

On 21 July 2015 at 18:16, Alejandro Gómez  wrote:

>  Thanks to everybody for the kind words and suggestions!
>
> A few comments to Bozhidar's suggestions below:
>
> On Mon, Jul 20, 2015, at 07:07, Bozhidar Batsov wrote:
>
> That's a really exciting project, as a lot of people are looking to get
> started with ClojureScript and are finding it kind of hard because of the
> lack of such resources.
>
> My advise would be to put a bit heavier focus on the differences between
> Clojure & ClojureScript and add some section about setting up various
> editors/IDEs.
>
>
> I think the differences from Clojure could be an appendix although it's
> well-documented in the ClojureScript wiki, we'll make sure to mention the
> bigger ones and link to the wiki page (
> https://github.com/clojure/clojurescript/wiki/Differences-from-Clojure).
>
> About the editor/IDE part I agree it'd be nice although is difficult for
> us to write about non-Emacs editors since is what we both use; in my case
> with inferior-clojure mode. It'd be great if Cursive, Light Table, vim & co
> users contribute an appendix about their setup.
>
>
> A chapter like "ClojureScript for Clojure devs" would be great IMO.
>
>
> On 20 July 2015 at 00:51, Alejandro Gómez  wrote:
>
>
> We just released the second revision which includes a lot of corrections,
> an Acknowledgments section and an almost finished chapter about CSP &
> core.async which covers all its API and introduces the CSP concepts.
>
>
>
> - Leanpub: https://leanpub.com/clojurescript-unraveled
> - GitHub repository: https://github.com/funcool/clojurescript-unraveled
> - HTML version: http://funcool.github.io/clojurescript-unraveled/
>
>
>
> On Sun, Jul 19, 2015, at 14:51, Nando Breiter wrote:
>
> I'm a Clojure beginner and wanted to compliment the authors on a very
> clear yet concise text. Thank you.
>
>
>
> Thanks a lot, any feedback will be greatly appreciated since one of the
> goals of the project is to make ClojureScript accesible to newcomers.
>
>
>
>
>
> Aria Media Sagl
> Via Rompada 40
> 6987 Caslano
> Switzerland
>
> +41 (0)91 600 9601
> +41 (0)76 303 4477 cell
> skype: ariamedia
>
> On Fri, Jul 17, 2015 at 7:30 PM, Alejandro Gómez 
> wrote:
>
> Hello everybody,
>
> I'm happy to announce that Andrey Antoukh (@niwinz) and I published the
> book about ClojureScript
> that we have been writing lately on Leanpub. It's not still 100%
> complete but the sections about
> the language and compiler are almost done. We'd greatly appreciate any
> feedback, errata or suggestions
> for the book.
>
> It is an open source book licensed under a Creative Commons BY-SA
> license and will forever remain
> free and open to community participation. Publishing it on Leanpub is a
> convenient way for readers
> to be notified whenever a new release comes out and not to go through
> the process of generating the
> book themselves. If you feel like it and can afford it you can make a
> donation and buy us a beer too!
>
> - Leanpub: https://leanpub.com/clojurescript-unraveled
> - GitHub repository: https://github.com/funcool/clojurescript-unraveled
> - HTML version: http://funcool.github.io/clojurescript-unraveled/
>
> Yours,
>
> Alejandro
>
> --
> 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 unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>
>
>
>
> --
> 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 unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>
>
>
>
> --
>  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
>  cloju

Re: As far as I understand, 'completing' won't produce a valid transducer from a reducing function.

2015-07-21 Thread Alex Miller
Yes, that.

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: procrun - banging my head!

2015-07-21 Thread Colin Yates
Thanks David - I will be spending some more time with this later this week and 
will try it then!
> On 20 Jul 2015, at 14:29, David Powell  wrote:
> 
> Running the .exe directly from a console window might help, as it will show 
> you any errors as console output.
> 
> I use a similar set up, but pass the parameters on the command-line rather 
> than via environment variables.  I set StartMode=jvm, 
> StartClass=com.example.Start, and leave StartMethod unset (so it just calls 
> -main).
> 
> Try and see if you can get it working with a Java class first maybe?  If that 
> works confirm that your jar is an uberjar and contains the expected class 
> file.
> 
> (Note that I did have issues with the Stop mechanism - it didn't seem to run 
> in the same classloader, so I had to use a small Java stub to stop the 
> service using a special HTTP request)
> 
> 
> On Mon, Jul 20, 2015 at 12:54 PM, Colin Yates  > wrote:
> Hi all,
> 
> I am trying to get my Clojure app deployable on Windows using procrun, and I 
> am running into a brick wall.
> 
> I can install the service, but when I start it I get an error: "Windows could 
> not start the ... on Local Computer. For more information, review the System 
> Event Log..." The System Event Log has an Error but absolutely no useful 
> information.
> 
> Any suggestions welcome!
> 
> My procure configuration is:
> 
> --- start
> REM user configuration below
> set INST_DIR=c:\test
> 
> REM  DO NOT MODIFY 
> REM Dist layout
> set SERVICE_NAME=MyTestService
> set PR_INSTALL=%INST_DIR%\dist\prunsrv.exe
> set LOGS_DIR=%INST_DIR%\logs
> 
> REM Service log configuration
> set PR_LOGPREFIX=%SERVICE_NAME%
> set PR_LOGPATH=%LOGS_DIR%
> set PR_STDOUTPUT=%LOGS_DIR%\stdout.txt
> set PR_STDERROR=%LOGS_DIR%\stderr.txt
> set PR_LOGLEVEL=Info
> 
> REM Path to java installation
> set PR_CLASSPATH=%INST_DIR%/dist/my.jar
> 
> REM Startup configuration
> set PR_STARTUP=manual
> set PR_STARTMODE=auto
> set PR_STARTCLASS=test.prod
> set PR_STARTMETHOD=startSystem
> 
> REM Shutdown configuration
> set PR_STOPMODE=auto
> set PR_STOPCLASS=test.prod
> set PR_STOPMETHOD=stopSystem
> 
> REM JVM configuration
> set PR_JVMMS=256
> set PR_JVMMX=1024
> set PR_JVMSS=4000
> 
> REM Install service
> %INST_DIR%/dist/prunsrv.exe //US//%SERVICE_NAME%
> 
> --- end
> 
> My test.prod class:
> 
> --- start
> (ns test
>   (:require [environ.core :as env]
> [test.systems :refer [core-system]]
> [com.stuartsierra.component :as component]
> [util.heartbeat :as heartbeat])
>   (:gen-class
>:methods [^{:static true} [startSystem ["[Ljava.lang.String;"] void]
>  ^{:static true} [stopSystem ["[Ljava.lang.String;"] void]]))
> 
> (def db {:subprotocol "jtds:sqlserver"
>  :subname (env/env :database-subname)
>  :user(env/env :database-user)
>  :password(env/env :database-password)})
> 
> (def system (core-system db))
> 
> (defn -startSystem [& args]
>   (println "Starting system.")
>   (alter-var-root #'system component/start)
>   (let [heartbeat-listener-registry (:heartbeat-listener-registry system)]
> (heartbeat/start heartbeat-listener-registry))
>   (println "System started."))
> 
> (defn -stopSystem [& args]
>   (println "Stopping system.")
>   (alter-var-root #'system component/stop)
>   (println "System stopped."))
> 
> (defn -main [& args]
>   (let [arg (first args)]
> (if (= "stop" arg)
>   (-startSystem)
>   (-stopSystem
> --- end
> 
> 
> 
> -- 
> 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 unsubscribe from this group and stop receiving emails from it, send an 
> email to clojure+unsubscr...@googlegroups.com 
> .
> For more options, visit https://groups.google.com/d/optout 
> .
> 
> 
> -- 
> 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 
> 
> --- 
> Y

Re: [ANN] Replete ClojureScript REPL iOS app available

2015-07-21 Thread Fergal Byrne
Really nice, thanks Mike for such a clean app. One suggestion: would it be 
possible to use the documents interface in iTunes to drop in jar files (the 
same way you drop books into Kindle)? We could then use the app like a real 
REPL.
















--

Fergal Byrne, Brenter IT

Author, Real Machine Intelligence with Clortex and NuPIC 
https://leanpub.com/realsmartmachines

Speaking on Clortex and HTM/CLA at euroClojure Krakow, June 2014: 
http://euroclojure.com/2014/
and at LambdaJam Chicago, July 2014: http://www.lambdajam.com

http://inbits.com - Better Living through Thoughtful Technology
http://ie.linkedin.com/in/fergbyrne/ - https://github.com/fergalbyrne

e:fergalbyrnedub...@gmail.com t:+353 83 4214179
Join the quest for Machine Intelligence at http://numenta.org
Formerly of Adnet edi...@adnet.ie http://www.adnet.ie

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ANN] Replete ClojureScript REPL iOS app available

2015-07-21 Thread mikefikes18
Yes, that's part of what I have in mind, in addition to downloading JARs from, 
say, Clojars.

> On Jul 21, 2015, at 1:55 PM, Fergal Byrne  wrote:
> 
> Really nice, thanks Mike for such a clean app. One suggestion: would it be 
> possible to use the documents interface in iTunes to drop in jar files (the 
> same way you drop books into Kindle)? We could then use the app like a real 
> REPL.
> 
> 
> 
> 
> 
> --
> 
> Fergal Byrne, Brenter IT
> 
> Author, Real Machine Intelligence with Clortex and NuPIC 
> https://leanpub.com/realsmartmachines
> 
> Speaking on Clortex and HTM/CLA at euroClojure Krakow, June 2014: 
> http://euroclojure.com/2014/
> and at LambdaJam Chicago, July 2014: http://www.lambdajam.com
> 
> http://inbits.com - Better Living through Thoughtful Technology
> http://ie.linkedin.com/in/fergbyrne/ - https://github.com/fergalbyrne
> 
> e:fergalbyrnedub...@gmail.com t:+353 83 4214179
> Join the quest for Machine Intelligence at http://numenta.org
> Formerly of Adnet edi...@adnet.ie http://www.adnet.ie
> 
> 
>> On Tue, Jul 21, 2015 at 4:36 PM, Eric Normand  wrote:
>> 
>> Nice 
>> 
>> -- 
>> 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 unsubscribe from this group and stop receiving emails from it, send an 
>> email to clojure+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
> 
> -- 
> 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 unsubscribe from this group and stop receiving emails from it, send an 
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ANN] Clojure 1.8.0-alpha2

2015-07-21 Thread Rangel Spasov
Hey guys,

Getting this error with 1.8.0-alpha2, I think related to aleph (using 
0.4.0, latest version at the moment).

#error {

 :cause IllegalName: compile__stub.aleph.http.core.aleph.http.core/HeaderMap

 :via

 [{:type clojure.lang.Compiler$CompilerException

   :message java.lang.NoClassDefFoundError: IllegalName: 
compile__stub.aleph.http.core.aleph.http.core/HeaderMap, 
compiling:(aleph/http/core.clj:81:1)

   :at [clojure.lang.Compiler analyzeSeq Compiler.java 6798]}

  {:type java.lang.NoClassDefFoundError

   :message IllegalName: 
compile__stub.aleph.http.core.aleph.http.core/HeaderMap

   :at [java.lang.ClassLoader preDefineClass ClassLoader.java 654]}]

 :trace

 [[java.lang.ClassLoader preDefineClass ClassLoader.java 654]

  [java.lang.ClassLoader defineClass ClassLoader.java 758]

  [java.lang.ClassLoader defineClass ClassLoader.java 642]

  [clojure.lang.DynamicClassLoader defineClass DynamicClassLoader.java 46]

  [clojure.lang.Compiler$NewInstanceExpr compileStub Compiler.java 7815]

  [clojure.lang.Compiler$NewInstanceExpr build Compiler.java 7680]

  [clojure.lang.Compiler$NewInstanceExpr$DeftypeParser parse Compiler.java 
7590]

  [clojure.lang.Compiler analyzeSeq Compiler.java 6791]

  [clojure.lang.Compiler analyze Compiler.java 6592]

  [clojure.lang.Compiler analyze Compiler.java 6553]

  [clojure.lang.Compiler$BodyExpr$Parser parse Compiler.java 5929]

  [clojure.lang.Compiler$LetExpr$Parser parse Compiler.java 6247]

  [clojure.lang.Compiler analyzeSeq Compiler.java 6791]

  [clojure.lang.Compiler analyze Compiler.java 6592]

  [clojure.lang.Compiler analyze Compiler.java 6553]

  [clojure.lang.Compiler$BodyExpr$Parser parse Compiler.java 5929]

  [clojure.lang.Compiler$FnMethod parse Compiler.java 5359]

  [clojure.lang.Compiler$FnExpr parse Compiler.java 3959]

  [clojure.lang.Compiler analyzeSeq Compiler.java 6789]

  [clojure.lang.Compiler analyze Compiler.java 6592]

  [clojure.lang.Compiler eval Compiler.java 6847]

  [clojure.lang.Compiler eval Compiler.java 6839]

  [clojure.lang.Compiler load Compiler.java 7295]

  [clojure.lang.RT loadResourceScript RT.java 372]

  [clojure.lang.RT loadResourceScript RT.java 363]

  [clojure.lang.RT load RT.java 453]

  [clojure.lang.RT load RT.java 419]

  [clojure.core$load$fn__5448 invoke core.clj 5866]

  [clojure.core$load doInvoke core.clj 5865]

  [clojure.lang.RestFn invoke RestFn.java 408]

  [clojure.core$load_one invoke core.clj 5671]

  [clojure.core$load_lib$fn__5397 invoke core.clj 5711]

  [clojure.core$load_lib doInvoke core.clj 5710]

  [clojure.lang.RestFn applyTo RestFn.java 142]

  [clojure.core$apply invoke core.clj 632]

  [clojure.core$load_libs doInvoke core.clj 5749]

  [clojure.lang.RestFn applyTo RestFn.java 137]

  [clojure.core$apply invoke core.clj 632]

  [clojure.core$require doInvoke core.clj 5832]

  [clojure.lang.RestFn invoke RestFn.java 551]

  [aleph.http.server$eval9251$loading__5340__auto9252 invoke server.clj 
1]

  [aleph.http.server$eval9251 invoke server.clj 1]

  [clojure.lang.Compiler eval Compiler.java 6850]

  [clojure.lang.Compiler eval Compiler.java 6839]

  [clojure.lang.Compiler load Compiler.java 7295]

  [clojure.lang.RT loadResourceScript RT.java 372]

  [clojure.lang.RT loadResourceScript RT.java 363]

  [clojure.lang.RT load RT.java 453]

  [clojure.lang.RT load RT.java 419]

  [clojure.core$load$fn__5448 invoke core.clj 5866]

  [clojure.core$load doInvoke core.clj 5865]

  [clojure.lang.RestFn invoke RestFn.java 408]

  [clojure.core$load_one invoke core.clj 5671]

  [clojure.core$load_lib$fn__5397 invoke core.clj 5711]

  [clojure.core$load_lib doInvoke core.clj 5710]

  [clojure.lang.RestFn applyTo RestFn.java 142]

  [clojure.core$apply invoke core.clj 632]

  [clojure.core$load_libs doInvoke core.clj 5753]

  [clojure.lang.RestFn applyTo RestFn.java 137]

  [clojure.core$apply invoke core.clj 632]

  [clojure.core$require doInvoke core.clj 5832]

  [clojure.lang.RestFn invoke RestFn.java 457]

  [aleph.http$eval1594$loading__5340__auto1595 invoke http.clj 1]

  [aleph.http$eval1594 invoke http.clj 1]

  [clojure.lang.Compiler eval Compiler.java 6850]

  [clojure.lang.Compiler eval Compiler.java 6839]

  [clojure.lang.Compiler load Compiler.java 7295]

  [clojure.lang.RT loadResourceScript RT.java 372]

  [clojure.lang.RT loadResourceScript RT.java 363]

  [clojure.lang.RT load RT.java 453]

  [clojure.lang.RT load RT.java 419]

  [clojure.core$load$fn__5448 invoke core.clj 5866]

  [clojure.core$load doInvoke core.clj 5865]

  [clojure.lang.RestFn invoke RestFn.java 408]

  [clojure.core$load_one invoke core.clj 5671]

  [clojure.core$load_lib$fn__5397 invoke core.clj 5711]

  [clojure.core$load_lib doInvoke core.clj 5710]

  [clojure.lang.RestFn applyTo RestFn.java 142]

  [clojure.core$apply invoke core.clj 632]

  [clojure.core$load_libs doInvoke core.clj 5749]

  [clojure.lang.RestFn applyTo RestFn.java 137]

  [clojure.core$apply invoke core.clj 632]

  [cloju

Re: [ANN] Clojure 1.8.0-alpha2

2015-07-21 Thread Zach Tellman
A similar issue was reported earlier in the thread, target [potemkin 
"0.4.1"] and see if that fixes it.

On Tuesday, July 21, 2015 at 12:24:43 PM UTC-7, Rangel Spasov wrote:
>
> Hey guys,
>
> Getting this error with 1.8.0-alpha2, I think related to aleph (using 
> 0.4.0, latest version at the moment).
>
> #error {
>
>  :cause IllegalName: 
> compile__stub.aleph.http.core.aleph.http.core/HeaderMap
>
>  :via
>
>  [{:type clojure.lang.Compiler$CompilerException
>
>:message java.lang.NoClassDefFoundError: IllegalName: 
> compile__stub.aleph.http.core.aleph.http.core/HeaderMap, 
> compiling:(aleph/http/core.clj:81:1)
>
>:at [clojure.lang.Compiler analyzeSeq Compiler.java 6798]}
>
>   {:type java.lang.NoClassDefFoundError
>
>:message IllegalName: 
> compile__stub.aleph.http.core.aleph.http.core/HeaderMap
>
>:at [java.lang.ClassLoader preDefineClass ClassLoader.java 654]}]
>
>  :trace
>
>  [[java.lang.ClassLoader preDefineClass ClassLoader.java 654]
>
>   [java.lang.ClassLoader defineClass ClassLoader.java 758]
>
>   [java.lang.ClassLoader defineClass ClassLoader.java 642]
>
>   [clojure.lang.DynamicClassLoader defineClass DynamicClassLoader.java 46]
>
>   [clojure.lang.Compiler$NewInstanceExpr compileStub Compiler.java 7815]
>
>   [clojure.lang.Compiler$NewInstanceExpr build Compiler.java 7680]
>
>   [clojure.lang.Compiler$NewInstanceExpr$DeftypeParser parse Compiler.java 
> 7590]
>
>   [clojure.lang.Compiler analyzeSeq Compiler.java 6791]
>
>   [clojure.lang.Compiler analyze Compiler.java 6592]
>
>   [clojure.lang.Compiler analyze Compiler.java 6553]
>
>   [clojure.lang.Compiler$BodyExpr$Parser parse Compiler.java 5929]
>
>   [clojure.lang.Compiler$LetExpr$Parser parse Compiler.java 6247]
>
>   [clojure.lang.Compiler analyzeSeq Compiler.java 6791]
>
>   [clojure.lang.Compiler analyze Compiler.java 6592]
>
>   [clojure.lang.Compiler analyze Compiler.java 6553]
>
>   [clojure.lang.Compiler$BodyExpr$Parser parse Compiler.java 5929]
>
>   [clojure.lang.Compiler$FnMethod parse Compiler.java 5359]
>
>   [clojure.lang.Compiler$FnExpr parse Compiler.java 3959]
>
>   [clojure.lang.Compiler analyzeSeq Compiler.java 6789]
>
>   [clojure.lang.Compiler analyze Compiler.java 6592]
>
>   [clojure.lang.Compiler eval Compiler.java 6847]
>
>   [clojure.lang.Compiler eval Compiler.java 6839]
>
>   [clojure.lang.Compiler load Compiler.java 7295]
>
>   [clojure.lang.RT loadResourceScript RT.java 372]
>
>   [clojure.lang.RT loadResourceScript RT.java 363]
>
>   [clojure.lang.RT load RT.java 453]
>
>   [clojure.lang.RT load RT.java 419]
>
>   [clojure.core$load$fn__5448 invoke core.clj 5866]
>
>   [clojure.core$load doInvoke core.clj 5865]
>
>   [clojure.lang.RestFn invoke RestFn.java 408]
>
>   [clojure.core$load_one invoke core.clj 5671]
>
>   [clojure.core$load_lib$fn__5397 invoke core.clj 5711]
>
>   [clojure.core$load_lib doInvoke core.clj 5710]
>
>   [clojure.lang.RestFn applyTo RestFn.java 142]
>
>   [clojure.core$apply invoke core.clj 632]
>
>   [clojure.core$load_libs doInvoke core.clj 5749]
>
>   [clojure.lang.RestFn applyTo RestFn.java 137]
>
>   [clojure.core$apply invoke core.clj 632]
>
>   [clojure.core$require doInvoke core.clj 5832]
>
>   [clojure.lang.RestFn invoke RestFn.java 551]
>
>   [aleph.http.server$eval9251$loading__5340__auto9252 invoke 
> server.clj 1]
>
>   [aleph.http.server$eval9251 invoke server.clj 1]
>
>   [clojure.lang.Compiler eval Compiler.java 6850]
>
>   [clojure.lang.Compiler eval Compiler.java 6839]
>
>   [clojure.lang.Compiler load Compiler.java 7295]
>
>   [clojure.lang.RT loadResourceScript RT.java 372]
>
>   [clojure.lang.RT loadResourceScript RT.java 363]
>
>   [clojure.lang.RT load RT.java 453]
>
>   [clojure.lang.RT load RT.java 419]
>
>   [clojure.core$load$fn__5448 invoke core.clj 5866]
>
>   [clojure.core$load doInvoke core.clj 5865]
>
>   [clojure.lang.RestFn invoke RestFn.java 408]
>
>   [clojure.core$load_one invoke core.clj 5671]
>
>   [clojure.core$load_lib$fn__5397 invoke core.clj 5711]
>
>   [clojure.core$load_lib doInvoke core.clj 5710]
>
>   [clojure.lang.RestFn applyTo RestFn.java 142]
>
>   [clojure.core$apply invoke core.clj 632]
>
>   [clojure.core$load_libs doInvoke core.clj 5753]
>
>   [clojure.lang.RestFn applyTo RestFn.java 137]
>
>   [clojure.core$apply invoke core.clj 632]
>
>   [clojure.core$require doInvoke core.clj 5832]
>
>   [clojure.lang.RestFn invoke RestFn.java 457]
>
>   [aleph.http$eval1594$loading__5340__auto1595 invoke http.clj 1]
>
>   [aleph.http$eval1594 invoke http.clj 1]
>
>   [clojure.lang.Compiler eval Compiler.java 6850]
>
>   [clojure.lang.Compiler eval Compiler.java 6839]
>
>   [clojure.lang.Compiler load Compiler.java 7295]
>
>   [clojure.lang.RT loadResourceScript RT.java 372]
>
>   [clojure.lang.RT loadResourceScript RT.java 363]
>
>   [clojure.lang.RT load RT.java 453]
>
>   [clojure.lang.RT load RT.java 419]
>
>   [clojure.core$load$fn__5448 invoke core.clj 5866]
>
>   [clojure.core$load doInvoke core.clj 5865]
>
>

Re: [ANN] Clojure 1.8.0-alpha2

2015-07-21 Thread Rangel Spasov
Ok, I think someone already mentioned this - sorry. Got it to compile by 
bumping to [potemkin "0.4.1"] - thanks Zach + all : ) 

On Tuesday, July 21, 2015 at 12:24:43 PM UTC-7, Rangel Spasov wrote:
>
> Hey guys,
>
> Getting this error with 1.8.0-alpha2, I think related to aleph (using 
> 0.4.0, latest version at the moment).
>
> #error {
>
>  :cause IllegalName: 
> compile__stub.aleph.http.core.aleph.http.core/HeaderMap
>
>  :via
>
>  [{:type clojure.lang.Compiler$CompilerException
>
>:message java.lang.NoClassDefFoundError: IllegalName: 
> compile__stub.aleph.http.core.aleph.http.core/HeaderMap, 
> compiling:(aleph/http/core.clj:81:1)
>
>:at [clojure.lang.Compiler analyzeSeq Compiler.java 6798]}
>
>   {:type java.lang.NoClassDefFoundError
>
>:message IllegalName: 
> compile__stub.aleph.http.core.aleph.http.core/HeaderMap
>
>:at [java.lang.ClassLoader preDefineClass ClassLoader.java 654]}]
>
>  :trace
>
>  [[java.lang.ClassLoader preDefineClass ClassLoader.java 654]
>
>   [java.lang.ClassLoader defineClass ClassLoader.java 758]
>
>   [java.lang.ClassLoader defineClass ClassLoader.java 642]
>
>   [clojure.lang.DynamicClassLoader defineClass DynamicClassLoader.java 46]
>
>   [clojure.lang.Compiler$NewInstanceExpr compileStub Compiler.java 7815]
>
>   [clojure.lang.Compiler$NewInstanceExpr build Compiler.java 7680]
>
>   [clojure.lang.Compiler$NewInstanceExpr$DeftypeParser parse Compiler.java 
> 7590]
>
>   [clojure.lang.Compiler analyzeSeq Compiler.java 6791]
>
>   [clojure.lang.Compiler analyze Compiler.java 6592]
>
>   [clojure.lang.Compiler analyze Compiler.java 6553]
>
>   [clojure.lang.Compiler$BodyExpr$Parser parse Compiler.java 5929]
>
>   [clojure.lang.Compiler$LetExpr$Parser parse Compiler.java 6247]
>
>   [clojure.lang.Compiler analyzeSeq Compiler.java 6791]
>
>   [clojure.lang.Compiler analyze Compiler.java 6592]
>
>   [clojure.lang.Compiler analyze Compiler.java 6553]
>
>   [clojure.lang.Compiler$BodyExpr$Parser parse Compiler.java 5929]
>
>   [clojure.lang.Compiler$FnMethod parse Compiler.java 5359]
>
>   [clojure.lang.Compiler$FnExpr parse Compiler.java 3959]
>
>   [clojure.lang.Compiler analyzeSeq Compiler.java 6789]
>
>   [clojure.lang.Compiler analyze Compiler.java 6592]
>
>   [clojure.lang.Compiler eval Compiler.java 6847]
>
>   [clojure.lang.Compiler eval Compiler.java 6839]
>
>   [clojure.lang.Compiler load Compiler.java 7295]
>
>   [clojure.lang.RT loadResourceScript RT.java 372]
>
>   [clojure.lang.RT loadResourceScript RT.java 363]
>
>   [clojure.lang.RT load RT.java 453]
>
>   [clojure.lang.RT load RT.java 419]
>
>   [clojure.core$load$fn__5448 invoke core.clj 5866]
>
>   [clojure.core$load doInvoke core.clj 5865]
>
>   [clojure.lang.RestFn invoke RestFn.java 408]
>
>   [clojure.core$load_one invoke core.clj 5671]
>
>   [clojure.core$load_lib$fn__5397 invoke core.clj 5711]
>
>   [clojure.core$load_lib doInvoke core.clj 5710]
>
>   [clojure.lang.RestFn applyTo RestFn.java 142]
>
>   [clojure.core$apply invoke core.clj 632]
>
>   [clojure.core$load_libs doInvoke core.clj 5749]
>
>   [clojure.lang.RestFn applyTo RestFn.java 137]
>
>   [clojure.core$apply invoke core.clj 632]
>
>   [clojure.core$require doInvoke core.clj 5832]
>
>   [clojure.lang.RestFn invoke RestFn.java 551]
>
>   [aleph.http.server$eval9251$loading__5340__auto9252 invoke 
> server.clj 1]
>
>   [aleph.http.server$eval9251 invoke server.clj 1]
>
>   [clojure.lang.Compiler eval Compiler.java 6850]
>
>   [clojure.lang.Compiler eval Compiler.java 6839]
>
>   [clojure.lang.Compiler load Compiler.java 7295]
>
>   [clojure.lang.RT loadResourceScript RT.java 372]
>
>   [clojure.lang.RT loadResourceScript RT.java 363]
>
>   [clojure.lang.RT load RT.java 453]
>
>   [clojure.lang.RT load RT.java 419]
>
>   [clojure.core$load$fn__5448 invoke core.clj 5866]
>
>   [clojure.core$load doInvoke core.clj 5865]
>
>   [clojure.lang.RestFn invoke RestFn.java 408]
>
>   [clojure.core$load_one invoke core.clj 5671]
>
>   [clojure.core$load_lib$fn__5397 invoke core.clj 5711]
>
>   [clojure.core$load_lib doInvoke core.clj 5710]
>
>   [clojure.lang.RestFn applyTo RestFn.java 142]
>
>   [clojure.core$apply invoke core.clj 632]
>
>   [clojure.core$load_libs doInvoke core.clj 5753]
>
>   [clojure.lang.RestFn applyTo RestFn.java 137]
>
>   [clojure.core$apply invoke core.clj 632]
>
>   [clojure.core$require doInvoke core.clj 5832]
>
>   [clojure.lang.RestFn invoke RestFn.java 457]
>
>   [aleph.http$eval1594$loading__5340__auto1595 invoke http.clj 1]
>
>   [aleph.http$eval1594 invoke http.clj 1]
>
>   [clojure.lang.Compiler eval Compiler.java 6850]
>
>   [clojure.lang.Compiler eval Compiler.java 6839]
>
>   [clojure.lang.Compiler load Compiler.java 7295]
>
>   [clojure.lang.RT loadResourceScript RT.java 372]
>
>   [clojure.lang.RT loadResourceScript RT.java 363]
>
>   [clojure.lang.RT load RT.java 453]
>
>   [clojure.lang.RT load RT.java 419]
>
>   [clojure.core$load$fn__5448 invoke core.clj 5866]
>
>   [clojure.core$load doI

Re: How to make a static variable dynamic at runtime?

2015-07-21 Thread Surgo
Not that it's the answer you're looking for, but usually this is when you 
rewrite the code you're testing to use dependency injection (ie, take the 
var of interest as an argument instead of a global or in its lexical 
environment).

-- Morgon

On Tuesday, July 21, 2015 at 10:54:42 AM UTC-4, Yuri Govorushchenko wrote:
>
> The problem I'm trying to solve is how to stub a variable (e.g. a function 
> from a third-party lib) in tests so that the stubbing occurs only in the 
> current thread with other threads continuing using var's root value. It's 
> important because unit tests may be run in parallel. Without thread-local 
> binding two threads stubbing the same function will lead to race conditions:
>
> (binding [somelib/foo foo-stub] ; throws java.lang.IllegalStateException: 
> Can't dynamically bind non-dynamic var
>   ; invoke tested code which depends on foo
>   ; assert stuff
>   )
>
> I've tried to use *.setDynamic* (as described in blog post [1]) but it 
> doesn't work without direct *deref*-ing of the var:
>
> (def static-var 123)
> (defn quz[]
>   (.setDynamic #'static-var true)
>   (binding [static-var 1000]
> (println "static-var =" static-var "deref =" @#'static-var)))
>
> (quz) ; => static-var = 123 deref = 1000
>
> This approach seems to be used in a recent *bolth* lib [2]. And The 
> strange thing is that in REPL running this code line by line works:
>
> user=> (def static-var 123)
>> #'user/static-var
>> user=> (.setDynamic #'static-var true)
>> #'user/static-var
>> user=> (binding [static-var 1000] (println "static-var =" static-var))
>> static-var = 1000
>
>
> Looking at Var class implementation I couldn't figure out why .
> *setDynamic* call wouldn't work. My guess is that compiler somehow caches 
> initial static Var value for performance reasons?..
>
> So the questions are:
> 1) Is it a bug that *.setDynamic* + *binding* don't work?
> 2) Is there any other way to temporally rebind static variable 
> thread-locally? Considering I can't add *^:dynamic* into third-party lib 
> and don't want to write a wrapper or use dependency injection in order to 
> explicitly substitute the dependency in my unit tests.
> 3) Is there a Clojure parallel test runner which runs tests in new 
> processes instead of threads? This would eliminate any race conditions. 
> Python's *nose* test runner works this way [3].
> 4) Maybe crazy: does Clojure allow dynamically rebinding the symbol to a 
> new Var instance so that I could set *'static-var* to point at *(.setDynamic 
> (Var/create)*?
> 5) Even crazier idea: can I change the nature of the var so that it 
> behaves like an InheritedThreadLocal instead of ThreadLocal, but without 
> forcing a user to *deref* it (as it was described in [4])?
>
> Links:
> [1] http://blog.zolotko.me/2012/06/making-variable-dynamic-in-clojure.html
> [2] 
> https://github.com/yeller/bolth/blob/323532683e3f66ae11566db5423c1e927e51818e/src/bolth/runner.clj#L99
> [3] 
> http://nose.readthedocs.org/en/latest/doc_tests/test_multiprocess/multiprocess.html
> [4] https://aphyr.com/posts/240-configuration-and-scope  - see 
> "Thread-inheritable dynamic vars 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
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.