Inside Clojure Journal

2019-01-29 Thread Shaun Parker
I just wanted to say thanks to Alex for taking the time to journal all the 
Clojure things he's working on (and the non-Clojure things as well). 
They're enjoyable to read and eye-opening. It's a great window into the 
effort that he and others are putting into Clojure. It's been fun to follow 
the spec-alpha2 commits and get to read the thoughts/direction in the 
journal. Great work Alex!

You can find them on the Inside Clojure blog: http://insideclojure.org/

Shaun


-- 
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: Russ olsen's Clojure Book

2018-01-22 Thread Shaun Parker
The book is now available to purchase. Thanks Russ, I can't wait to read it!

https://pragprog.com/book/roclojure/getting-clojure

On Wednesday, January 17, 2018 at 5:12:15 PM UTC-7, William Swaney wrote:
>
> Thanks Sean.
>
> On Tuesday, January 16, 2018 at 8:08:22 PM UTC-8, Sean Corfield wrote:
>>
>> https://pragprog.com/book/roclojure/getting-clojure -- “This title will 
>> be available on or about 2018-08-10.”
>>
>>  
>>
>> I’m a bit surprised it wasn’t available under their Beta program…
>>
>>  
>>
>> Sean Corfield -- (970) FOR-SEAN -- (904) 302-SEAN
>> An Architect's View -- http://corfield.org/
>>
>> "If you're not annoying somebody, you're not really alive."
>> -- Margaret Atwood
>>
>>  
>> --
>> *From:* clo...@googlegroups.com  on behalf of 
>> William Swaney 
>> *Sent:* Saturday, January 13, 2018 4:53:00 PM
>> *To:* Clojure
>> *Subject:* Re: Russ olsen's Clojure Book 
>>  
>> Any idea when it'll be published? I don't see it at Pragmatic's site yet, 
>> nor at Amazon.
>>
>> Bill
>>
>> On Wednesday, June 29, 2011 at 8:09:56 PM UTC-7, Sayth Renshaw wrote: 
>>>
>>>
>>> Just wanted to put a shout out to Russ Olsen to see what would be 
>>> needed to get a Russ Olsen book on clojure to happen. I am reading 
>>> design principles in Ruby and its a great read, I feel I am learning 
>>> much moe than just Ruby which is why I am reading it. 
>>>
>>> I woould absolutely love to read how Russ would apply these design 
>>> principles to Clojure a more functional language. His books are all 5 
>>> star reads(amazon ratings) and would greatly enjoy being able to read 
>>> a Russ Olsen clojure book. 
>>>
>>> Is there any way we could help this to happen? Is anyone else 
>>> interested in such a book? 
>>>
>>> Sayth
>>
>> -- 
>> 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] walmartlabs/system-viz 0.2.0

2018-01-20 Thread Shaun Parker
I just gave this a try on a couple systems. It worked perfectly and is a 
helpful visual aid. Great work, thanks Howard!

Shaun

On Friday, January 19, 2018 at 2:48:47 PM UTC-7, Howard M. Lewis Ship wrote:
>
> system-viz is a tiny, simple library to visualize a system, constructed 
> using Stuart Sierra's component library.
>
> This release allows the diagram to be laid out horizontally, and allows 
> the GraphViz source of the document to be saved.
>
> https://github.com/walmartlabs/system-viz
>
> -- 
> Howard M. Lewis Ship
>
> Senior Mobile Developer at Walmart Labs
>
> Creator of Apache Tapestry
>
> (971) 678-5210
> http://howardlewisship.com
> @hlship
>

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


User error causes spec to freeze

2017-11-20 Thread Shaun Parker
I thought I'd put this note out in case anyone happens to run into spec 
functions freezing (e.g conform, valid?).

I had a large namespace of specs, where one spec was just an alias of 
another:

(s/def ::a int?)

;; other definitions

(s/def ::b ::a)

