[ANN] clj 1.9.0.348 and tools.deps.alpha 0.5.398

2018-02-25 Thread Alex Miller
New releases of tools.deps.alpha and the Clojure tools (clj, clojure) are 
now available.

clj 1.9.0.348 updates:

- Added -Scp option to skip computing a classpath and use the provided one
- Added -Sdescribe to output config env and parsed arg info as data
- Added --prefix to linux-install.sh (INST-9)
- Added man pages to installation (INST-18)
- Fix uberjar construction to avoid overlap of file and directory with same 
name
- Add missing license file

tools.deps.alpha 0.5.398 updates: 

- Refactoring and API updates
  - tools.deps.alpha - now requires all included extensions
  - tools.deps.alpha - added missing docstrings
  - tools.deps.alpha/lib-location - finds the file path location of lib if 
it were downloaded
  - tools.deps.alpha.reader/clojure-env - added call to shell out to call 
`clojure` to grab outer env
  - tools.deps.alpha.script.make_classpath - refactored to expose more 
resuable parts
- Improve error if cache dir can't be created
- Updated Maven-related deps

-- 
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: Is there some central information available on Java 9 compatibility for Clojure and tools

2018-02-25 Thread Ghadi Shayban
Clojure always worked on Java 9 but lein and boot were broken for a while. Now 
they're fixed.

The only remaining defect is the inability for Clojure to call static interface 
methods which are a new thing in Java 8. The bytecode verifier in Java 9 added 
a small backwards incompatible check that made those static interface calls 
break. (They have to be encoded a slightly different way) You can use Java 
reflection to make those calls.

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

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


Transitive spec generation

2018-02-25 Thread James Gatannah
I have a spec for an array of 16 bytes:

(s/def ::extension (s/and bytes?
   #(= (count %) 16))

Then I have a couple of other specs that are really just renaming it:

(s/def ::client-extension ::extension)
(s/def ::server-extension ::extension)

I started doing some refactoring today, and the definitions wound up 
needing to move to a different namespace.

So now the original definitions have changed to

(s/def ::client-extension ::refactored/client-extension)

I also started dabbling with generators, and came up with this:

(gen/generate (s/gen ::client-extension
  {::client-extension #(gen/fmap byte-array 
(gen/vector (gen/choose -128 127) 16)}))

When I define things this way, I get a "Couldn't satisfy such-that 
predicate after 100 tries." exception a little more than half the time.

If I rearrange things so that either
a) The refactored namespace defines the spec directly
or
b) I change my generator override to specify the top-level spec that the 
others are copying

