Re: Clojure For Scripting

2016-12-08 Thread Bruce Wang
For serious ClojureScript scripting you should try http://planck-repl.org/

On Fri, Dec 9, 2016 at 7:46 AM, Asim Jalis  wrote:

> I wrote a blog post on how to quickly get started with Clojure.
>
> How To Use Clojure For Scripting
> http://asimjalis.github.io/blog/2016/12/07/clojure-for-scripting.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.
>



-- 
simple is good
http://brucewang.net
http://twitter.com/number5

-- 
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: Clojure For Scripting

2016-12-08 Thread John Gabriele
On Thursday, December 8, 2016 at 3:46:25 PM UTC-5, Asim Jalis wrote:
>
> I wrote a blog post on how to quickly get started with Clojure.
>
> How To Use Clojure For Scripting
> http://asimjalis.github.io/blog/2016/12/07/clojure-for-scripting.html
>

You might also look at [inlein](http://inlein.org/). After I've run it 
once, startup takes about a second on my desktop system.

-- 
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: Clojure For Scripting

2016-12-08 Thread Gregg Reynolds
REPL is "like doing engine repairs on a plane in flight."  nice.

On Dec 8, 2016 2:46 PM, "Asim Jalis"  wrote:

> I wrote a blog post on how to quickly get started with Clojure.
>
> How To Use Clojure For Scripting
> http://asimjalis.github.io/blog/2016/12/07/clojure-for-scripting.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.
>

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


Clojure For Scripting

2016-12-08 Thread Asim Jalis
I wrote a blog post on how to quickly get started with Clojure.

How To Use Clojure For Scripting
http://asimjalis.github.io/blog/2016/12/07/clojure-for-scripting.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: Custom generators for custom predicate functions

2016-12-08 Thread Dave Dixon
Thanks Alex. I agree it probably isn't "needed", was just a little 
surprised to discover the asymmetry. Mostly was curious if there was some 
deeper design decision, e.g. that you need to start with some set of 
primitive predicates upon which you can start building named specs.

On Thursday, December 8, 2016 at 9:23:11 AM UTC-8, Alex Miller wrote:
>
> In general, you shouldn't need to do this (it is better to attach the 
> generator to the spec). Generator mappings are provided for core Clojure 
> predicates so that many common predicates gen automatically and so that 
> they can be combined (via things like s/and) with other predicates that 
> filter but don't gen.
>
> I was not part of the design discussion, but I assume that it would open a 
> can of worms around conflicts, ordering, and function resolution that Rich 
> and Stu didn't want to open at this time. Nothing precludes this from being 
> expanded later if deemed useful.
>
> On Thursday, December 8, 2016 at 10:56:29 AM UTC-6, Dave Dixon wrote:
>>
>> Though one can obviously attach a custom generator to a keyword-named 
>> spec, it appears there is no way to do the same for a custom predicate 
>> function. I see that the generators for predicate functions testing for 
>> core primitives are hard-coded in the private 
>> clojure.spec.gen\gen-builtins. Curious why this isn't extensible, since it 
>> naively seems similar to the keyword case, but with the custom generator 
>> keyed by a symbol rather than a map.
>>
>> Dave
>>
>

-- 
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: Custom generators for custom predicate functions

2016-12-08 Thread Alex Miller
In general, you shouldn't need to do this (it is better to attach the 
generator to the spec). Generator mappings are provided for core Clojure 
predicates so that many common predicates gen automatically and so that 
they can be combined (via things like s/and) with other predicates that 
filter but don't gen.

I was not part of the design discussion, but I assume that it would open a 
can of worms around conflicts, ordering, and function resolution that Rich 
and Stu didn't want to open at this time. Nothing precludes this from being 
expanded later if deemed useful.