At a later point, I no longer needed the specificity of the ::b key, so I 
did a rename refactoring of ::b to ::a. I was a bit careless and didn't 
notice that my namespace now looked like:

(s/def ::a int?)

;; other definitions

(s/def ::a ::a)

Any usage of ::a caused spec to hang:

(s/conform ::a 10)

;; get coffee and contemplate the meaning of life, the universe, and 
everything

I'm not sure if makes sense to add any checks to prevent this from 
happening, but hopefully it helps if anyone accidentally does this.

Cheers,
Shaun

-- 
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: Source Code for Stuart Halloway's ETL Talk

2017-03-10 Thread Shaun Parker
Thanks for the update Alex. I can't wait to read the third edition of 
Programming Clojure!

On Thursday, March 9, 2017 at 7:05:52 PM UTC-7, Alex Miller wrote:
>
> He has not yet released it but he is still planning to do so.

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


Source Code for Stuart Halloway's ETL Talk

2017-03-09 Thread Shaun Parker
Does anyone know if Stuart released the source code from his presentation 
*Simplifying 
ETL with Clojure and Datomic *? 
If not, is there any timetable on releasing it?

I just watched the presentation and am now hoping to review the source. Any 
help is greatly appreciated.

Cheers,
Shaun

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

2016-05-23 Thread Shaun Parker
Thanks to everyone who worked on it! I'm excited there's finally an 
idiomatic way and can't wait to use it.

Is there any chance the three clojure.spec namespaces will be released as a 
library that could be use until 1.9.0 is released? It seems like we'd only 
be missing compile time macro checking/reporting and the updated 
clojure.repl/doc unless I'm missing something. It'd be nice to start 
gradually using everything else now.

On Monday, May 23, 2016 at 3:20:36 PM UTC-6, Rich Hickey wrote:
>
> I did most of the design of spec in a (paper) notebook. 
>
> The rationale tries to capture the salient driving forces. 
>
> If there is a specific question you have I’d be happy to answer. 
>
> Rich 
>
> > On May 23, 2016, at 4:11 PM, Ivan Reese  
> wrote: 
> > 
> > Is there anywhere we can read anything about the design process behind 
> clojure.spec? I took a look at dev.clojure.org / JIRA, but I haven't yet 
> found anything on the topic. 
> > 
> > -- 
> > 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: Question about best pattern for side-effecting function with a return value

2014-02-10 Thread Shaun Parker
Hey Jarrod,

Whenever I find myself writing out steps, like you just did, I like to use 
a method described by Stuart Sierra, 
pipelineshttp://stuartsierra.com/2012/05/16/syntactic-pipelines. 
In your case, I'd write something like this:

(defn make-api-call!
  [{:keys [db-entity] :as state}]
  (let [result (client/post https://cool-api.com/entity;
{:form-params {:x 42 :y (:id db-entity) ...}})
status (:status result)]
(assoc state :api-result result
 :api-call-successful? (= 200 status 299

(defn write-response!
  [{:keys [api-result] :as state}]
  (let [file ...]
(spit file (:body api-result))
(assoc state :api-result-file file)))

(defn update-db-entity!
  [{:keys [db-entity] :as state}]
  (let [updated-db-entity (...)]
(assoc state :db-entity updated-db-entity)))

(defn process-api-result!
  [{:keys [api-call-successful?] :as state}]
  (- state
  (update-db-entity!)
  (cond-
api-call-successful? (write-response!

(defn api-call-pipeline!
  [db-entity]
  (- {:db-entity db-entity}
  (make-api-call!)
  (process-api-result!)
  ;; do whatever you want with the state, for now return the entity and 
the result file
  (select-keys [:db-entity :api-result-file])))


In this example you'd just call api-call-pipeline! with the database 
entity. This lets you test each of these steps in isolation. Hope that 
helps!

Shaun

On Monday, February 10, 2014 3:07:22 PM UTC-7, Jarrod Swart wrote:

 I'm having a hard time coming up with a satisfactory way to implement the 
 following:


1. Call an API with a map from the DB containing various endpoint data 
like URL, etc.
2. If the response has an HTTP 200, update the map-from-db and then 
write response body to a file.
3. If step 2 yields a HTTP  2xx, update the map-from-db but do not 
write file

 Because this is mostly imperative it feels icky in Clojure.  I would 
 just call the api query function mapped across them all, but I am making 
 many API requests and writing many files.  It seemed better to attempt them 
 one at a time.  Is this wrong-headed?

 Suggestions?



-- 
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/groups/opt_out.


Re: Question about best pattern for side-effecting function with a return value

2014-02-10 Thread Shaun Parker
Hey Jarrod,

You're welcome! I'm glad to hear that's helpful. As far as using map or 
doseq; I'd use map if you want to use the results for further processing, 
if not, I'd use doseq. This is a guess, but it seems like you don't have 
any need for the results, you just want the side effects of updating the DB 
and storing the file, so I'd just use doseq. I hope that helps!

Shaun

On Monday, February 10, 2014 7:15:05 PM UTC-7, Jarrod Swart wrote:

 Shaun,

 Thanks a lot for your response.  

 This is a much nicer version of what I came up with.  I have one question 
 remaining: would you (map) over a seq of db-entities or would you use 
 something else (doseq, for, etc).

 I typically use map/filter/reduce 99% of the time and I'm just wander if 
 (map api-call-pipeline! seq-of-db-entities) is idiomatic in this case.

 Best,
 Jarrod

 On Monday, February 10, 2014 7:36:49 PM UTC-5, Shaun Parker wrote:

 Hey Jarrod,

 Whenever I find myself writing out steps, like you just did, I like to 
 use a method described by Stuart Sierra, 
 pipelineshttp://stuartsierra.com/2012/05/16/syntactic-pipelines. 
 In your case, I'd write something like this:

 (defn make-api-call!
   [{:keys [db-entity] :as state}]
   (let [result (client/post https://cool-api.com/entity;
 {:form-params {:x 42 :y (:id db-entity) ...}})
 status (:status result)]
 (assoc state :api-result result
  :api-call-successful? (= 200 status 299

 (defn write-response!
   [{:keys [api-result] :as state}]
   (let [file ...]
 (spit file (:body api-result))
 (assoc state :api-result-file file)))

 (defn update-db-entity!
   [{:keys [db-entity] :as state}]
   (let [updated-db-entity (...)]
 (assoc state :db-entity updated-db-entity)))

 (defn process-api-result!
   [{:keys [api-call-successful?] :as state}]
   (- state
   (update-db-entity!)
   (cond-
 api-call-successful? (write-response!

 (defn api-call-pipeline!
   [db-entity]
   (- {:db-entity db-entity}
   (make-api-call!)
   (process-api-result!)
   ;; do whatever you want with the state, for now return the entity 
 and the result file
   (select-keys [:db-entity :api-result-file])))


 In this example you'd just call api-call-pipeline! with the database 
 entity. This lets you test each of these steps in isolation. Hope that 
 helps!

 Shaun

 On Monday, February 10, 2014 3:07:22 PM UTC-7, Jarrod Swart wrote:

 I'm having a hard time coming up with a satisfactory way to implement 
 the following:


1. Call an API with a map from the DB containing various endpoint 
data like URL, etc.
2. If the response has an HTTP 200, update the map-from-db and then 
write response body to a file.
3. If step 2 yields a HTTP  2xx, update the map-from-db but do not 
write file

 Because this is mostly imperative it feels icky in Clojure.  I would 
 just call the api query function mapped across them all, but I am making 
 many API requests and writing many files.  It seemed better to attempt them 
 one at a time.  Is this wrong-headed?

 Suggestions?



-- 
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/groups/opt_out.