i.e.
a) would mean changing the refactored ns such that I have
(s/def ::client-extension (s/and bytes?
 #(= (count %) 16))

b) changing the generator to
(gen/generate (s/gen ::client-extension
  {::refactored/extension #(gen/fmap 
byte-array (gen/vector (gen/choose -128 127) 16)}))

it seems to fail (with the same problem) about 1 time in 5.

I haven't seen it fail yet if I undo my refactoring and move the spec back 
to the original location.

I haven't collected any sorts of real numbers on this, much less tried to 
make enough test runs to collect a statistically significant sample. I know 
the next real steps are to put together a minimalist example.

But before I do that, I figured it might be asking whether anyone sees 
anything obviously wrong in what I'm trying to do, or whether there's a 
better way to do it.

Thanks in advance,
James

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
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: [?] Adding my own function to clojure.core namespace

2018-02-25 Thread Gary Fredericks
For clojure (not cljs, yet) I proxy all the dev utilities I might want to 
use in a namespace called `.` so I can refer to it everywhere no matter 
what the local namespace setup is: 
https://github.com/gfredericks/dot-slash-2

On Sunday, February 25, 2018 at 11:45:41 AM UTC-6, Philos Kim wrote:
>
> I have another question. Debux library supports ClojureScript as well. 
> Similarly, I want to add my own function or macro to cljs.core as in 
> Clojure. Can I use the same strategy in ClojureScript as in Clojure if I 
> use it in the  ClojureScript source code, not in REPL?

-- 
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: The Reasoned Schemer chpt 4: "Please pass the aspirin"

2018-02-25 Thread Peter Hull
On Sunday, 25 February 2018 17:46:26 UTC, Calvin Sauer wrote:
>
> I'm currently struggling with the same question. Did you ever happen to 
> reach a satisfying conclusion?
>

https://groups.google.com/forum/#!topic/minikanren/JCKJV7k7lGU

-- 
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: The Reasoned Schemer chpt 4: "Please pass the aspirin"

2018-02-25 Thread Calvin Sauer
I'm currently struggling with the same question. Did you ever happen to 
reach a satisfying conclusion?

On Saturday, May 25, 2013 at 1:21:08 PM UTC-4, Brian Craft wrote:
>
> Wondering if anyone can give me some pointers with this, as I dive into 
> logic programming. Or point me to a more appropriate forum, if this is the 
> wrong one. I know a lot of you have been trying out core.logic.
>
> It was all going well until chapter four. The story so far: introduce some 
> simple function, like cdr, then develop a logic programming equivalent, 
> repeat. Then in chapter four we get the second commandment, and the 
> equivalent functions stop being equivalent. Instead, they generate 
> meaningless results, like 4.18, where the value of z is irrelevant to 
> whether the equivalent function (mem) would succeed, since the target 
> pattern appears earlier in the list, but memo outputs an infinite number of 
> the target pattern. Or they generate incorrect results, like 4.31, where 
> some of the patterns do not satisfy the equivalent function (rember), like 
> (a  b _.0 d e): z can't be removed unless it unifies with y, in which case 
> y would have been removed, not z. The chapter concludes by highlighting 
> this issue with "surprise", a simple example which generates solutions that 
> don't satisfy the constraints.
>
> I was hoping, at that point, for insights into accurately translating 
> functions into their logic programming equivalents, however the chapter 
> ends with "Please pass the aspirin", and the book continues with more 
> "second commandment" examples that also produce unhelpful results.
>
> So, I'm a bit baffled about the point of this exercise. Why is it useful 
> to have a second commandment that converts functions into logic programming 
> functions that are superficially similar, but fundamentally different, 
> producing solutions that are irrelevant or incorrect for the original 
> function? Is there some different technique that would allow one to 
> generate correct solutions with logic programming?
>

-- 
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: [?] Adding my own function to clojure.core namespace

2018-02-25 Thread Philos Kim
I have another question. Debux library supports ClojureScript as well. 
Similarly, I want to add my own function or macro to cljs.core as in Clojure. 
Can I use the same strategy in ClojureScript as in Clojure if I use it in the  
ClojureScript source code, not in REPL?

-- 
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: Is there some central information available on Java 9 compatibility for Clojure and tools

2018-02-25 Thread Stuart Sierra
There's no single source, but you can find issues with Clojure and contrib 
libraries by searching the Clojure JIRA  for 
"Java 9".

Toby Crawley started a small collection of known issues at 
github.com/tobias/clojure-java-9

–S

On Sunday, February 25, 2018 at 11:01:43 AM UTC-5, Arie van Wingerden wrote:
>
> Some time ago I tried Java 9 and reverted back to 8 when I ran into 
> problems.
> Is there conclusive info on the versions which will definitely (not) work 
> correctly with Java 9?
>

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


Is there some central information available on Java 9 compatibility for Clojure and tools

2018-02-25 Thread Arie van Wingerden
Some time ago I tried Java 9 and reverted back to 8 when I ran into 
problems.

Is there conclusive info on the versions which will definitely (not) work 
correctly with Java 9?
   - Clojure itself
   - Leiningen
   - LightTable
   - etc.

-- 
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: [?] Adding my own function to clojure.core namespace

2018-02-25 Thread James Reeves
On 25 February 2018 at 12:01, Philos Kim  wrote:

> I know it is not desirable but it is sometimes needed, especially in my
> case.
>
> For example , I wrote debux ( https://github.com/philoskim/debux )
> library. I want to use it only in development, not in production. If I
> 'require' debux in source code to use it in development, I have to remove
> it in the source code manually in production.
>

The normal solution to this is to have a development namespace and a
production namespace that serve as entry points for your application.
During development you load in the dev namespace, and in production the
prod namespace will contain the -main function that starts your application.

You can omit the development namespace and anything it requires from the
production classpath when you compile the jar.

-- 
James Reeves
booleanknot.com

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To 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: [?] Adding my own function to clojure.core namespace

2018-02-25 Thread Mikhail Gusarov
Hello Philos,

> For example , I wrote debux ( https://github.com/philoskim/debux ) 
> library. I want to use it only in development, not in production. If I 
> 'require' debux in source code to use it in development, I have to 
> remove it in the source code manually in production.

Do you intend to use this library from REPL or from the code itself?
If former, you can add the library to Leiningen (or whatever) REPL environment.
If latter, how do you enable/disable the debugging code in production? You can
use the same way for requiring/not requiring library.

> I tested your recommendation in REPL and it worked. However could you 
> tell me about how I can implement it in source code form, not in REPL?

There is no difference.

Regards,
Mikhail.

On Sun, 25 Feb 2018, at 13:01, Philos Kim wrote:
> Thanks both of you!
> 
> I know it is not desirable but it is sometimes needed, especially in my case.
> 
> For example , I wrote debux ( https://github.com/philoskim/debux ) 
> library. I want to use it only in development, not in production. If I 
> 'require' debux in source code to use it in development, I have to 
> remove it in the source code manually in production.
> 
> I tested your recommendation in REPL and it worked. However could you 
> tell me about how I can implement it in source code form, not in REPL?
> 
> -- 
> 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: [?] Adding my own function to clojure.core namespace

2018-02-25 Thread Philos Kim
Thanks both of you!

I know it is not desirable but it is sometimes needed, especially in my case.

For example , I wrote debux ( https://github.com/philoskim/debux ) 
library. I want to use it only in development, not in production. If I 
'require' debux in source code to use it in development, I have to remove it in 
the source code manually in production.

I tested your recommendation in REPL and it worked. However could you tell me 
about how I can implement it in source code form, not in REPL?

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