On Thursday, December 8, 2016 at 10:56:29 AM UTC-6, Dave Dixon wrote:
>
> Though one can obviously attach a custom generator to a keyword-named 
> spec, it appears there is no way to do the same for a custom predicate 
> function. I see that the generators for predicate functions testing for 
> core primitives are hard-coded in the private 
> clojure.spec.gen\gen-builtins. Curious why this isn't extensible, since it 
> naively seems similar to the keyword case, but with the custom generator 
> keyed by a symbol rather than a map.
>
> Dave
>

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


Custom generators for custom predicate functions

2016-12-08 Thread Dave Dixon
Though one can obviously attach a custom generator to a keyword-named spec, 
it appears there is no way to do the same for a custom predicate function. 
I see that the generators for predicate functions testing for core 
primitives are hard-coded in the private clojure.spec.gen\gen-builtins. 
Curious why this isn't extensible, since it naively seems similar to the 
keyword case, but with the custom generator keyed by a symbol rather than a 
map.

Dave

-- 
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: ClassNotFoundException in macroexpand1()

2016-12-08 Thread Alex Miller
Would really help to have a minimal example of this without your macro 
involved. I'm wondering if this is really same thing 
as http://dev.clojure.org/jira/browse/CLJ-1403 in particular.

On Thursday, December 8, 2016 at 7:54:46 AM UTC-6, Justus Adam wrote:
>
> When executing `macro expand1()` with the compiler unresolvable symbols 
> aren't an issue, except if they are fully qualified and their corresponding 
> namespace does not exist, in which case a ClassNotFoundException is thrown.
> I find this to be inconsistent behaviour, since unresolvable symbols 
> themselves do not cause such an exception.
>
> My concrete use case here (to justify this change) is that I currently 
> work on an Embedded Domain Specific Language (EDSL) in Clojure, where we 
> adopt the namespace and interned symbols idea.
> However we want to avoid polluting the clojure namespaces themselves with 
> our symbols which are only usable in our EDSL.
> Our EDSL is invoked with a macro call and the code inside this macro is 
> completely interpreted by out own compiler.
> However we want to reuse some of the Clojure internal macros, such as 
> `let` and `cond`, we therefore run a macro expand over the code before we 
> start interpreting it.
> Since our import system doesn't actually produce a clojure namespace the 
> macro expand call crashes on us if there are fully qualified symbols in the 
> EDSL code.
> I'd like to avoid having to create an empty namespace each time we do a 
> require in our EDSL and therefore propose to add a catch for the class 
> loading exception in `macroexpand()`.
>
> *Note: our compiler is able to handle fully qualified symbols and aliasing 
> without using clojures resolving*
>
> Example:
>
> This code is valid:
>
> (ns my-ns
>   (:require [com.ohua.lang :refer [ohua]]))
>
> ; This macro brings com.ohua.lang.tests into our internal scope (for 
> ohua), but does not create a namespace
> (ohua-require [com.ohua.lang.tests :refer [add]])
>
> ; this macro enters our EDSL
> (ohua
>   (add 3 4))
>
> But this code fails in macroexpand1
>
> (ns my-ns
>   (:require [com.ohua.lang :refer [ohua]]))
>
> ; This macro brings com.ohua.lang.tests into our internal scope (for 
> ohua), but does not create a namespace
> (ohua-require [com.ohua.lang.tests :refer [add]])
>
> ; this macro enters our EDSL
> (ohua
>   (com.ohua.lang.tests/add 3 4))
>
>
>

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


ClassNotFoundException in macroexpand1()

2016-12-08 Thread Justus Adam
When executing `macro expand1()` with the compiler unresolvable symbols 
aren't an issue, except if they are fully qualified and their corresponding 
namespace does not exist, in which case a ClassNotFoundException is thrown.
I find this to be inconsistent behaviour, since unresolvable symbols 
themselves do not cause such an exception.

My concrete use case here (to justify this change) is that I currently work 
on an Embedded Domain Specific Language (EDSL) in Clojure, where we adopt 
the namespace and interned symbols idea.
However we want to avoid polluting the clojure namespaces themselves with 
our symbols which are only usable in our EDSL.
Our EDSL is invoked with a macro call and the code inside this macro is 
completely interpreted by out own compiler.
However we want to reuse some of the Clojure internal macros, such as `let` 
and `cond`, we therefore run a macro expand over the code before we start 
interpreting it.
Since our import system doesn't actually produce a clojure namespace the 
macro expand call crashes on us if there are fully qualified symbols in the 
EDSL code.
I'd like to avoid having to create an empty namespace each time we do a 
require in our EDSL and therefore propose to add a catch for the class 
loading exception in `macroexpand()`.

*Note: our compiler is able to handle fully qualified symbols and aliasing 
without using clojures resolving*

Example:

This code is valid:

(ns my-ns
  (:require [com.ohua.lang :refer [ohua]]))

; This macro brings com.ohua.lang.tests into our internal scope (for ohua), 
but does not create a namespace
(ohua-require [com.ohua.lang.tests :refer [add]])

; this macro enters our EDSL
(ohua
  (add 3 4))

But this code fails in macroexpand1

(ns my-ns
  (:require [com.ohua.lang :refer [ohua]]))

; This macro brings com.ohua.lang.tests into our internal scope (for ohua), 
but does not create a namespace
(ohua-require [com.ohua.lang.tests :refer [add]])

; this macro enters our EDSL
(ohua
  (com.ohua.lang.tests/add 3 4))


-- 
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: Index of an element in a vector of vectors

2016-12-08 Thread Andy-
In that case you can use mapv:

(mapv
  (fn [xs]
(mapv
  (fn [x]
(if (= x "5")
  "XX"
  x))
  xs))
  players)


Two notes:
1. There is room for optimization if you only want to map one element. This 
currently will just keep going. A smart implementation could bail out of 
the inner loop
2. If this is something you want to do frequently you may want to use 
different data structures (probably a map) that allow you to access 
elements fast.

If you sketch your access and transform patterns then I'm sure we can 
recommend a better way.



On Thursday, December 8, 2016 at 11:13:42 AM UTC+1, Rickesh Bedia wrote:
>
> Is there a way to generalise?
>
> I.e a function that allows you to swap any of the 1-9?
>
> On Wednesday, 7 December 2016 18:06:19 UTC, Andy- wrote:
>>
>> One option is to use keep-indexed:
>>
>> (first
>>   (keep-indexed
>> (fn [i xs]
>>   (first
>> (keep-indexed
>>   (fn [j x]
>> (when (= x "5")
>>   [i j]))
>>   xs)))
>> players))
>>
>>
>>
>> On Wednesday, December 7, 2016 at 5:32:10 PM UTC+1, Rickesh Bedia wrote:
>>>
>>> If I have 
>>>
>>> (def players [["1" "2" "3"] ["4" "5" "6"] ["7" "8" "9"]])
>>>
>>> How would I get the index of number 5? I think it should be [1 1] but 
>>> don't know how to get this
>>>
>>> If it were more simple such as
>>>
>>> (def players ["1" "2" "3"])
>>>
>>> I can get the index using
>>>
>>> (.indexOf players "2") > 1
>>> (.indexOf players "3") > 2
>>>
>>>

-- 
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: Index of an element in a vector of vectors

2016-12-08 Thread 'Rickesh Bedia' via Clojure
Is there a way to generalise?

I.e a function that allows you to swap any of the 1-9?

On Wednesday, 7 December 2016 18:06:19 UTC, Andy- wrote:
>
> One option is to use keep-indexed:
>
> (first
>   (keep-indexed
> (fn [i xs]
>   (first
> (keep-indexed
>   (fn [j x]
> (when (= x "5")
>   [i j]))
>   xs)))
> players))
>
>
>
> On Wednesday, December 7, 2016 at 5:32:10 PM UTC+1, Rickesh Bedia wrote:
>>
>> If I have 
>>
>> (def players [["1" "2" "3"] ["4" "5" "6"] ["7" "8" "9"]])
>>
>> How would I get the index of number 5? I think it should be [1 1] but 
>> don't know how to get this
>>
>> If it were more simple such as
>>
>> (def players ["1" "2" "3"])
>>
>> I can get the index using
>>
>> (.indexOf players "2") > 1
>> (.indexOf players "3") > 2
>>
>>

-- 
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 "The Clojure Standard Library - Annotated Reference"

2016-12-08 Thread reborgml
Yep, I mentioned the Almanac to "senior stakeholders" while pitching the 
book :)

It was a less internet-based age, but I think there is still room for an 
offline reference.

Thanks
Renzo

On Thursday, 8 December 2016 07:05:07 UTC, Torsten Uhlmann wrote:
>
> Thanks for working on this!
>
> Back in the day I had a "Java Developers Almanac" for Java 1.4 and it 
> helped getting around the lesser used API parts, or discovering 
> functionality I hadn't used before.
>
>
> Alex Miller > schrieb am Do., 8. Dez. 
> 2016 um 04:13 Uhr:
>
>> This is a good gotcha. From Clojure's perspective this is just 
>> referencing a Java field (which could be mutable and NOT a constant). Maybe 
>> it would be possible to reflectively determine that this field is actually 
>> a constant and make it work, not sure.
>>
>> The number one special case I see people ask about with case though is 
>> Java class constants (which are *not* constants and don't work). One 
>> workaround is to use the class name as a string.
>>
>>
>> On Wednesday, December 7, 2016 at 5:43:28 PM UTC-6, Ryan Fowler wrote:
>>>
>>> I love the idea.
>>>
>>> ​A gotchas section of some sort could be useful. For instance, a detail 
>>> about `case` to consider mentioning is that Java Constants don't work as 
>>> tests.
>>>
>>> ryans-mbp:~% cat test.clj
>>> (let [incoming-character Character/LINE_SEPARATOR]
>>>   (println "case w/ constant"
>>>(case incoming-character
>>>  Character/LINE_SEPARATOR :line-separator
>>>  :unknown))
>>>   (println "case w/ int "
>>>(case incoming-character
>>>  13 :line-separator
>>>  :unknown)))
>>>
>>> ryans-mbp:~% java -jar $CLOJURE test.clj
>>> case w/ constant :unknown
>>> case w/ int  :line-separator
>>>
>>> ​I think I understand why this doesn't work but it feels like it should 
>>> work. And without prior knowledge, I don't think I would assume that 
>>> constants don't work.
>>>
>>> ​Ryan​
>>>
>>>
>>> On Wed, Dec 7, 2016 at 4:57 PM, Alex Miller >> > wrote:
>>>
 This is a cool idea so thanks for working on it.

 I was going to buy this (as I buy most of the Clojure books that come 
 out) but $48 for an unfinished ebook put me off so I didn't. I totally get 
 why a physical book of this length would be that much (because paper is 
 expensive right now), but I don't get it with the ebook (particularly EA)? 
 I know you likely have little control over this, so it's not really fair 
 to 
 complain to you, but maybe you can feed it back to your editor.

 While pretty thorough, that case description is still lacking a 
 description of one important feature - grouping multiple tests that have 
 the same output in a list. Basically this line from the doc string:

 (test-constant1 ... test-constantN)  result-expr


 Example:

 (case 3
   (1 2 3) "1, 2, or 3"
   4 "4"
   (5 6 7) "5, 6, or 7")

 ;;=> "1, 2, or 3"

 I think most people are unaware of this feature and seems like it's the 
 kind of thing you'd want in the book.

 Alex

 On Wednesday, December 7, 2016 at 12:14:29 PM UTC-6, Renzo Borgatti 
 wrote:
>
> Hi all, 
>
> I'm very happy to announce the early access of a new book: "Clojure 
> Standard Library - Annotated Reference" by Manning. Although it's a 
> reference of the roughly 700+ functions (and macros) coming out of the 
> box 
> with the Clojure jar file, it is not designed to read as a boring list. 
> Think of all the Stackoverflow, mailing lists, ClojureDocs, articles, 
> blogs 
> all mashed together to create an essay for each function. The book 
> website 
> is: 
>
> https://www.manning.com/books/clojure-standard-library 
>
> It contains now a total of 4 chapters (around 200 pages) or ~30 
> functions, starting with some of the most important available in the 
> standard library. Here's a sample of “case" how it appears on the book 
> http://tinyurl.com/hekc55u to give you an idea of the kind of 
> treatment they get. Needless to say any feedback is highly appreciated. 
> Any 
> question please shout here, personally at reborg*at*reborg.net or on 
> the book forum. 
>
> Regards, 
> Renzo 
>
 -- 
 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 unsubscribe from this group an

Re: [ANN] Book "The Clojure Standard Library - Annotated Reference"

2016-12-08 Thread reborgml
Thanks Ryan, added this (and Alex's) to the book issues tracker. Will land 
in the following releases.

On Wednesday, 7 December 2016 23:43:28 UTC, Ryan Fowler wrote:
>
> I love the idea.
>
> ​A gotchas section of some sort could be useful. For instance, a detail 
> about `case` to consider mentioning is that Java Constants don't work as 
> tests.
>
> ryans-mbp:~% cat test.clj
> (let [incoming-character Character/LINE_SEPARATOR]
>   (println "case w/ constant"
>(case incoming-character
>  Character/LINE_SEPARATOR :line-separator
>  :unknown))
>   (println "case w/ int "
>(case incoming-character
>  13 :line-separator
>  :unknown)))
>
> ryans-mbp:~% java -jar $CLOJURE test.clj
> case w/ constant :unknown
> case w/ int  :line-separator
>
> ​I think I understand why this doesn't work but it feels like it should 
> work. And without prior knowledge, I don't think I would assume that 
> constants don't work.
>
> ​Ryan​
>
>
> On Wed, Dec 7, 2016 at 4:57 PM, Alex Miller  > wrote:
>
>> This is a cool idea so thanks for working on it.
>>
>> I was going to buy this (as I buy most of the Clojure books that come 
>> out) but $48 for an unfinished ebook put me off so I didn't. I totally get 
>> why a physical book of this length would be that much (because paper is 
>> expensive right now), but I don't get it with the ebook (particularly EA)? 
>> I know you likely have little control over this, so it's not really fair to 
>> complain to you, but maybe you can feed it back to your editor.
>>
>> While pretty thorough, that case description is still lacking a 
>> description of one important feature - grouping multiple tests that have 
>> the same output in a list. Basically this line from the doc string:
>>
>> (test-constant1 ... test-constantN)  result-expr
>>
>>
>> Example:
>>
>> (case 3
>>   (1 2 3) "1, 2, or 3"
>>   4 "4"
>>   (5 6 7) "5, 6, or 7")
>>
>> ;;=> "1, 2, or 3"
>>
>> I think most people are unaware of this feature and seems like it's the 
>> kind of thing you'd want in the book.
>>
>> Alex
>>
>> On Wednesday, December 7, 2016 at 12:14:29 PM UTC-6, Renzo Borgatti wrote:
>>>
>>> Hi all, 
>>>
>>> I'm very happy to announce the early access of a new book: "Clojure 
>>> Standard Library - Annotated Reference" by Manning. Although it's a 
>>> reference of the roughly 700+ functions (and macros) coming out of the box 
>>> with the Clojure jar file, it is not designed to read as a boring list. 
>>> Think of all the Stackoverflow, mailing lists, ClojureDocs, articles, blogs 
>>> all mashed together to create an essay for each function. The book website 
>>> is: 
>>>
>>> https://www.manning.com/books/clojure-standard-library 
>>>
>>> It contains now a total of 4 chapters (around 200 pages) or ~30 
>>> functions, starting with some of the most important available in the 
>>> standard library. Here's a sample of “case" how it appears on the book 
>>> http://tinyurl.com/hekc55u to give you an idea of the kind of treatment 
>>> they get. Needless to say any feedback is highly appreciated. Any question 
>>> please shout here, personally at reborg*at*reborg.net or on the book 
>>> forum. 
>>>
>>> Regards, 
>>> Renzo 
>>>
>> -- 
>> 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 unsubscribe from this group and stop receiving emails from it, send an 
>> email to clojure+u...@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] Book "The Clojure Standard Library - Annotated Reference"

2016-12-08 Thread reborgml
Hey Alex, many good points and great feedback. More inline. 

On Wednesday, 7 December 2016 22:57:07 UTC, Alex Miller wrote:
>
> This is a cool idea so thanks for working on it.
>
> I was going to buy this (as I buy most of the Clojure books that come out) 
> but $48 for an unfinished ebook put me off so I didn't. I totally get why a 
> physical book of this length would be that much (because paper is expensive 
> right now), but I don't get it with the ebook (particularly EA)? I know you 
> likely have little control over this, so it's not really fair to complain 
> to you, but maybe you can feed it back to your editor.
>

I'm also concerned about the price tag at this stage in the book. If this 
was a finished work of 1200 pages (which is a better estimate IMHO) maybe 
it would be appropriate. More in general I've changed my mind overtime 
around the book project. At the beginning was great to start with Manning 
(and still is a decent experience), but as an afterthought this would have 
been better placed as a lean-pub (or similar) and made it a community 
effort (BTW I'm searching collaborators and co-authors anyway). But this is 
where we are now. To make it easier for people to check out the book at the 
moment:

* there is a promotion lasting until today 50% 
off: https://twitter.com/ManningBooks/status/806541284722806785 I'll ask 
Manning to make more of those.
* I'll add 3 function examples to the free downloadable material
* I'm asking Manning to have a website for the book with the HTML version 
on it, with a suitable business model (like buy 10-50-100 functions offers 
browsable online).
* In general (not just you) please post concerns on the book forum so 
Manning can 
listen: https://forums.manning.com/forums/clojure-standard-library


While pretty thorough, that case description is still lacking a description 
of one important feature - grouping multiple tests that have the same 
output in a list. Basically this line from the doc string:

>
> (test-constant1 ... test-constantN)  result-expr
>
>
> Example:
>
> (case 3
>   (1 2 3) "1, 2, or 3"
>   4 "4"
>   (5 6 7) "5, 6, or 7")
>
> ;;=> "1, 2, or 3"
>
> I think most people are unaware of this feature and seems like it's the 
> kind of thing you'd want in the book.
>

Totally. And as this one I'm pretty sure expert readers will find lacking 
information or worse, inaccuracies. This is the kind of feedback I'd really 
like, because even if I'm dissecting sources and everything else, I'm 
pretty sure I'll always miss something.

Thanks
Renzo
 

>
> Alex
>
> On Wednesday, December 7, 2016 at 12:14:29 PM UTC-6, Renzo Borgatti wrote:
>>
>> Hi all, 
>>
>> I'm very happy to announce the early access of a new book: "Clojure 
>> Standard Library - Annotated Reference" by Manning. Although it's a 
>> reference of the roughly 700+ functions (and macros) coming out of the box 
>> with the Clojure jar file, it is not designed to read as a boring list. 
>> Think of all the Stackoverflow, mailing lists, ClojureDocs, articles, blogs 
>> all mashed together to create an essay for each function. The book website 
>> is: 
>>
>> https://www.manning.com/books/clojure-standard-library 
>>
>> It contains now a total of 4 chapters (around 200 pages) or ~30 
>> functions, starting with some of the most important available in the 
>> standard library. Here's a sample of “case" how it appears on the book 
>> http://tinyurl.com/hekc55u to give you an idea of the kind of treatment 
>> they get. Needless to say any feedback is highly appreciated. Any question 
>> please shout here, personally at reborg*at*reborg.net or on the book 
>> forum. 
>>
>> Regards, 
>> Renzo 
>>
>

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