Re: [ANN] Clojure 1.10.0-beta1

2018-10-10 Thread Josh Tilles
I recently stumbled across this little example by Ghadi Shayban 

 
that helped *both* prepl and tap click for me:

$ clj -Sdeps '{:deps {org.clojure/clojure {:mvn/version "1.10.0-beta2"}}}'
Clojure 1.10.0-beta2
user=> ;; launch a nested PREPL that steals this REPL’s *in* / *out* streams
user=> (clojure.core.server/io-prepl)
:bar
{:tag :ret, :val ":bar", :ns "user", :ms 0, :form ":bar"}
(defn my-broken-function [x]
  (tap> x)
  (prn "some output")
  (tap> x)
  :bar)
{:tag :ret, :val "#'user/my-broken-function", :ns "user", :ms 223, :form 
"(defn my-broken-function [x]\n  (tap> x)\n  (prn \"some output\")\n  (tap> 
x)\n  :bar)"}

(my-broken-function 24)
{:tag :out, :val "\"some output\"\n"}
{:tag :ret, :val ":bar", :ns "user", :ms 2, :form "(my-broken-function 24)"}
{:tag :tap, :val "24"}
{:tag :tap, :val "24"}

:repl/quit
nil
user=> ^D


On Tuesday, October 9, 2018 at 10:32:38 AM UTC-4, Colin Fleming wrote:
>
> I’m not sure a guide is needed for tap - the functions are pretty simple?
>>
>
> Personally, I understand the mechanics, but I have no idea how they're 
> intended to be used. I'd love to see some examples of what they're designed 
> to do.
>
> On Sat, 6 Oct 2018 at 12:17, Alex Miller  > wrote:
>
>>
>> > On Oct 6, 2018, at 3:53 AM, Mike <145...@gmail.com > 
>> wrote:
>> > 
>> > Cool! Will there be more guides how to use tap and prepl ?
>>
>> I’m not sure a guide is needed for tap - the functions are pretty simple? 
>> I’ll think about it.
>>
>> prepl is designed for tool makers so is probably a limited audience and 
>> not really a good target for a guide. The docstrings have a lot more detail 
>> and may lead to some updated reference material.
>>
>> > Is there any plans to release  clj for windows?
>>
>> Yes, but I can’t give you a timeframe. Significant work has been done.
>>
>> -- 
>> 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: accessing symbols in local context of a closure

2018-05-25 Thread Josh Tilles
My curiosity got the better of me:
(require '[clojure.spec.alpha :as spec]
 '[clojure.test :refer [is with-test]])

(spec/fdef local-bindings
  :args (spec/cat :closure fn?)
  :ret (spec/map-of simple-keyword? any?))

(with-test
  (defn local-bindings [closure]
(into {} 
  (map (fn [^java.lang.reflect.Field field]
 [(keyword (.getName field))
  (do
(.setAccessible field true)  ; The closed-over locals 
are not public.
(.get field closure))]))
  (.getDeclaredFields (class closure
  (is (= {:x 3}  (local-bindings (constantly 3
  (is (= {}  (local-bindings constantly)))
  (is (= {:f first
  :g second} (local-bindings (juxt first second)

I would *not* rely on this code, though. It definitely feels like a hack.
On Thursday, May 24, 2018 at 2:22:42 PM UTC-4, Sonny To wrote:
>
> (defn foo[]
>  (let [x  1]
>(fn []  
>  (+ x 1)
> )
>  )
>
> (def bar  (foo))
>
> Is there a way to get the value of x from closure bar?
>

-- 
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: Your choice

2018-01-15 Thread Josh Kamau
And you do all this in Clojure ?   ;)


On Mon, Jan 15, 2018 at 9:11 PM,  wrote:

> 1. We can guarantee the quality of the product.
>
> 2. Fast and safe delivery (INTERNATIONAL)- ( E-mail.. dave joine company
> @ gmail . com  ).
>
> 3. USA ( call/text  (469) 772-0415 or (406) 201 9486 <(406)%20201-9486>-
> WHATSAPP (315) 659 0211 <(315)%20659-0211> ) available for all.
>
> 4. We can provide competitive price for you. The more you buy , the lower
> the price will be.
>
> 5. We are an experienced enterprise of manufacturing various kind of
> Organic intermediates, Our customers come from all parts of the world, had
> a very good cooperation between us.Customer very pleased with our products.
>
> 6.We can provide you stable quality, high purity, good packaging at most
> competitive price. We supply and export high quality and purity research
> # in both large and small quantities…our products is as below:Our
> products are of High purity (above 99%)
>
> --
> 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: Spec - is there any way to tell which keys are not described by a spec?

2018-01-05 Thread Josh Tilles
I think Stu Halloway’s proof-of-concept is at least close to what you want: 
https://gist.github.com/stuarthalloway/f4c4297d344651c99827769e1c3d34e9.

(Here’s the context 
 for that 
code, in case you were curious.)

btw, you might want to take a look at the spec-provider 
 library, too. It’s not 
exactly what you were asking for, but I think it could help you quickly 
create (rough, approximate) specs that incorporate all witnessed keys.

On Friday, January 5, 2018 at 11:49:15 AM UTC-5, Lucas Wiener wrote:
>
> Hi,
>
> I'm writing a spec for a fairly complex data structure. One thing that I 
> have identified troublesome is that I currently have no clue how "well" my 
> spec describes my data. I keep iterating the spec, thinking that I have 
> described all fields but then it turns out later that I've missed 
> something. I would love some kind of functionality that tells me which keys 
> are present in my data that are not described in my spec. I'm aware of the 
> design principle that a spec should not be limiting to having extra data 
> and I totally support that. However, at development time I think it would 
> be useful to have something that tells me "keys :x, :y, :z are not in the 
> spec" or "the spec describes a subset of the given data". Is this possible?
>
> Kind Regards
> Lucas Wiener
>

-- 
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: Can't stop the system component

2017-06-06 Thread Josh Tilles
Dmitry,

You need to return the updated component from start and stop. (See the 
relevant section of the documentation 
<https://github.com/stuartsierra/component/tree/component-0.3.2#creating-components>.)
 In 
your code, the start implementations are returning a keyword and the stop 
implementations are returning nil. (The value of a (println ,,,) expression 
is nil.)

I hope that helps,
Josh

P.S. You should be able to just use component/start; you shouldn’t need to 
use component/start-system explicitly.

On Tuesday, June 6, 2017 at 10:42:22 AM UTC-4, D.Bushenko wrote:
>
> Hi all,
>
> I've tried following the guide to the component and have two functions: 
> start-all and stop-all. The start-all works as expected, but stop-all fails 
> completely. Can anyone have a look at the code attached and help me figure 
> out what is it wrong there?
>
> Dmitry
>

-- 
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: with-open pattern

2017-05-04 Thread Josh Tilles
I think the “reducible streams” approach described by Paul Stadig here 
 has potential. It 
might not cover all of the scenarios you’re thinking of, though.

On Thursday, May 4, 2017 at 1:35:48 PM UTC-4, Brian Craft wrote:
>
> The with-open style is used a lot in the jdbc lib, and elsewhere. It's 
> pretty simple when data is very small, as you can just evaluate the entire 
> result with doall, etc.
>
> How do you deal with larger data, where you need to evaluate iteratively? 
> If there's only one with-open it can be reasonably simple to pass the 
> consumer into that context (though from ring it's pretty convoluted, due to 
> needing to pass control to ring first). But if there are multiple with-open 
> you have to nest them, with a continuation passing style, or middleware 
> pattern, or something, which quickly becomes onerous as it affects all the 
> code surrounding the with-open.
>
> Is there some simpler pattern?
>

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


"Soft" failures with spec?

2017-02-17 Thread Josh Tilles
Has anyone explored using spec for “soft” failures? For example, if I’m writing 
an ETL system to migrate legacy customer account data, all I might require of a 
record’s :created field is that the value is a syntactically valid date-time 
string. If any record claimed that it was created on 
"1970-01-01T00:00:00.000Z", of course that would almost certainly be bad data; 
but instead of crashing the program or refusing to process the record, let’s 
say I want to log (at the WARN level) some of that record’s data, or perhaps 
even store the output of s/explain-data with the record in the target database. 
To describe it another way: I’m interested in taking spec beyond “application 
correctness” to also encode business/domain logic about data “smells”.

I’ve come up with two possible approaches to implementation:
1. Use different specs, potentially passing over the data multiple times.
2. Use a single spec, but have rules for what ::s/problems are acceptable.

So, what do you think? Has anyone tried anything along these lines? Does this 
sound fundamentally wrongheaded, trying to make spec do something it’s 
ill-suited for?

Cheers,


Josh Tilles

79 Madison Ave, 4th Floor
New York, New York 10016

Tel: (646) 685-8379 <tel:+16466858379>
signafire.com <http://www.signafire.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: Version control at the function level - a la Rich

2017-02-17 Thread Josh Tilles
I’m pretty sure you’re looking for codeq: 
http://blog.datomic.com/2012/10/codeq.html

On Friday, February 17, 2017 at 4:39:12 PM UTC-5, Terje Dahl wrote:
>
> I recall Rich Hickey talking about this a few years back, but can't find 
> anything about it.  
> Am I just imaging it?
> Or could someone point me in the right direction
>

-- 
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: spec and à la carte conformance of map vals (and maybe a bug)

2017-02-02 Thread Josh Tilles
Sean,
Thank you for sharing your input and code! Although I am interested by what
you shared about your team’s usage of spec, I don’t believe it addresses my
original problem of wanting to omit conformers when registering specs, yet
later opt in to use a conformer when *consuming* the specs.


--
Josh Tilles
[image: Signafire logo]
79 Madison Ave, 4th Floor
New York, New York 10016

Tel: (646) 685-8379 <+16466858379>
signafire.com <http://www.signafire.com/>
--

On Sat, Jan 14, 2017 at 8:03 PM, Sean Corfield <s...@corfield.org> wrote:

> At World Singles, we use clojure.spec for that scenario: conforming /
> validating string input data and producing non-string conformed values.
>
>
>
> For each string-to-non-string type, we write a conformer that accepts the
> string and either produces the valid, parsed non-string valid or produces
> ::s/invalid. If we need further constraints on the non-string value, we use
> s/and to combine those.
>
>
>
> We also have generators for all of these: we use gen/fmap of a
> non-string-to-string formatter over a (custom) generator for the non-string
> values.
>
>
>
> Here’s an example, for string input representing dates:
>
>
>
> (defn coerce->date
>
>   "Given a string or date, produce a date, or throw an exception.
>
>   Low level utility used by spec predicates to accept either a
>
>   date or a string that can be converted to a date."
>
>   [s]
>
>   (if (instance? java.util.Date s)
>
> s
>
> (-> (tf/formatter t/utc "/MM/dd" "MM/dd/"
>
>   "EEE MMM dd HH:mm:ss zzz ")
>
> (tf/parse s)
>
> (tc/to-date
>
>
>
> (defn ->date
>
>   "Spec predicate: conform to Date else invalid."
>
>   [s]
>
>   (try (coerce->date s)
>
>(catch Exception _ ::s/invalid)))
>
>
>
> (defmacro api-spec
>
>   "Given a coercion function and a predicate / spec, produce a
>
>   spec that accepts strings that can be coerced to a value that
>
>   satisfies the predicate / spec, and will also generate strings
>
>   that conform to the given spec."
>
>   [coerce str-or-spec & [spec]]
>
>   (let [[to-str spec] (if spec [str-or-spec spec] [str str-or-spec])]
>
> `(s/with-gen (s/and (s/conformer ~coerce) ~spec)
>
>(fn [] (g/fmap ~to-str (s/gen ~spec))
>
>
>
> (s/def ::dateofbirth (api-spec ->date #(dt/format-date % "MM/dd/")
> inst?))
>
>
>
> 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
>
>
>
> On 1/13/17, 9:56 PM, "Josh Tilles" <clojure@googlegroups.com on behalf of
> j...@signafire.com> wrote:
>
>
>
> Alex,
>
>
>
> Thank you for your reply! (I apologize for the delay in my own.)
>
>
>
> I’ll first address your final point (regarding what spec is buying me vs.
> just using normal functions): I’m still trying to figure that out myself!
>  I.e., the boundaries of spec’s applicability/appropriateness are not
> yet apparent to me.
>
>
>
> Second, your suggestion of an explicit coercion step *before* using spec
> to validate the map indicates to me that we were envisioning different
> things, although perhaps I’ve misunderstood the role of spec’s conformers.
> I was thinking about a situation like processing maps of named timestamps
> that originated as JSON sent over HTTP. The maps’ JSON origins force the
> timestamp values to be strings, but it would be a lot more convenient for
> downstream processing if the timestamps were in a format more structured
> than a string, like a map (akin to how s/cat specs conform, perhaps with
> :year, :month and :day components) or even an org.joda.time.DateTime
> instance. Hence, in this hypothetical code, I’d like to ensure the strings
> nested in the maps look properly timestamp-y before preparing the data for
> downstream processing by converting the strings to the more-structured
> format. So the coercions I had in mind would make more sense as a *post*-step
> to validation, but does this seem like an inappropriate application of
> conformers to you? I’d thought that s/conform was meant for this kind of
> validate-then-convert behavior, but I see how coercion *before* validation
> would be valuable in a different way, enabling more-granular specification,
> with more-focused predicate implementations and more-precise error
> reporting.
>
>
>
> Ultimately, I’m trying to dis

Re: structuring parallel code

2017-01-30 Thread Josh Tilles
If your goal is “to operate on large data structures in parallel” then 
you’ll probably find Clojure’s reducers library 
 to be helpful.

On Monday, January 30, 2017 at 9:38:01 PM UTC-5, Brian Craft wrote:
>
> ans: this scales badly.
>
> There must be a way in clojure to operate on large data structures in 
> parallel, no?
>
> On Monday, January 30, 2017 at 6:03:39 PM UTC-8, Brian Craft wrote:
>>
>> Would this not scale badly? When the vector is hundreds of thousands, or 
>> millions?
>>
>> On Monday, January 30, 2017 at 5:54:32 PM UTC-8, tbc++ wrote:
>>>
>>> Instead of looking at the state as a ref with a vector in it, think of 
>>> it as a vector of refs. That then allows multiple refs to be modified at 
>>> once without stepping on other unrelated refs. 
>>>
>>> On Mon, Jan 30, 2017 at 5:26 PM, Brian Craft  wrote:
>>>
 I'm experimenting with ref, dosync, and alter to run some code in 
 parallel, but so far haven't been able to figure out how to structure it 
 such that it runs faster, instead of slower.

 The problem looks something like this.

 The current state is a long vector. Input is a long sequence of values. 
 At each step some positions in the vector are populated, if empty, based 
 on 
 computations over the next value in the sequence.

 It's like placing puzzle pieces: search for positions that satisfy a 
 constraint, and fill them.

 Using threads, I'd like to place the next several values in parallel. 
 But running in parallel it's possible that two threads would find 
 solutions 
 that conflict. In this case, the latter one must continue searching.

 Is there a way to express this with clojure? The problem is that I 
 can't tell 'dosync' when a previous transaction invalidates the current 
 transaction: it just always retries.

 e.g. if each thread is doing


 (dosync
   (let [positions (find-positions next-value @state)]
(alter state (fn [s] (update-state s positions))

 they interfere with each other constantly, because any write to 'state' 
 causes the other threads to retry, even if their positions are still free.

 One really wants to reverse the order of find-positions and dosync 
 here, so it computes positions, then tries to commit them, checking in the 
 transaction that the positions are still free, and continuing the search 
 if 
 they're not.

 I suppose there's some solution involving exceptions. Is there a better 
 way to think about this?

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

>>>
>>>
>>>
>>> -- 
>>> “One of the main causes of the fall of the Roman Empire was that–lacking 
>>> zero–they had no way to indicate successful termination of their C 
>>> programs.”
>>> (Robert Firth) 
>>>
>>

-- 
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.core.match/match: very strange behavior

2017-01-30 Thread Josh Tilles
I’m not 100% sure about any of this, but I think you’re tripping on how 
core.match handles symbols 
<https://github.com/clojure/core.match/wiki/Overview#local-scope-and-symbols>. 
So in (match dt dt2 true :else false), the code is *not* comparing the 
value in the dt Var to the value in the dt2 Var; it’s locally binding the 
name dt2 to the value in the dt Var. As for((dt-matcher dt) dt2), it 
returns false because core.match recognized that dt and dt2 were 
locally-scoped in the body of dt-matcher and as a result *actually* compared 
the DateTime objects, which do not match because you need to teach 
core.match how to use DateTimes 
<https://github.com/clojure/core.match/wiki/Pattern-Matching-Java-Objects>.

I hope that helps!
Josh

P.S. In future questions you pose, you should probably state the version of 
Clojure you’re using, as well as the versions of any libraries you’re using 
in your example.

On Monday, January 30, 2017 at 6:31:34 PM UTC-5, Joachim De Beule wrote:
>
> Does anybody understand what is going on here?
>
> (require '[clojure.core.matcher :refer [match]]
> (import '[org.joda.time DateTimeZone DateTime])
>
> (def dt (DateTime. 2013 02 12 4 30 0 (DateTimeZone/forOffsetHours -2)))
> (def dt2 (clj-time.coerce/from-string "2013-02-12T04:30:00.000-02:00"))
>
> (match dt dt2 true :else false)
> ;; => true
> ;; so far so good ..
>
> (defn dt-matcher [dt]
>   (fn [dt2]
> (match dt dt2 true :else false)))
>
> ((dt-matcher dt) dt2)
> ;; => false
> ;; ???
>
> --
> Joachim
>

-- 
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: spec and à la carte conformance of map vals (and maybe a bug)

2017-01-13 Thread Josh Tilles
Alex,

Thank you for your reply! (I apologize for the delay in my own.)

I’ll first address your final point (regarding what spec is buying me vs. just 
using normal functions): I’m still trying to figure that out myself!  I.e., 
the boundaries of spec’s applicability/appropriateness are not yet apparent to 
me.

Second, your suggestion of an explicit coercion step before using spec to 
validate the map indicates to me that we were envisioning different things, 
although perhaps I’ve misunderstood the role of spec’s conformers. I was 
thinking about a situation like processing maps of named timestamps that 
originated as JSON sent over HTTP. The maps’ JSON origins force the timestamp 
values to be strings, but it would be a lot more convenient for downstream 
processing if the timestamps were in a format more structured than a string, 
like a map (akin to how s/cat specs conform, perhaps with :year, :month and 
:day components) or even an org.joda.time.DateTime instance. Hence, in this 
hypothetical code, I’d like to ensure the strings nested in the maps look 
properly timestamp-y before preparing the data for downstream processing by 
converting the strings to the more-structured format. So the coercions I had in 
mind would make more sense as a post-step to validation, but does this seem 
like an inappropriate application of conformers to you? I’d thought that 
s/conform was meant for this kind of validate-then-convert behavior, but I see 
how coercion before validation would be valuable in a different way, enabling 
more-granular specification, with more-focused predicate implementations and 
more-precise error reporting.

Ultimately, I’m trying to discern which of the following scenarios is the case:
I’m misusing spec by trying to “opt in” to using conformers on map values.
I’m using spec appropriately and the ability to specify conformance à la carte 
is a feature worthy of consideration.
I’m using spec appropriately and the inability to specify conformance à la 
carte is unfortunate yet tolerable & unlikely to change.

>From what you wrote before, it seems likely that either the first or the third 
>is true, but I wanted to make sure I wasn’t being misunderstood first.

Thank you,
Josh


> On Dec 19, 2016, at 5:26 PM, Alex Miller <a...@puredanger.com 
> <mailto:a...@puredanger.com>> wrote:
> 
> On Monday, December 19, 2016 at 2:42:49 PM UTC-6, Josh Tilles wrote:
> Is this seen as an acceptable tradeoff of an API that the core Clojure devs 
> are otherwise happy with? Or is it in fact a deliberate limitation, in line 
> with the “map specs should be of keysets only” 
> <http://clojure.org/about/spec#_map_specs_should_be_of_keysets_only>design 
> decision?
> It is deliberate that s/keys works only on attributes and that you can't 
> inline value specs.
Right, and that’s a decision that I’m not contesting, btw.

> You could still do individual transformations by conforming non-registered 
> specs if desired.
Do you mean that I could s/conform maps against an “anonymous” spec like (s/and 
::something (s/conformer #(try (update % ::created timestamp->map) (catch 
SomeException _ ::s/invalid? Or are you referring to something else? 
>  
> Thank you,
> Josh
> 
> P.S. To confirm my understanding that there is not a way to specify 
> conformance inline, I attempted to create and use a spec defined like (s/keys 
> :req [(s/and ::foo (s/conformer ,,,))]). To my surprise, clojure.spec used it 
> without complaint, although the behavior of s/conform was unaffected. Should 
> I create a JIRA issue for this?
> 
> Right now anything that's not a keyword gets filtered out and ignored. I'd be 
> in favor of erroring on other stuff, but not sure if that's at odds with how 
> Rich thinks about it. So, could do an enhancement jira if you wish.
OK, I’ll look into doing that this weekend.
>  
> P.P.S. A previous draft of this email had detailed illustrative examples, cut 
> out of fear of being tiresomely long-winded. If anything I described isn’t 
> clear, let me know and I’ll go ahead and include the examples in the 
> conversation.
> 
> -- 
> 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 
> <mailto: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 
> <mailto:clojure+unsubscr...@googlegroups.com>
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en 
> <http://groups.google.com/group/clojure?hl=en>
> --- 
> You received this message because you are subscribed to the Google Groups 
> "Clojure" 

Re: what tutorials exist for working at the Repl in Emacs?

2016-12-22 Thread Josh Kamau
http://www.braveclojure.com/basic-emacs/

On Fri, Dec 23, 2016 at 12:34 AM, larry google groups <
lawrencecloj...@gmail.com> wrote:

> I'm curious if there are good tutorials for a modern setup in Emacs.
> Especially any tutorial that mentions stuff like Pomegranate, that helps at
> the 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.


spec and à la carte conformance of map vals (and maybe a bug)

2016-12-19 Thread Josh Tilles
Hi all,

On several occasions, Alex Miller has emphasized that we should be wary of
“baking in” conformers when defining specs. I agree with him, but it’s not
clear to me how to “opt in” to using conformers on map vals. As far as I
can tell, I’m either limited to using unqualified keys —which enables
swapping specs from alternative namespaces for a given map-entry— or
adapting any conformer to operate on the whole map (e.g., with update)
rather than the val of a map-entry directly.

So, some questions:

   1. Am I missing something? Is there actually a way to specify
   conformance *à la carte* for the vals of a map with qualified keys? If
   not…
   2. Is there a plan to add this functionality? (I would be happy to
   create a JIRA issue if it would be better to take this conversation there.)
   If not…
   3. Is this seen as an acceptable tradeoff of an API that the core
   Clojure devs are otherwise happy with? Or is it in fact a
*deliberate* limitation,
   in line with the “map specs should be of keysets only”
   <http://clojure.org/about/spec#_map_specs_should_be_of_keysets_only>
   design decision?

Thank you,
Josh

P.S. To confirm my understanding that there is not a way to specify
conformance inline, I attempted to create and use a spec defined like (s/keys
:req [(s/and ::foo (s/conformer ,,,))]). To my surprise, clojure.spec used
it without complaint, although the behavior of s/conform was unaffected.
Should I create a JIRA issue for this?

P.P.S. A previous draft of this email had detailed illustrative examples,
cut out of fear of being tiresomely long-winded. If anything I described
isn’t clear, let me know and I’ll go ahead and include the examples in the
conversation.

-- 
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: Namespace question and request for project with non-trivial use of clojure.spec

2016-12-16 Thread Josh Tilles
Although I can’t recall off the top of my head any example applications 
that demo non-trivial spec usage, you might be able to find some good 
projects using CrossClj: 
https://crossclj.info/ns/org.clojure/clojure/1.9.0-alpha14/project.clj.html#used.
 
(There’s a good chance that any project that’s using one of the alpha 
releases of Clojure 1.9 is doing so for spec.)

On Friday, December 16, 2016 at 11:59:50 AM UTC-5, Jonathon McKitrick wrote:
>
> I've run into some odd namespace issues with clojure.spec, and I'm sure 
> it's because I'm doing something wrong. I have this in my ns declaration:
>
> [foo.schema :as schema]
>
> However:
>
> foo.main> (s/valid? :foo.schema/email "f...@bar.com ")
> true
> foo.main> (s/valid? :schema/email "f...@bar.com ")
> Exception Unable to resolve spec: :schema/email  clojure.spec/reg-resolve! 
> (spec.clj:68)
> foo.main> 
>
> It would also be useful if I knew of a non-trival project I could view 
> that uses clojure.spec across namespaces, but without being SO complex that 
> the basics are obscured.
>
> Does anyone know of or have an example?
>
>

-- 
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: s/valid? vs. s/explain

2016-11-13 Thread Josh Tilles
Just going on memory at the moment, but I’m pretty sure `s/explain` just
writes to `*out*` (and thus always returns `nil`). You probably want
`s/explain-data` or `s/explain-str`.

-Josh

On Sun, Nov 13, 2016 at 10:58 AM James Gatannah <james.gatan...@gmail.com>
wrote:

> One of my system boundary data structures is particularly ugly.  It
> involves things like JNI classes wrapping native socket libraries, go
> loops, and higher-order functions that I can use to plug in message
> dispatchers.
>
> I'm in the process of translating it from schema to spec. So far, the
> process has been very educational.
>
> I've reached a point where calling (s/valid? ::foo x) returns false, but
> (s/explain ::foo x) returns nil.
>
> Is this a bug in spec? Or am I misinterpreting the docstrings?
>
> (Narrowing it down enough to identify/fix my actual problem is one thing.
> Getting something that's easily/obviously reproducible is going to be more
> difficult, just because the problem spans at least 3-4 different github
> repos).
>
> Thanks,
> 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.
>

-- 
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: Spec & test.check generators for complex data structures

2016-11-01 Thread Josh Tilles
I don’t have any answers, but you might find the discussion in the first 
several messages of this thread 
 to be 
relevant.

On Tuesday, November 1, 2016 at 3:14:28 PM UTC-4, Maarten Truyens wrote:
>
> Completely convinced of Spec, I am diving into property-based testing with 
> test.check. However, I encounter some difficulties for which I would like 
> to get the community's input. 
>
> The central part of the software I am developing, consists of a tree of 
> different kinds of nodes that can refer to — and interact with — each 
> other. There are many business rules that specify how those nodes can 
> interact — e.g., a node of type A can refer to other nodes of types B and C 
> (but not D); or a node can have max. 3 child nodes of type E but more than 
> 3 child nodes of type F. 
>
> It is trivial to have Spec generate completely random nodes to test 
> functions that can ignore the business rules. However, other functions do 
> depend on the business rules, and for those it is necessary to somewhat 
> "guide" the generators towards random-but-compliant output. And here I'm 
> stumbling: due to the business rules' complexity, this is not a matter of 
> simply inserting a few such-that generators, so that I have already spent 
> many days on writing a business rule compliant generator. Part of this is 
> due to the multitude and complexity of the business rules, part due to the 
> difficulty of writing generators (which operate at a higher level of 
> abstraction, and for which only a subset of the normal Clojure constructs 
> can be used).
>
> How do others cope with this issue? I have the feeling that I am pushing 
> the generators far beyond what they were designed to do, but at the same I 
> have to acknowledge that the time required to write traditional tests for 
> functions dealing with the business rules is also substantial — so maybe 
> the time required to write those generators is not abnormal.   
>
> Any suggestions are welcomed! I did not find any in-depth observations of 
> other developers about property-based testing on the Net.
>
> Maarten
>

-- 
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: Java like static typing for Clojure?

2016-10-21 Thread Josh Tilles
Out of curiosity, did you try Typed Clojure? It certainly has its rough 
edges, but you sound willing to bear the burden of annotating code with 
types (at the top-level, at least) and I *think* its treatment of Java 
interop does what you want: unless instructed otherwise, the typechecker 
assumes that arguments to Java methods must not be nil and that any Java 
method may return nil.

On Thursday, October 20, 2016 at 8:39:04 AM UTC-4, Colin Fleming wrote:
>
> I recently spent a bunch of time researching exactly this. My motivation 
> was that my main project, Cursive, suffers from a ton of NPEs which I find 
> very difficult to manage. I wanted to see how difficult it would be to have 
> a typed Clojure-like thing, using something similar to Kotlin's type 
> system. Kotlin uses a type system which is similar to Java and has Java 
> interop as a primary goal, which I would also need since Java interop is 
> essential to me. It fixes a bunch of flaws in the Java type system and adds 
> new features like nullable types, which I now find it difficult to live 
> without.
>
> Before anyone asks, spec is not useful for me because it relies heavily on 
> generative testing to increase your confidence in your functions. I can't 
> use generative testing because my application is tied to a large Java 
> codebase which I cannot model to any useful degree. Essentially, spec 
> recommends runtime tests at the boundary of your system, and nearly my 
> entire system is interop boundary. I'm not interested in runtime checks 
> except where absolutely necessary - Kotlin does this for me transparently, 
> spec doesn't. 
>
> Here's a short list of my findings. I'm happy to expand on any of these 
> points if anyone is curious. It bears repeating - Java interop is 
> non-negotiable for me, and that makes a lot of this harder than it would be 
> otherwise.
>
> Disclaimer: I'm no programming language expert. This was hard for me, and 
> a surprising amount of it was new to me. I'd appreciate any corrections or 
> clarifications.
>
>1. Type systems are hard. I for one didn't appreciate the complexity 
>that goes into making them easy to use. Don't be fooled by the 20-line 
>implementations of Hindley-Milner.
>2. In particular, generics are very hard, and variance for generic 
>objects (i.e. the intersection of generic objects and OO) is the source of 
>much difficulty.
>3. Type systems are split into two main camps - nominal typing (like 
>Java, where the types are identified by names) and structural typing, 
> where 
>the type of an object is defined by it's "shape", like Go's interfaces.
>4. One of the major benefits of Clojure is its heterogeneous 
>collections, a.k.a. "just use a map". This is very difficult to maintain 
> in 
>a type-safe manner without losing most of the benefit.
>5. There are two main things I was interested in from a type system - 
>type checking (i.e. making sure that your program's types are correct) and 
>type inference (working out what the types of things are from the code, so 
>you don't have to annotate everything). Type checking is relatively 
>straightforward, but type inference can be very hard indeed.
>6. Much of the complication comes from the need to interop with Java. 
>ML-style interface essentially doesn't work if you want to maintain 
>compatibility with Java since it cannot be interfaced in a useful way with 
>nominal OO systems. In particular, method overriding is basically 
>impossible to represent.
>7. #6 implies that you cannot have a language with good Java interop 
>*and* global type inference, i.e. you will definitely be annotating 
>your function parameter types, and your function return types. I'm ok with 
>this since IMO it's a good practice anyway.
>8. Once you start thinking about the fact that you no longer have 
>heterogeneous collections, and start thinking about what the alternatives 
>would look like, you start to realise that you'd end up with basically the 
>ML family style of data types - homogeneous collections, typed tuples and 
>ADTs. I'm actually ok with that too, since they're a very nice set of 
>primitives and I think they probably represent 95% of how people use 
>Clojure's collections anyway.
>9. Structural typing seems like it might be a good fit for something 
>like Clojure's maps. However, mixing structural and nominal typing 
>*and* OO seems to be the path to madness.
>
> I think that's it. This is still a project I'd like to tinker with at some 
> point, but I think it's fair to say that I dramatically underestimated the 
> amount of work a useful Java-compatible type system would be. I still think 
> it seems like a nice point in the language design space though, which is 
> curiously unfilled on the JVM (some of you may have noticed that I 
> basically want F# with nullable types).
>
> Cheers,
> Colin
>
> 

Guidelines/Recommendations for namespaces and qualified keywords

2016-10-15 Thread Josh Tilles
I’ve got a couple questions for Alex Miller and/or the other Cognitect 
folks.

   1. *Are single-segment namespaces still “bad” when it comes to 
   registering specs under qualified keywords?*
   In the past, single-segment namespaces have been discouraged in the 
   Clojure community—both because of Java interop concerns and because of the 
   possibility of name-collision when combining projects. However, many of the 
   spec examples I’ve seen have demonstrated registering specs under keywords 
   qualified by a single-segment namespace. For example, the guide’s 
   section on multi-spec <http://clojure.org/guides/spec#_multi_spec> 
   defines :search/url and :error/message. Is that because 
   namespace-qualifiers of specs shouldn’t be under the same constraints as 
   namespaces used to organize code? I’m *guessing* not; it seems more 
   likely that the single-segment namespaces have been used only to keep the 
   code snippets straightforward and focused on spec, and that “real” code 
   would alias (e.g.) my-company.my-project.search as search before 
   defining a ::search/url spec.
   
   2. *When designing, how do you decide whether to use a simple keyword or 
   a qualified one?*
   There’s an interesting mix of the two in the official docs and in the 
   code for spec itself. For example: the spec rationale 
   <http://clojure.org/about/spec#_sequences> and guide 
   <http://clojure.org/guides/spec#_sequences> both use simple keywords 
   when labeling path components, and spec reports invocation errors for 
   instrumented functions with maps that exclusively use qualified keys at the 
   “root” but simple keywords appear as values 
   
<https://github.com/clojure/clojure/blob/clojure-1.9.0-alpha13/src/clj/clojure/spec/test.clj#L394-L402>
 
   and as keys in nested maps 
   
<https://github.com/clojure/clojure/blob/clojure-1.9.0-alpha13/src/clj/clojure/spec.clj#L205>
   .

Thank you for your help. I really appreciate it.

Best,
Josh

-- 
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, conform and returned value

2016-10-11 Thread Josh Tilles
I think you’re looking for conformer 
;
 
the spec it produces will pass along the converted value instead of the 
original input. It could be used like:
(defn str->double [s]
  (try
(Double/valueOf s)
(catch NumberFormatException _
  :clojure.spec/invalid)))

(s/def ::transforming-check (s/and string? (s/conformer str->double) ::
bigger-than-zero?))

I hope that helps with your original problem, but I’ll defer to the more 
experienced folks here for your questions about the spirit/aim of 
clojure.spec.

On Tuesday, October 11, 2016 at 2:30:18 PM UTC-4, plamen...@gmail.com wrote:
>
> Hello,
>
> I have a problem which is probably not in the spirit of clojure.spec as 
> being a library for "only" checking/generating valid values, but of 
> substantial practical value for my use case:
>
> Let say I have a function for checking if a double precision number is 
> parsable from a string (where possible performance penalties because of 
> communicating non-parsable strings through try/catch in the implementation 
> is not part of my question):
>
>
> (defn str-parsable-double? [s]
>   "Note the IMPLIED transformation from string to a double"
>   (try
> (Double/valueOf s)
> (catch NumberFormatException e
>   false)))
>
>
> and have a spec using this function:
>
> (s/def ::str->double str-parsable-double?)
>
>
> We could actually chain checks for a single value as in:
>
> (s/def ::str->double (s/and string? str-parsable-double?))
>
> and we could check for the conformity of a value as per:
>
> (s/conform ::str->double "3.14")
> => "3.14"
> and 
> (s/conform ::str->double "Pizza")
> => :clojure.spec/invalid
>
> Until now everything is ok, now my the questions:
>
> In my real world example I need a chain of a combination of checks and 
> transformations in the following way:
> ::check1 ::check2 ::check-and-transform3 ::check-4-on-transformed-value 
> ::check-5-on-transformed value
> or something like
> (s/def ::transforming-check (s/and string? ::str->double ::bigger-than-zero? 
> ::smaller-than-pi ... etc ...))
>
> As the result of 
> (s/conform ::str->double "3.14") is the input value as a string instead of 
> the result, I would need implement ::bigger-than-zero? and the rest of the 
> checks as operating on strings, which would mean that I need in each check to 
> transform the string into a double, which in my case is for performance 
> reasons bad.
>
> On the other side I would be able to do the checks in a 2 step fashion, which 
> goes against my understanding of the aim of clojure.check to be able to 
> create through composition a single set of validations for a single value.
> This also doesn't solve fully the problem with the multiple parsing of the 
> first data type before the transformation: a parsing happens in the 
> ::str->double step as well in the then explicit transformation step before 
> the final checks based then on the actual double.
>
> So - is there a way to compose checks in a single one, where some of them 
> change the underlying type of the value for subsequent validations (I may 
> miss something in the Clojure documentation, and pointers to it would be very 
> welcome)?
>
> If not - why s/conform returns the input value instead of the result value? 
> As being on the caller site of s/conform I know what I passed and I know what 
> s/conform would give me in the negative outcome of the validation.
> If s/conform while iterating/recursing through the actual spec would apply 
> the checks on returned values of previous checks instead always on the input 
> - the problem would be solved, without negatives for the calling sites (as 
> because of the previous sentence).
> This could be solved for example (not sure if I see every detail yet, but at 
> least as a pointer) in that in the clojure.spec code
>
> Spec
> (conform* [_ x] (let [ret (pred x)]
>   (if cpred?
> ret
> (if ret x ::invalid
> the value of cpred? could be passed from the calling site (or if don't miss 
> something be even per default true).
>
> In any case, I would be thankfull for any suggestions solving both proplems: 
> how to express such checks in a good way and how to avoid reparsing values 
> again and again (where the current example is for just strings to doubles, 
> but the actual problem could involve any transformations on the value incl. 
> type).
>
> With best regards
> Plamen
>
>
>
>
>
>

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

Re: Idiom question

2016-09-28 Thread Josh Tilles
By the way, the order of arguments of as-> makes more sense when it’s used 
*within* one of the other threading macros. For example:
(-> x
  foo
  (bar y)
  (baz w z)
  (as-> mid-x
(log/debug "The intermediate value:" mid-x)
(if (color-requested? mid-x)
  (assoc mid-x :color "periwinkle")
  (do
(log/warn "skipping the addition of color")
mid-x)))
  (update :counter inc))


On Wednesday, September 28, 2016 at 4:11:42 PM UTC-4, pa...@pwjw.com wrote:
>
> Wow yes that's exactly the -%> macro I imagined just with "%" replaced 
> with "it". And it exists!  Plus I just converted my fragment to use as-> 
> and thought "aren't the first two arguments backwards (vs, say, "let"); and 
> what name should I use (I chose 's')". Thank you. Reading the tupelo docs 
> now.
>
> On Wednesday, September 28, 2016 at 4:02:38 PM UTC-4, Alan Thompson wrote:
>>
>> Hi Paul,
>>
>> Since you are interested in the threading macros, you might like to take 
>> a look at one of my favorite variants from the Tupelo library 
>> :
>>
>> Literate Threading Macro
>>
>> We all love to use the threading macros -> and ->> for certain tasks, 
>> but they only work if all of the forms should be threaded into the first or 
>> last argument.
>>
>> The built-in threading macro as-> can avoid this requirement, but the 
>> order of the first expression and the placeholder symbol is arguably 
>> backwards from what users would expect. Also, there is often no obvious 
>> name to use for the placeholder symbol. Re-using a good idea from Groovy, 
>> we simply use the symbol it as the placeholder symbol in each expression 
>> to represent the value of the previous result.
>>
>> (it-> 1
>>   (inc it)  ; thread-first or thread-last
>>   (+ it 3)  ; thread-first
>>   (/ 10 it) ; thread-last
>>   (str "We need to order " it " items." )   ; middle of 3 arguments;=> 
>> "We need to order 2 items." )
>>
>> Here is a more complicated example. Note that we can assign into a local 
>> let block from the it placeholder value:
>>
>> (it-> 3
>>   (spy :msg :initial it)
>>   (let [x it]
>> (inc x))
>>   (spy it :msg 222)
>>   (* it 2)
>>   (spyx it)); :initial => 3; 222 => 4; it => 88   ; return value
>>
>> Note that the :msg argument does not need to be a string. As shown 
>> above, keywords, integers, etc may be used.
>> Alan
>>
>>
>> On Wed, Sep 28, 2016 at 11:36 AM, Colin Yates  wrote:
>>
>>> Welcome to one of the best things about Clojure - the community. 
>>> However, if anyone starts using the phrase 'Clojurian' then it is time to 
>>> leave :-).
>>>
>>>
>>>
>>> On Wed, 28 Sep 2016, at 07:17 PM, pa...@pwjw.com wrote:
>>>
>>> Wow thank you all for the really useful responses. How great. I 
>>> appreciate the time.
>>>
>>> as-> cleans up a couple of ugly bits of my code already, yes. And I'm 
>>> sort of irritated with myself for not thinking of _ (if (throw)) in my let 
>>> but yes that's a perfect idiom.
>>>
>>>
>>> I totally get the minimalist approach in clojure.test and like it. In 
>>> fact, the ease of testing (and how easy it is to get coverage running with 
>>> cloverage) is one of the things I find the most impressive. expectations 
>>> looks interesting though too for a lot of my tests and I'll spend some time 
>>> with it too.
>>>
>>> The idiom of "most important is first unless its a sequence then it is 
>>> last" is really natural too; but I think it's what makes me end up 
>>> switching from ->> to ->. Putting a "first" in the middle of a ->> 
>>> expression is, I suppose, a hint that I'm switching.  Looking at my code, 
>>> it really seems to be a mix of ->> and "doto" that I'm looking for. Here's 
>>> a fragment, for instance, that returns me an opened instance of the first 
>>> core midi device with a name that can receive messages. (and I know I 
>>> should error check that there is one after that filter... that's on my todo 
>>> list). An "as-> doto" pair would help and I'll get right on that later on 
>>> this week.
>>>
>>> (->> (MidiSystem/getMidiDeviceInfo)
>>>
>>> (filter #(= (.getName ^MidiDevice$Info %) name))
>>>
>>> (map #(MidiSystem/getMidiDevice ^MidDevice$Info %))
>>>
>>> (filter #(>= (.getMaxTransmitters ^MidiDevice %) 0))
>>>
>>> first
>>>
>>> (#(do (.open ^MidiDevice %) %))
>>>
>>> (#(.getReceiver ^MidiDevice %))
>>>
>>> )
>>>
>>> Anyway, wow thanks again for all the responses!
>>>
>>>
>>>
>>>
>>>
>>> On Wednesday, September 28, 2016 at 10:31:37 AM UTC-4, pa...@pwjw.com 
>>> wrote:
>>>
>>> Hi.
>>>
>>> I'm new to clojure, and it is quite lovely. The threading model is 
>>> great, the emacs integration is super, and the tasteful lisp extensions are 
>>> good. A very nice programming environment all around. 
>>>
>>> But as 

Re: wondering why spec.test/instrument doesn't check :ret

2016-08-06 Thread Josh Tilles
I’m not sure it answers your question *directly*, but a quote from Rich in 
another 
thread  seems 
relevant:

On Monday, July 11, 2016 at 10:01:05 AM UTC-4, Rich Hickey wrote:

> On Sunday, July 10, 2016 at 6:04:39 AM UTC-4, puzzler wrote:

1. No way to test function output specs.  For documentation purposes, I 
>> want to have an output spec on my function.  However, as far as I know, 
>> after instrumentation-triggered checking of output specs was removed a 
>> couple of alphas ago, the only way remaining to check against output specs 
>> is to use randomly generated tests.  So if I can't make good generators, I 
>> have no way to confirm that my output spec works the way I think it does.  
>> My documentation could be totally out of touch with reality, and that 
>> displeases me.
>
> Running return-value instrument-style checking on whatever few 
> hand-written tests you might have isn’t going to give you better coverage 
> than a simple (even hardwired) generator that captures similar ranges. And 
> you can directly exercise your :ret spec - it’s just another spec. You can 
> also spec/assert on your return - the tests will disappear in production, 
> although this is similarly as weak as instrument-triggered return checking, 
> so I’m not going to help you do it, but you can do it yourself :) 


Incidentally, I think your question is common enough that it might be worth 
writing something up for http://clojure.org/guides/faq.

-- 
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: Spec of conform of spec

2016-06-18 Thread Josh Tilles
I just realized that in my example, I probably should have used
`s/get-spec` instead of `s/spec` when defining the labels. Oh well.

On Saturday, June 18, 2016, Josh Tilles <j...@signafire.com> wrote:

> Have you considered choosing labels that are themselves qualified
> keywords with registered specs? That might feel like a workaround, but
> I think it could get you most of what you’re looking for.
>
> For example:
>
> ```
> (s/def ::even-spec even?)
> ;= :user/even-spec
> (s/def ::odd-spec odd?)
> ;= :user/odd-spec
> (s/def ::label-even (s/spec ::even-spec))
> ;= :user/label-even
> (s/def ::label-odd (s/spec ::odd-spec))
> ;= :user/label-odd
> (s/conform (s/cat ::label-even ::even-spec, ::label-odd ::odd-spec) [2 3])
> ;= {:user/label-even 2, :user/label-odd 3}
> (s/conform (s/cat ::label-odd ::even-spec) [2])
> ;= {:user/label-odd 2}
> (s/valid? (s/keys) *1)
> ;= false
> (s/explain (s/keys) *2)
> ; In: [:user/label-odd] val: 2 fails spec: :user/label-odd at:
> [:user/label-odd] predicate: odd?
> ;= nil
> ```
>
>
> On Saturday, June 18, 2016, Leon Grapenthin <grapenthinl...@gmail.com
> <javascript:_e(%7B%7D,'cvml','grapenthinl...@gmail.com');>> wrote:
>
>> Assume I parse with conform.
>>
>> Then I have functions that operate on the value returned by conform. I
>> want to spec them.
>>
>> But I can't get a spec for the value returned by conform (so that I can
>> spec said functions) automatically.
>>
>> Imagine `(s/conform-spec ::my-spec)` would return the spec of the result
>> of calling (s/confom ::my-spec foo)
>>
>> So it would probably be valuable if a spec could give a spec of what its
>> conform* returns`
>>
>> --
>> 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: Spec of conform of spec

2016-06-18 Thread Josh Tilles
Have you considered choosing labels that are themselves qualified
keywords with registered specs? That might feel like a workaround, but
I think it could get you most of what you’re looking for.

For example:

```
(s/def ::even-spec even?)
;= :user/even-spec
(s/def ::odd-spec odd?)
;= :user/odd-spec
(s/def ::label-even (s/spec ::even-spec))
;= :user/label-even
(s/def ::label-odd (s/spec ::odd-spec))
;= :user/label-odd
(s/conform (s/cat ::label-even ::even-spec, ::label-odd ::odd-spec) [2 3])
;= {:user/label-even 2, :user/label-odd 3}
(s/conform (s/cat ::label-odd ::even-spec) [2])
;= {:user/label-odd 2}
(s/valid? (s/keys) *1)
;= false
(s/explain (s/keys) *2)
; In: [:user/label-odd] val: 2 fails spec: :user/label-odd at:
[:user/label-odd] predicate: odd?
;= nil
```


On Saturday, June 18, 2016, Leon Grapenthin 
wrote:

> Assume I parse with conform.
>
> Then I have functions that operate on the value returned by conform. I
> want to spec them.
>
> But I can't get a spec for the value returned by conform (so that I can
> spec said functions) automatically.
>
> Imagine `(s/conform-spec ::my-spec)` would return the spec of the result
> of calling (s/confom ::my-spec foo)
>
> So it would probably be valuable if a spec could give a spec of what its
> conform* returns`
>
> --
> 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.9.0-alpha5

2016-06-12 Thread Josh Tilles
On Sunday, June 12, 2016 at 10:29:56 PM UTC-4, Alan Thompson wrote:
>
> I would have expected the namespaces to avoid this kind of conflict. Why 
> don't they?
>

Because the conflict was only introduced five days ago, with this commit 
.
 
Up until that point, the maintainers of Schema had no reason to include Inst in 
schema.core’s exclusions 

.
I’d guess that they’d welcome a pull request that silences the warning. ;)

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

2016-06-08 Thread Josh Tilles
Well, it’s worth noting that clojure.core/name does account for strings 

:

(defn name
  "Returns the name String of a string, symbol or keyword."
  {:tag String
   :added "1.0"
   :static true}
  [x]
  (if (string? x) x (. ^clojure.lang.Named x (getName

So one *could* argue that named? should recognize strings in addition to 
keywords and symbols. No comment on whether such a predicate is a good idea 
though.


On Wednesday, June 8, 2016 at 5:40:06 PM UTC-4, Sean Corfield wrote:
>
> Given the only two things in Clojure that implement Named are keyword and 
> symbol – and we have ident? – what additional value would named? have?
>
>  
>
> (but, yes, that was my first thought when I saw the list of new predicates)
>
>  
>
> Sean Corfield -- (904) 302-SEAN
> An Architect's View -- http://corfield.org/
>
> "If you're not annoying somebody, you're not really alive."
> -- Margaret Atwood
>
>  
>
> On 6/8/16, 1:13 PM, "Devin Walters (devn)"   on behalf of dev...@gmail.com > wrote:
>
>  
>
> Any chance of `named?` making the cut in 1.9? I see it's used in the 
> implementation of clojure.spec.
>
> On Tuesday, June 7, 2016 at 12:38:34 PM UTC-5, Alex Miller wrote:
>
> Clojure 1.9.0-alpha5 is now available.
>
>  
>
> Try it via
>
>  
>
> - Download:
>  https://repo1.maven.org/maven2/org/clojure/clojure/1.9.0-alpha5 
> 
>
> - Leiningen: [org.clojure/clojure "1.9.0-alpha5"]
>
>  
>
> 1.9.0-alpha4 includes the following changes since 1.9.0-alpha4:
>
>  
>
> Fixes:
>
> - doc was printing "Spec" when none existed
>
> - fix ? explain
>
>  
>
> New predicates in core (all also now have built-in generator support in 
> spec):
>
> - seqable?
>
> - boolean?
>
> - long?, pos-long?, neg-long?, nat-long?
>
> - double?, bigdec?
>
> - ident?, simple-ident?, qualified-ident?
>
> - simple-symbol?, qualified-symbol?
>
> - simple-keyword?, qualified-keyword?
>
> - bytes? (for byte[])
>
> - indexed?
>
> - inst? (and new inst-ms)
>
> - uuid?
>
> - uri?
>
>  
>
> New in spec:
>
> - unform - given a spec and a conformed value, returns the unconformed 
> value
>
> - New preds: long-in-range?, inst-in-range?
>
> - New specs (with gen support): long-in, inst-in, double-in
>
> -- 
> 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: Addressing Matthias Felleisen's concerns?

2016-05-09 Thread Josh Tilles
On Monday, May 9, 2016 at 5:36:53 PM UTC-4, Didier wrote:
>
> At Clojurewest 2016, Matthias Felleisen gave a great keynote about the 
> pragmatism of soundness for maintening large code bases. He mentioned that 
> adding type gradually was useful, but only when the border between typed 
> land and untyped land is guarded. He mentioned how Racket does that. He 
> also talked about the cost of doing so, which seem to remain an open 
> question.
>
> I'm wondering if any of this has been taken up by somebody in Clojure to 
> try to do the same? My understanding is typed clojure does not protect the 
> border between typed and untyped. Therefore, you do not have the guarantee 
> that your typed code will be correct for all its usage.
>
I believe that Ambrose (the core developer/maintainer of Typed Clojure) has 
been focusing on that very topic as of late: CTYP-309: “Export typed vars 
with contracts to untyped namespaces” 
.

> Also, does anyone know exactly what he meant by the cost? Is doing gradual 
> typing causing slower runtimes, slower compilation, does it hamper the 
> dynamism, etc.
>
 I expect that dynamically-checked contracts would (at least) cause slower 
runtimes in the cases of untyped-calling-typed code or 
typed-calling-untyped code; I think typed-calling-typed code would skip the 
runtime contract verification.

-- 
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: Running Clojure apps using less memory.

2016-03-28 Thread Josh Tilles
Hi Jason,

I have a hunch that you have more Java processes running than you need 
and/or are aware of. For example, by running your Clojure app via lein run 
-m clojureweb.core/serve, you have two Java processes: one for Leiningen, 
and a separate one (started by Leiningen) for your app. It’s unlikely that 
you need Leiningen’s JVM to stick around, so you should probably try 
starting your app with the command lein *trampoline* run -m 
clojureweb.core/serve. (For details, see “Server-side Projects” in the 
Leiningen tutorial 
<https://github.com/technomancy/leiningen/blob/f9a464e008214941e93c046413004517325818bb/doc/TUTORIAL.md#server-side-projects>
.)
Also, you didn’t mention how you were starting your REPL(s), but I’m going 
to assume that you were using lein repl; if so, that’s the source of *yet 
another* Java process or two. In order to refrain from needing to keep 
other JVMs running, you might want to use Clojure 1.8’s built-in socket 
server REPL 
<http://clojure.org/reference/repl_and_main#_launching_a_socket_server>
 instead.

Cheers,
Josh

P.S. You mentioned that you’re relatively new to Clojure—welcome! =)

On Monday, March 28, 2016 at 8:11:49 AM UTC-4, Jason Basanese wrote:
>
> Hello all! I'm new to this forum. My name Is Jason Basanese and I am a 
> relatively new clojurist.
>
> I recently began hosting my first small full stack Clojure web app. While 
> doing this I ran into memory problems with my admittedly small load server. 
> The maximum it can take in temp memory is 741MB. Too much of that memory is 
> consumed giving an error when I try to run two REPLs on the server. One for 
> testing and editing code and the other for leaving the app running. My 
> other dynamic content websites which use php directly with Apache use 
> minimal memory. Why is it that running a Clojure app like such "lein run -m 
> clojureweb.core/serve" takes up so much memory? Here is the code of the 
> function I am running with that command. 
>
> (defn serve [& args]
>   (org.apache.log4j.BasicConfigurator/configure)
>   (run-server
>(logger/wrap-with-logger
> (reload/wrap-reload app))
>{:port 8080}))
>
> Are the logger or the wrap-reload making it take up so much memory? Is 
> there a better way to run Clojure apps that is less robust? Or is using a 
> relatively large amount of memory just a bullet to bite when using Clojure? 
> Yes I know an obvious solution would just be to upgrade the server, but 
> where's the fun in that?
>
> Requests for more detail, comments, answers and opinions all welcome!
>
>

-- 
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: Partial question

2016-02-23 Thread Josh Tilles
My guess is that what you're looking for is:
(def debug #(log "DEBUG" % :idVE "COM"))
(see "Anonymous function literal" under 
http://clojure.org/reference/reader#_dispatch)

However, note that defining functions in a "point-free"-ish style in 
Clojure has a downside with regard to metadata, in that the function 
arities and argument names aren't inspectable at the REPL:
(def debug-1 #(log "DEBUG" % :idVE "COM"))
;= user/debug-1
(clojure.repl/doc debug-1)
; -
; user/debug-1
;   nil
;= nil
(defn debug-2 [message]
  (log "DEBUG" message :idVE "COM"))
;= user/debug-2
(clojure.repl/doc debug-2)
; -
; user/debug-2
; ([message])
;   nil
;= nil


Hope that's helpful,
Josh

P.S. If you *really want to* you can populate the :arglists metadata 
yourself:
(def ^{:arglists '([message])} debug #(log "DEBUG" % :idVE "COM"))



On Tuesday, February 23, 2016 at 1:14:33 PM UTC-5, Fernando Abrao wrote:
>
> Hello all,
>
> I´m trying to do something like:
>
> (defn log [type message & {:keys [id idVe] :or {id "LOCAL" idVe "END"}}] 
>  (println (str id ": " type " -> " message "<- " idVe)))
>
>
> (def debug (partial log "DEBUG" ?? :idVe "COM"))
>
>
> Is there any way to do what I want? Pass arguments to log and add the 
> :idVe into the end? Is the partial the best using to do this?
>
> Regards,
>
> Fernando
>

-- 
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 is the emphasis of “data over code” different than the XML advocacy of the early 2000s?

2016-02-01 Thread Josh Tilles
As I’m watching Michael Drogalis’s Clojure/Conj 2015 presentation “Onyx: 
Distributed Computing for Clojure” 
<https://youtube.com/watch?v=YlfA8hFs2HY=734>, I'm distracted by a 
nagging worry that we —as a community— are somehow falling into the same 
trap as the those advocating XML in the early 2000s. That said, it's a very 
*vague* unease, because I don’t know much about why the industry seems to 
have rejected XML as “bad”; by the time I started programming 
professionally there was already a consensus that XML sucked, and that 
libraries/frameworks that relied heavily on XML configuration files were to 
be regarded with suspicion and/or distaste.

So, am I incorrect in seeing a similarity between the “data > code” 
mentality and the rise of XML? Or, assuming there is a legitimate parallel, 
is it perhaps unnecessary to be alarmed? Does the tendency to use edn 
instead of XML sidestep everything that went wrong in the 2000s? Or is it 
the case that the widespread backlash against XML threw a baby out with the 
bathwater, forgetting the advantages of data over code?

Cheers,
Josh

-- 
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: Compare between clojure and Java

2016-01-05 Thread Josh Kamau
Here is an extremely simple example:

Problem: add a list of numbers

java: You put something like this in a class in a method

int[] numbers = {1,2,3,4,5,6,7,7,8,4,3} ;

int sum = 0 ;
for(int i = 0; i < sum.length; i++) {
sum = sum + i;
}

return sum;


clojure: You put this in a clojure namespace

(def numbers [1 2 3 4 54 56 6])

;;to get the sum
(reduce + numbers)


You get the idea ;)

Josh


On Tue, Jan 5, 2016 at 4:19 PM, Thomas Saillard <tsaillar...@gmail.com>
wrote:

> Dear,
>
> In order to good understand the powerful of Clojure,
> I have heard that compare to a code in java you need only few lines in
> clojure.
> Is that true ?
> If it is the case, have you a sample of the 2 codes ?
> I appreciate your help.
> My Kind regards,
> Thomas
>
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with
> your first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> 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: How to start with IDE?

2015-12-21 Thread Josh Kamau
After that message, a repl window should appear in which you can type and
evaluate clojure expressions.

After loading the repl, check how to:
  - load current namespace into the repl and evaluate the functions in the
repl
  - evaluate an expression on the workspace

I dont remember the shortcuts since i now use emacs.

Josh

On Mon, Dec 21, 2015 at 2:09 PM, AndrzejB <borucki.andr...@gmail.com> wrote:

> I have downloaded Counterclockwise with integrated Eclipse IDE for Windows.
> I start new project:
> (ns newclojure.core)
>
> (defn foo
>   "I don't do a whole lot."
>   [x]
>   (println x "Hello, World!"))
>
> but when I try run appears window "Waiting to new REPL process to be
> ready" and output in console is
>
>> #<user$eval435$fn__436$fn__437 user$eval435$fn__436$fn__437@1ac5f9b>
>> #
>> nREPL server started on port 60816 on host 127.0.0.1 - nrepl://
>> 127.0.0.1:60816
>
> --
> 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: Library suggestions requested for clojure-toolbox.com

2015-10-13 Thread Josh Tilles
James, I've provided a bit more information than you requested because I 
figured mailing list readers might find the extra details useful.

   - durable-queue
  - URL: https://github.com/Factual/durable-queue
  - GitHub description: “a disk-backed queue for clojure”
  - Categories:
 - Probably “Message Queues”
 - Maybe “Data Serialization”
 - Maybe “Data Structures”
  - featured in Zach Tellman’s Clojure/West 2015 presentation, “Everything 
  Will Flow ”
  - dirigiste
  - URL: https://github.com/ztellman/dirigiste
  - GitHub description: “centrally-planned object and thread pools”
 - From the README: “Dirigiste provides a fast, richly instrumented 
 version of a java.util.concurrentExecutorService, …”
  - Categories:
 - probably “Java Integration”
 - maybe “Asynchronous Programming”
 - maybe “Diagnostics”
  - also mentioned in Zach Tellman
   - clj-http-lite
  - URL: https://github.com/hiredman/clj-http-lite
  - GitHub description: “A lite version of clj-http that uses the jre's 
  HttpURLConnection”
  - Categories:
 - certainly “HTTP Clients”
 - maybe “Java Integration”
  - structural-typing
  - URL: https://github.com/marick/structural-typing
  - Categories:
 - probably “Dynamic Typing”
 - maybe “Validation”
  - hara.component
  - URLs:
 - http://docs.caudate.me/hara/hara-component.html
 - https://github.com/zcaudate/hara
 - Categories:
 - probably “Components”
 - maybe the *overall* Hara (meta-)library could be considered 
 under the category “Misc. Functions”
  

On Monday, October 5, 2015 at 3:41:11 PM UTC-4, James Reeves wrote:
>
> If you've written or know about a Clojure or ClojureScript library, and 
> it's not already on clojure-toolbox.com , 
> I'd like to hear about it.
>
> Post the name and URL (and an optional category) as reply to this message, 
> and I'll add it to the site.
>
> - 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: Library suggestions requested for clojure-toolbox.com

2015-10-13 Thread Josh Tilles
Also, you may want to replace MidjeDoc with Hydrox 
<https://github.com/helpshift/hydrox>.

On Tuesday, October 13, 2015 at 6:32:50 PM UTC-4, Josh Tilles wrote:
>
> James, I've provided a bit more information than you requested because I 
> figured mailing list readers might find the extra details useful.
>
>- durable-queue
>   - URL: https://github.com/Factual/durable-queue
>   - GitHub description: “a disk-backed queue for clojure”
>   - Categories:
>  - Probably “Message Queues”
>  - Maybe “Data Serialization”
>  - Maybe “Data Structures”
>   - featured in Zach Tellman’s Clojure/West 2015 presentation, 
> “Everything 
>   Will Flow <https://www.youtube.com/watch?v=1bNOO3xxMc0>”
>   - dirigiste
>   - URL: https://github.com/ztellman/dirigiste
>   - GitHub description: “centrally-planned object and thread pools”
>  - From the README: “Dirigiste provides a fast, richly 
>  instrumented version of a java.util.concurrentExecutorService, …”
>   - Categories:
>  - probably “Java Integration”
>  - maybe “Asynchronous Programming”
>  - maybe “Diagnostics”
>   - also mentioned in Zach Tellman
>- clj-http-lite
>   - URL: https://github.com/hiredman/clj-http-lite
>   - GitHub description: “A lite version of clj-http that uses the 
>   jre's HttpURLConnection”
>   - Categories:
>  - certainly “HTTP Clients”
>  - maybe “Java Integration”
>   - structural-typing
>   - URL: https://github.com/marick/structural-typing
>   - Categories:
>  - probably “Dynamic Typing”
>  - maybe “Validation”
>   - hara.component
>   - URLs:
>  - http://docs.caudate.me/hara/hara-component.html
>  - https://github.com/zcaudate/hara
>  - Categories:
>  - probably “Components”
>  - maybe the *overall* Hara (meta-)library could be considered 
>  under the category “Misc. Functions”
>   
>
> On Monday, October 5, 2015 at 3:41:11 PM UTC-4, James Reeves wrote:
>>
>> If you've written or know about a Clojure or ClojureScript library, and 
>> it's not already on clojure-toolbox.com <http://www.clojure-toolbox.com>, 
>> I'd like to hear about it.
>>
>> Post the name and URL (and an optional category) as reply to this 
>> message, and I'll add it to the site.
>>
>> - 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: Awesome Clojure Engineer Opportunity

2015-10-12 Thread Josh Kamau
Remote or on site?

J

On Mon, Oct 12, 2015 at 11:00 PM, Rameen Fattahi 
wrote:

> Hi Everyone,
>
> My name is Rameen and I'm looking for a passionate Clojure engineer for a
> very confidential project at one of the biggest companies in the world
> (cannot name it here for privacy reasons).
>
> This is a full time role on our Applied Machine Learning team. If you're
> interested, please send me your resume and I'd be happy to chat with you.
>
> Thanks a lot,
> Rameen Fattahi, *Technical Recruiter*
>
> --
> 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] Yesql 0.5.1 Released.

2015-10-08 Thread Josh Kamau
Thanks a million!  Having come from mybatis world, this really helps.

Josh.

On Thu, Oct 8, 2015 at 8:56 AM, Andrey Antukh <n...@niwi.nz> wrote:

> Great work!
>
> Any change for have yesql decoupled from java.jdbc? I really want to use
> it, but with other jdbc libraries...
>
>
> Regards
> Andrey
>
> On Thu, Oct 8, 2015 at 12:55 AM, Kris Jenkins <krisajenk...@gmail.com>
> wrote:
>
>> Yesql - the Clojure library for using SQL - has just released v0.5.1.
>>
>> The API is much improved - especially if you're using queries with many
>> arguments - so see the migration guide if you're upgrading:
>>
>> My thanks to everyone who has contributed to this release, and for all
>> the users who've been patiently waiting for v0.5 to go official. :-)
>>
>> Kris
>>
>> --
>> 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.
>>
>
>
>
> --
> Andrey Antukh - Андрей Антух - <n...@niwi.nz>
> http://www.niwi.nz
> https://github.com/niwinz
>
> --
> 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: Refactoring namespaces

2015-09-18 Thread josh
Slamhound <https://github.com/technomancy/slamhound> might be all you need.

If you’re an Emacs user, there’s the clj-refactor.el 
<https://github.com/clojure-emacs/clj-refactor.el> package (powered by the 
refactor-nrepl <https://github.com/clojure-emacs/refactor-nrepl> library).

In my experience, Cursive <https://cursiveclojure.com/> has been pretty 
effective for refactoring (e.g., moving a file into a different directory 
and having all of the ns forms update appropriately).

I hope that's helpful,
Josh

On Friday, September 18, 2015 at 12:54:03 PM UTC-4, Timur wrote:
>
> Hi everyone,
>
> Is there any recommended way of refactoring namespaces in Clojure? Any 
> tool support, which automates this task?
>
> Regards,
>
> Timur
>

-- 
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/Pedestal vs Go

2015-09-16 Thread Josh Kamau
11.  Leiningen and painless dependency management.

Josh

On Wed, Sep 16, 2015 at 7:08 AM, Michael Gardner <gardne...@gmail.com>
wrote:

> On Sep 15, 2015, at 20:45, Mikera <mike.r.anderson...@gmail.com> wrote:
> >
> > 7. The open source library ecosystem on the JVM is awesome. There's
> nothing like it for any other language.
>
> I like your other points, but in my experience this one is (arguably) no
> longer true. I've often found the JVM library ecosystem to be lacking in
> comparison to Python's, especially for newer problem domains. I'd attribute
> this to Java no longer being a "hip" language, which counts for a lot in
> OSS development!
>
> --
> 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: Using metadata to specify how calls to a macro should be indented

2015-09-15 Thread Josh Tilles


On Sunday, September 13, 2015 at 8:25:42 AM UTC-4, Artur Malabarba wrote:
>
>
> On 13 Sep 2015 12:33 pm, "Matching Socks"  > wrote:
> >
> > Unless clojure.core itself will carry these annotations, could the 
> keyword be namespaced?
>
> Or do you mean it should be ::indent? (i.e., carry the namespace of the 
> var that they're applied on)
>
I suspect that “Matching Socks” meant that there should be a standard 
namespace, similar to how the recent Socket Server REPL design 

 uses 
a “repl” namespace for its magic keywords.
It seems natural to me to pick a namespace like “editors” or “editing”, but 
alternatives like :display/indentation or :visual/structure also look good.

-- 
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: Stuart Sierra's Component: retries & restarts in production

2015-09-06 Thread josh


On Thursday, September 3, 2015 at 9:15:54 AM UTC-4, Andy- wrote:
>
> Only to answer the "retry on error" part of you question: You might like 
> hara/event:
> http://docs.caudate.me/hara/hara-event.html
>
Thanks for the tip! I've been meaning to check out hara anyway. If I end up 
using it I'll post a follow-up.

>
> HTH
>
> On Wednesday, September 2, 2015 at 8:44:07 PM UTC-4, jo...@signafire.com 
> wrote:
>>
>> TLDR: how do you use Component when the application logic involves 
>> retrying failed components?
>>
>> Background:
>> I'm writing an app that consumes events from a streaming HTTP connection 
>> and writes those events to a message queue (see Code Illustration #1). It 
>> seems like that could be captured easily with three components —an HTTP 
>> stream, a message queue connection, and a "shoveler" that depends on the 
>> other two (see Code Illustration #2)— *but* the reconnection 
>> requirements complicate things…
>> The HTTP connection may be closed at any time by the server; if that 
>> happens, the app should persistently attempt to reconnect using an 
>> exponential back-off pattern. In addition, if the app goes thirty seconds 
>> without receiving any data, it should close the connection and try to 
>> reconnect. (see Code Illustration #3) It's not clear to me how to best 
>> express these "retry" requirements in the component lifecycle. Like, is it 
>> blasphemous for a component to be calling stop and start on its injected 
>> dependencies?
>>
>> Some possible approaches:
>>
>>- Throw different kinds of exceptions to indicate what should happen 
>>(using namespaced keywords, perhaps?), handled by whoever calls 
>>component/start on the system-map.
>>- The exception provides the component and system at the time of the 
>>   exception, enabling a sort of "resume" capability.
>>   - I'm under the impression that relying on exceptions for control 
>>   flow is an anti-pattern.
>>- Create a sort of custom system implementation, one that goes beyond 
>>calling start on its components in dependency order to monitor 
>>failures and direct retries "appropriately".
>>   - "A system is a component which knows how to start and stop other 
>>   components." (from the README)
>>   So the fact that we want the shoveler component to be capable of 
>>   restarting the HTTP component indicates that the shoveler should 
>> actually 
>>   be considered a system. (right?)
>>  - If the HTTP stream is *injected* into the shoveler as a 
>>  dependency, how is it possible for the shoveler to stop the 
>>  HTTP stream and then start it again *with* any dependencies the 
>>  stream may have?
>>   - Ensure that every component/Lifecycle method implementation is 
>>idempotent, so that I can get good-enough "restart" semantics by just 
>>calling start-system again.
>>   - I know that idempotence is generally a Good Thing anyway, but 
>>   using start-system as a panacea strikes me as crude.
>>
>>
>> Code Illustrations:
>>
>> 1. Rough sketch of app without timeout/retry logic or component:
>> (defn -main []
>>   (let [mq-conn (connect-to-queue mq-config)
>> {event-stream :body} (http/get endpoint {:as :stream})]
>> (with-open [rdr (java.io/reader event-stream)]
>>   (doseq [entity (line-seq rdr)]
>> (write mq-conn entity)
>>
>> 2. Rough sketch of app with component but still without timeout/retry 
>> logic:
>> (defrecord EventStream [endpoint
>> http-config
>> stream]
>>   component/Lifecycle
>>   (start [this]
>> (let [response (http/get endpoint (merge {:as :stream} http-config))]
>>   (assoc this :http-response response, :stream (:body response)))
>>   (stop [this]
>> (.close stream)
>> (-> this (dissoc :http-response) (assoc :stream nil
>>
>> (defrecord MessageQueue [config
>>  connection]
>>   component/Lifecycle
>>   (start [this]
>> (assoc this :connection (connect-to-queue config)))
>>   (stop [this]
>> (.close connection)
>> (assoc this :connection nil)))
>>
>> (defrecord Shoveler [source sink
>>  worker]
>>   component/Lifecycle
>>   (start [this]
>> ;; To avoid blocking indefinitely, we put the processing in a future.
>> (assoc this :worker (future
>>  (with-open [rdr (java.io/reader (:stream source
>> )]
>>(doseq [entity (line-seq rdr)]
>>  (write sink entity)
>>   (stop [this]
>> (future-cancel worker)
>> (assoc this :worker nil)))
>>
>> (defn -main []
>>   (-> (component/system-map :config (read-config)
>> :events (map->EventStream {:endpoint endpoint
>> })
>> :mq-client (map->MessageQueue {})
>> :shoveler (map->Shoveler {}))
>>   (component/using 

Re: Stuart Sierra's Component: retries & restarts in production

2015-09-06 Thread josh
Thanks a ton for writing all of this up. I'm actually using Langohr & 
RabbitMQ as well, so I have the sense that you've solved problems that I 
might encounter down the road.

On Friday, September 4, 2015 at 7:57:21 AM UTC-4, Dave Tenny wrote:
>
> I'm using components to encapsulate Langohr/RabbitMQ interactions in cases 
> where Langohr auto-recovery wasn't happy with what was going on.
>
> I make sure the Lifecycle methods are idempotent, built the component 
> stack in the correct order.  
>
> To make sure that I can deal with the exceptions that require restarting 
> the component stack, I have some macros that wrap up exception handling, 
> retries, and component stack restarts.
>
> So
>
> (with-rmq-publisher! [channel component-system]
>   ... do my stuff ...)
>
> The body of the macro ("... do my stuff ...") is turned into a function 
> and and will be re-executed if the system is restarted, so you have to 
> beware
> of side effects or other things you may not want executed multiple times. 
>  Not a problem for me, all I'm doing is entering the macro long enough
> to get a channel and publish to it, or similar types of things.
>
> The component-system is a wrap of the system-map call with some other 
> data, in an atom, that will be mutated
> if we do things like dynamically add subscribers to the system or call 
> (restart! component-system).
> There are some thread safety/locking concerns, since a connection failure 
> is likely to be seen by callers
> on multiple threads using the components, and I try to avoid race 
> conditions on restarts (only one thread will do the restart until it 
> succeeds, 
> the unblock the others).
>
> Hope this helps with strategy, even if the code is omitted.
>
> The trick to me was not in restarting the component stack, but in managing 
> the shared state across threads safely and making sure (with-stack-activity 
> [system] )
> code was prepared to re-execute on failures with new connections or other 
> stack components.
>
> In my case I also needed to add components to the stack dynamically.  Not 
> often, but dynamcially, not at (system-map) call time.  That required some 
> lock consideration,
> and I'd have to call Lifecycle/start on the stack every time I added a 
> component.  They methods have to be idempotent.
>
>   
>

-- 
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: Stuart Sierra's Component: retries & restarts in production

2015-09-04 Thread Josh Tilles
I just found the other resources from the Component wiki 
—it may be that 
something linked from there addresses exactly my situation.

On Wednesday, September 2, 2015 at 8:44:07 PM UTC-4, jo...@signafire.com 
wrote:
>
> TLDR: how do you use Component when the application logic involves 
> retrying failed components?
>
> Background:
> I'm writing an app that consumes events from a streaming HTTP connection 
> and writes those events to a message queue (see Code Illustration #1). It 
> seems like that could be captured easily with three components —an HTTP 
> stream, a message queue connection, and a "shoveler" that depends on the 
> other two (see Code Illustration #2)— *but* the reconnection requirements 
> complicate things…
> The HTTP connection may be closed at any time by the server; if that 
> happens, the app should persistently attempt to reconnect using an 
> exponential back-off pattern. In addition, if the app goes thirty seconds 
> without receiving any data, it should close the connection and try to 
> reconnect. (see Code Illustration #3) It's not clear to me how to best 
> express these "retry" requirements in the component lifecycle. Like, is it 
> blasphemous for a component to be calling stop and start on its injected 
> dependencies?
>
> Some possible approaches:
>
>- Throw different kinds of exceptions to indicate what should happen 
>(using namespaced keywords, perhaps?), handled by whoever calls 
>component/start on the system-map.
>- The exception provides the component and system at the time of the 
>   exception, enabling a sort of "resume" capability.
>   - I'm under the impression that relying on exceptions for control 
>   flow is an anti-pattern.
>- Create a sort of custom system implementation, one that goes beyond 
>calling start on its components in dependency order to monitor 
>failures and direct retries "appropriately".
>   - "A system is a component which knows how to start and stop other 
>   components." (from the README)
>   So the fact that we want the shoveler component to be capable of 
>   restarting the HTTP component indicates that the shoveler should 
> actually 
>   be considered a system. (right?)
>  - If the HTTP stream is *injected* into the shoveler as a 
>  dependency, how is it possible for the shoveler to stop the HTTP 
>  stream and then start it again *with* any dependencies the 
>  stream may have?
>   - Ensure that every component/Lifecycle method implementation is 
>idempotent, so that I can get good-enough "restart" semantics by just 
>calling start-system again.
>   - I know that idempotence is generally a Good Thing anyway, but 
>   using start-system as a panacea strikes me as crude.
>
>
> Code Illustrations:
>
> 1. Rough sketch of app without timeout/retry logic or component:
> (defn -main []
>   (let [mq-conn (connect-to-queue mq-config)
> {event-stream :body} (http/get endpoint {:as :stream})]
> (with-open [rdr (java.io/reader event-stream)]
>   (doseq [entity (line-seq rdr)]
> (write mq-conn entity)
>
> 2. Rough sketch of app with component but still without timeout/retry 
> logic:
> (defrecord EventStream [endpoint
> http-config
> stream]
>   component/Lifecycle
>   (start [this]
> (let [response (http/get endpoint (merge {:as :stream} http-config))]
>   (assoc this :http-response response, :stream (:body response)))
>   (stop [this]
> (.close stream)
> (-> this (dissoc :http-response) (assoc :stream nil
>
> (defrecord MessageQueue [config
>  connection]
>   component/Lifecycle
>   (start [this]
> (assoc this :connection (connect-to-queue config)))
>   (stop [this]
> (.close connection)
> (assoc this :connection nil)))
>
> (defrecord Shoveler [source sink
>  worker]
>   component/Lifecycle
>   (start [this]
> ;; To avoid blocking indefinitely, we put the processing in a future.
> (assoc this :worker (future
>  (with-open [rdr (java.io/reader (:stream source)]
>(doseq [entity (line-seq rdr)]
>  (write sink entity)
>   (stop [this]
> (future-cancel worker)
> (assoc this :worker nil)))
>
> (defn -main []
>   (-> (component/system-map :config (read-config)
> :events (map->EventStream {:endpoint endpoint
> })
> :mq-client (map->MessageQueue {})
> :shoveler (map->Shoveler {}))
>   (component/using {:events {:http-config :config}
> :mq-client {:config :config}
> :shoveler {:source :events
>:sink :mq-client}})
>   component/start))
>
> 3. Rough sketch of 

Stuart Sierra's Component: retries & restarts in production

2015-09-02 Thread josh
TLDR: how do you use Component when the application logic involves retrying 
failed components?

Background:
I'm writing an app that consumes events from a streaming HTTP connection 
and writes those events to a message queue (see Code Illustration #1). It 
seems like that could be captured easily with three components —an HTTP 
stream, a message queue connection, and a "shoveler" that depends on the 
other two (see Code Illustration #2)— *but* the reconnection requirements 
complicate things…
The HTTP connection may be closed at any time by the server; if that 
happens, the app should persistently attempt to reconnect using an 
exponential back-off pattern. In addition, if the app goes thirty seconds 
without receiving any data, it should close the connection and try to 
reconnect. (see Code Illustration #3) It's not clear to me how to best 
express these "retry" requirements in the component lifecycle. Like, is it 
blasphemous for a component to be calling stop and start on its injected 
dependencies?

Some possible approaches:

   - Throw different kinds of exceptions to indicate what should happen 
   (using namespaced keywords, perhaps?), handled by whoever calls 
   component/start on the system-map.
   - The exception provides the component and system at the time of the 
  exception, enabling a sort of "resume" capability.
  - I'm under the impression that relying on exceptions for control 
  flow is an anti-pattern.
   - Create a sort of custom system implementation, one that goes beyond 
   calling start on its components in dependency order to monitor failures 
   and direct retries "appropriately".
  - "A system is a component which knows how to start and stop other 
  components." (from the README)
  So the fact that we want the shoveler component to be capable of 
  restarting the HTTP component indicates that the shoveler should actually 
  be considered a system. (right?)
 - If the HTTP stream is *injected* into the shoveler as a 
 dependency, how is it possible for the shoveler to stop the HTTP 
 stream and then start it again *with* any dependencies the stream 
 may have?
  - Ensure that every component/Lifecycle method implementation is 
   idempotent, so that I can get good-enough "restart" semantics by just 
   calling start-system again.
  - I know that idempotence is generally a Good Thing anyway, but using 
  start-system as a panacea strikes me as crude.
   

Code Illustrations:

1. Rough sketch of app without timeout/retry logic or component:
(defn -main []
  (let [mq-conn (connect-to-queue mq-config)
{event-stream :body} (http/get endpoint {:as :stream})]
(with-open [rdr (java.io/reader event-stream)]
  (doseq [entity (line-seq rdr)]
(write mq-conn entity)

2. Rough sketch of app with component but still without timeout/retry logic:
(defrecord EventStream [endpoint
http-config
stream]
  component/Lifecycle
  (start [this]
(let [response (http/get endpoint (merge {:as :stream} http-config))]
  (assoc this :http-response response, :stream (:body response)))
  (stop [this]
(.close stream)
(-> this (dissoc :http-response) (assoc :stream nil

(defrecord MessageQueue [config
 connection]
  component/Lifecycle
  (start [this]
(assoc this :connection (connect-to-queue config)))
  (stop [this]
(.close connection)
(assoc this :connection nil)))

(defrecord Shoveler [source sink
 worker]
  component/Lifecycle
  (start [this]
;; To avoid blocking indefinitely, we put the processing in a future.
(assoc this :worker (future
 (with-open [rdr (java.io/reader (:stream source)]
   (doseq [entity (line-seq rdr)]
 (write sink entity)
  (stop [this]
(future-cancel worker)
(assoc this :worker nil)))

(defn -main []
  (-> (component/system-map :config (read-config)
:events (map->EventStream {:endpoint endpoint})
:mq-client (map->MessageQueue {})
:shoveler (map->Shoveler {}))
  (component/using {:events {:http-config :config}
:mq-client {:config :config}
:shoveler {:source :events
   :sink :mq-client}})
  component/start))

3. Rough sketch of desired *production* behavior, not using Component:
(defn -main []
  (let [mq-conn (connect-to-queue mq-config)]
(while true  ; ideally, the app is *always* ready to receive incoming 
events & put them into the queue
  (try
(let [{event-stream :body} (loop [conn-timeout 1000]
 (try
   (http/get endpoint
 {:as :stream
 

Re: I am looking for xml parsing lib

2015-08-25 Thread Josh Kamau
Thanks all. clojure.xml/parse worked for me.

On Tue, Aug 25, 2015 at 1:52 AM, Jordan Schatz jor...@noionlabs.com wrote:

 Which is the recommended xml parsing lib for clojure?


 I think you are after clojure.xml/parse
 http://conj.io/store/v1/org.clojure/clojure/1.7.0/clj/clojure.xml/parse/
 and friends:
 http://conj.io/store/v1/org.clojure/clojure/1.7.0/clj/clojure.core/xml-seq/
 http://conj.io/store/v1/org.clojure/clojure/1.7.0/clj/clojure.zip/xml-zip/

 - Jordan

 On Mon, Aug 24, 2015 at 12:50 PM, blake watson dsblakewat...@gmail.com
 wrote:

 I believe that's it, though.

 On Mon, Aug 24, 2015 at 10:48 AM, Josh Kamau joshnet2...@gmail.com
 wrote:

 Hello;

 Which is the recommended xml parsing lib for clojure?

 clojure.data.xml was last updated 10months ago and is still on version
 0.0.8

 Thanks
 Josh

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


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


I am looking for xml parsing lib

2015-08-24 Thread Josh Kamau
Hello;

Which is the recommended xml parsing lib for clojure?

clojure.data.xml was last updated 10months ago and is still on version 0.0.8

Thanks
Josh

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

2015-06-25 Thread Josh Kamau
http://www.braveclojure.com/

On Thu, Jun 25, 2015 at 12:10 PM, Baishampayan Ghose b.gh...@gmail.com
wrote:

 http://lmgtfy.com/?q=clojure+tutorial

 Hope this helps.

 ~BG

 On Thu, Jun 25, 2015 at 7:21 AM, Baskar Kalyanasamy baskar...@gmail.com
 wrote:
  hi everyone,
  can somebody send me materials for clojure. i am a
 beginner
  and i also want to in which tool or software i should practice in.
  thanks in advance
 
  --
  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.



 --
 Baishampayan Ghose
 b.ghose at gmail.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.


-- 
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: [new] GNU emacs settings for clojure ?

2015-06-15 Thread Josh Kamau
You could also try emacs-live  if you are an emacs beginner.
https://github.com/overtone/emacs-live

On Mon, Jun 15, 2015 at 9:32 AM, Jason Lewis ja...@decomplecting.org
wrote:

 M-x package-install cider should give you a better time.

 One is never stuck with emacs; one is privileged to enjoy it.

 On Sun, Jun 14, 2015, 18:01 Xavier xav...@maillard.im wrote:

 Hello,

 I am new to clojure (which I really appreciate). I am stuck with GNU
 emacs for all the stuff I do and I cannot find something.

 I am playing with Composure, starting it using lein (ring server).

 Is there any possibility to do this directly via cider ? If not, how can
 I connect to it ?

 Regards
 --
   Xavier
   xav...@maillard.im

 --
 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: Clojure needs a web framework with more momentum

2015-05-04 Thread Josh Kamau
I am currently trying to  redirect-after-post with validation errors.  I
have already cooked up my way of validating maps.  However, i cant find a
straight forward way for pushing the errors in a 'flash' and then read them
in my template (am currently using freemarker.). I have seen the flash
middleware but it seems to set one flash value.  My solution so far has
been to set cookies and expire them when i read.A framework would
handle this common cases very easily Or am i missing something?

Thanks.

On Mon, May 4, 2015 at 6:34 PM, Christopher Small metasoar...@gmail.com
wrote:

 Cheers, and thanks :-) It's free, so feel... free to use it :-)

 On Mon, May 4, 2015 at 8:28 AM, Marcus Blankenship mar...@creoagency.com
 wrote:

 Ok, honestly, this is super cool.  Well done!

 On May 4, 2015, at 8:19 AM, Christopher Small metasoar...@gmail.com
 wrote:

 I've been enjoying this thread, but don't currently have the bandwidth to
 read everyone's messages and figure out in my head what the distribution of
 opinions is or who is on what side of this conversation.

 Fortunately, I built a tool for this! It's called pol.is, and it uses
 real time data visualization and machine learning to help make sense of
 large scale conversations. It falls somewhere between an open ended survey
 and a comment thread. Instead of getting more difficult to grok with the
 number of people comments, it gets EASIER, because there is more data with
 which the ML  stats make magic.

 I started a conversation on the state of Web Development in Clojure:
 https://pol.is/7scufp.

 You don't need to create an account to log in and participate, but if you
 connect a social account (twitter, facebook), we can show your avatar and
 name where you fall in the conversation, so you can see where everyone else
 stands in relation to yourself.

 Oh, and by the way, the ML engine behind this app is in Clojure. Enjoy :-)

 Chris



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


 Best,
 Marcus

 Marcus Blankenship
 \\\ Technical Coach, Startup Advisor, Calvinist
 \\\ 541.805.2736 \ @justzeros \ skype:marcuscreo

  --
 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 a topic in the
 Google Groups Clojure group.
 To unsubscribe from this topic, visit
 https://groups.google.com/d/topic/clojure/tA2_IbU0unE/unsubscribe.
 To unsubscribe from this group and all its topics, 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: Clojure needs a web framework with more momentum

2015-05-04 Thread Josh Kamau
Thanks Sean. that makes sense.   I didnt want that map to be stored as one
cookie because it could potentially be big... (there is a 4kb limit per
cookie right?) . I will dig into it and check. If that works for me, then
all i need is compojure, ring and the awesome ring-defaults middleware.  No
need for a monolithic framework.

On Mon, May 4, 2015 at 8:49 PM, Sean Corfield s...@corfield.org wrote:

 Not sure what you mean by one flash value — I’d expect you to have a map
 of flash scope data and that’s the way my FW/1 behaves: you assoc values
 into the flash scope and they’re restored on the next request.

 On May 4, 2015, at 8:39 AM, Josh Kamau joshnet2...@gmail.com wrote:
  I am currently trying to  redirect-after-post with validation errors.
 I have already cooked up my way of validating maps.  However, i cant find a
 straight forward way for pushing the errors in a 'flash' and then read them
 in my template (am currently using freemarker.). I have seen the flash
 middleware but it seems to set one flash value.  My solution so far has
 been to set cookies and expire them when i read.A framework would
 handle this common cases very easily Or am i missing something?


 --
 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: Clojure needs a web framework with more momentum

2015-05-04 Thread Josh Kamau
@Sean, i wanted totally stateless backend.

On Mon, May 4, 2015 at 9:02 PM, Sean Corfield s...@corfield.org wrote:

 On May 4, 2015, at 10:53 AM, Josh Kamau joshnet2...@gmail.com wrote:
  Thanks Sean. that makes sense.   I didnt want that map to be stored as
 one cookie because it could potentially be big... (there is a 4kb limit per
 cookie right?) . I will dig into it and check. If that works for me, then
 all i need is compojure, ring and the awesome ring-defaults middleware.  No
 need for a monolithic framework.

 Depends on session-store, I believe. If you use in-memory, only the
 session ID is a cookie, the rest is in memory. Or you could use a data
 store for a distributed app (and, again, only the session ID would be a
 cookie).

 Only if your session-store is cookie will everything be stored as a cookie.

 Sean Corfield -- (904) 302-SEAN
 An Architect's View -- http://corfield.org/

 Perfection is the enemy of the good.
 -- Gustave Flaubert, French realist novelist (1821-1880)



 --
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clojure@googlegroups.com
 Note that posts from new members are moderated - please be patient with
 your 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: Clojure needs a web framework with more momentum

2015-05-04 Thread Josh Kamau
Another challenge is: There are alot of abandoned libraries and few reach
1.0. That makes selecting the libraries to compose abit difficult.

On Mon, May 4, 2015 at 9:59 PM, Gregg Reynolds d...@mobileink.com wrote:


 On May 4, 2015 7:16 AM, Eric MacAdie emaca...@gmail.com wrote:
 
  I think what Clojure needs is a default. It doesn't matter if it is a
 web framework like Rails, or libraries strung together like Luminus.
 

 What Clojure needs is, well nothing. What the market MAY need is an
 entrepreneur who will produce the framework the OP craves.  No takers so
 far.  Conclusion: not a genuine unmet need.   But in the long run simple
 economics say the Clojure approach will win.  You can't make your product
 stand out by using the same framework everybody else uses.  The inevitable
 trend, driven by basic economics, is toward bespoke stuff, which is where
 Clojure excels.  My guess is that over the next 2-3 years we will see some
 clojure frameworks emerge but they will not be like traditional
 frameworks.  They'll be infinitely and easily customizable because they
 wont force choices-they'll just make the easy stuff not only easy but
 flexible. My 2 cents.

  When a Ruby newbie asks how to make a web app, the default answer is to
 look at Rails. In Python, the default answer is Django. Compared to that,
 the default answer in Clojure to do it yourself can sound like go jump off
 a cliff.
 
  = Eric MacAdie
 
 
  On Mon, May 4, 2015 at 7:09 AM, Sean Johnson belu...@acm.org wrote:
 
 
 
  On Monday, May 4, 2015 at 4:41:02 AM UTC-4, Sven Richter wrote:
 
  All in all this is basically the direction I want to go with closp and
 closp-crud. The intention is not to have a webframework, but to automatize
 steps that need to be done manually otherwise.
 
 
  One potential problem with this web framework as app template
 approach is upgrade-ability.  When 2.0 of your framework comes out, what
 happens to an app generated from 1.0 that wants to benefit from the new
 capabilities?
 
  It's not a showstopper to the approach. It's just something to think
 hard about. I've taken a couple of long lived Rails apps from Rails 1 to
 Rails 4 and while there have been breaking changes with each major version
 change (and some minor versions) in general it's pretty easy to keep up
 with the latest versions and there are copious docs (even whole ebooks in
 some cases) to walk developers through the changes.
 
  Cheers,
  Sean
 
  --
  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.


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

Re: simple procedure for updating a value one level down

2015-01-26 Thread Josh Stratton
This is my current solution. Again, it works fine, but seems a little
verbose. I have a function called update-item, which has to call
update-item-in-category with the same parameters plus the category I'm
currently mapping through.
On Jan 26, 2015 8:11 AM, Lucas Bradstreet lucasbradstr...@gmail.com
wrote:

 Given these points I would probably just do:

 (defn update-val-with-id [values m]
 (map (fn [v]
  (if (= (:id v) id)
  (merge v m)
   v))
   values))

 I'm not that happy with it either, so other suggestions are welcome.

 On 27 January 2015 at 00:06, Josh Stratton strattonbra...@gmail.com
 wrote:
  They're not keyed by id because order in both the category and its items
 is
  important. I could maintain the order explicitly, but that just makes
 other
  problems like reordering more difficult.
 
  As a couple people have suggested I could access the page using vector
  indexing, but then I'd need to figure out what those induces are for the
  category and the page given the item id. That seems reasonable, but I'm
 not
  sure the best way to do that. I'm sure there's some python enumerate
  equivalent where I can map all categories and items and filter down just
 the
  pair with the matching item id.
 
  On Jan 26, 2015 7:47 AM, Michael Willis willismich...@gmail.com
 wrote:
 
  Now that I think about it, I wonder why your categories aren't keyed by
  id, like this:
 
  (def categories [ {1 {:text foo} 2 {:text bar :ack 5}} {3 {:age
 7}}])
 
  Then the update-in can take the category id, instead of having to know
 its
  index within a vector:
 
  (update-in categories [1 3]  merge { :age 12 :somethingElse 29 })
  [{1 {:text foo}, 2 {:text bar, :ack 5}} {3 {:age 12, :somethingElse
  29}}]
 
 
  On Monday, January 26, 2015 at 9:42:56 AM UTC-6, Michael Willis wrote:
 
  (def categories [ [ { :id 1 :text foo } { :id 2 :text bar :ack 5 }
 ]
  [ { :id 3 :age 7 } ] ])
  #'user/categories
  (update-in categories [1 0] merge { :age 12 :somethingElse 29 })
  [[{:text foo, :id 1} {:text bar, :ack 5, :id 2}] [{:age 12,
  :somethingElse 29, :id 3}]]
 
 
  On Monday, January 26, 2015 at 8:54:58 AM UTC-6, Erik Price wrote:
 
  Many functions that affect keyed collections will work on vectors if
 you
  supply the numeric index as a key.
 
  e
 
  On Monday, January 26, 2015, Josh Stratton stratto...@gmail.com
 wrote:
 
  I'm new to clojure and FP in general.  One thing that has always
 been a
  little confusing for me is working with immutable trees.  I have a
 vector of
  categories, each category containing a vector of items--each one a
 hashmap.
  In that hashmap I have a bunch of attributes including an item-id.
 Now,
  assuming I have an item id, what's the easiest way to update the
 appropriate
  hashmap?  I can't use an assoc, I believe, because my data is in a
  vector--not keyed by the id.
 
  What I have been doing is writing a function that maps the categories
  to new categories and then write another function that is called on
 every
  item and updates it iff the item id matches.  This works, but it
 seems
  really clunky and I'm assuming there's a simpler way to do it.
 
  ; categories is a vector of item vectors, where the item is a hash
  (def categories [ [ { :id 1 :text foo } { :id 2 :text bar :ack 5
 }
  ] [ { :id 3 :age 7 } ] ])
 
  Is there a more elegant workflow for updating categories?  Let's say
 I
  want to update item of id 3 with { :age 12 :somethingElse 29 },
 what's the
  easiest way to do this?
 
  ; so the return would be
  [ [ { :id 1 :text foo } { :id 2 :text bar :ack 5 } ] [ { :id 3
 :age
  12 :somethingElse 29 } ] ]
 
  --
  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

Re: simple procedure for updating a value one level down

2015-01-26 Thread Josh Stratton
They're not keyed by id because order in both the category and its items is
important. I could maintain the order explicitly, but that just makes other
problems like reordering more difficult.

As a couple people have suggested I could access the page using vector
indexing, but then I'd need to figure out what those induces are for the
category and the page given the item id. That seems reasonable, but I'm not
sure the best way to do that. I'm sure there's some python enumerate
equivalent where I can map all categories and items and filter down just
the pair with the matching item id.
On Jan 26, 2015 7:47 AM, Michael Willis willismich...@gmail.com wrote:

 Now that I think about it, I wonder why your categories aren't keyed by
 id, like this:

 (def categories [ {1 {:text foo} 2 {:text bar :ack 5}} {3 {:age 7}}])

 Then the update-in can take the category id, instead of having to know its
 index within a vector:

 (update-in categories [1 3]  merge { :age 12 :somethingElse 29 })
 [{1 {:text foo}, 2 {:text bar, :ack 5}} {3 {:age 12, :somethingElse
 29}}]


 On Monday, January 26, 2015 at 9:42:56 AM UTC-6, Michael Willis wrote:

 (def categories [ [ { :id 1 :text foo } { :id 2 :text bar :ack 5 } ]
 [ { :id 3 :age 7 } ] ])
 #'user/categories
 (update-in categories [1 0] merge { :age 12 :somethingElse 29 })
 [[{:text foo, :id 1} {:text bar, :ack 5, :id 2}] [{:age 12,
 :somethingElse 29, :id 3}]]


 On Monday, January 26, 2015 at 8:54:58 AM UTC-6, Erik Price wrote:

 Many functions that affect keyed collections will work on vectors if you
 supply the numeric index as a key.

 e

 On Monday, January 26, 2015, Josh Stratton stratto...@gmail.com wrote:

 I'm new to clojure and FP in general.  One thing that has always been a
 little confusing for me is working with immutable trees.  I have a vector
 of categories, each category containing a vector of items--each one a
 hashmap.  In that hashmap I have a bunch of attributes including an
 item-id.  Now, assuming I have an item id, what's the easiest way to update
 the appropriate hashmap?  I can't use an assoc, I believe, because my data
 is in a vector--not keyed by the id.

 What I have been doing is writing a function that maps the categories
 to new categories and then write another function that is called on every
 item and updates it iff the item id matches.  This works, but it seems
 really clunky and I'm assuming there's a simpler way to do it.

 ; categories is a vector of item vectors, where the item is a hash
 (def categories [ [ { :id 1 :text foo } { :id 2 :text bar :ack 5 }
 ] [ { :id 3 :age 7 } ] ])

 Is there a more elegant workflow for updating categories?  Let's say I
 want to update item of id 3 with { :age 12 :somethingElse 29 }, what's the
 easiest way to do this?

 ; so the return would be
 [ [ { :id 1 :text foo } { :id 2 :text bar :ack 5 } ] [ { :id 3 :age
 12 :somethingElse 29 } ] ]

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


simple procedure for updating a value one level down

2015-01-25 Thread Josh Stratton
I'm new to clojure and FP in general.  One thing that has always been a
little confusing for me is working with immutable trees.  I have a vector
of categories, each category containing a vector of items--each one a
hashmap.  In that hashmap I have a bunch of attributes including an
item-id.  Now, assuming I have an item id, what's the easiest way to update
the appropriate hashmap?  I can't use an assoc, I believe, because my data
is in a vector--not keyed by the id.

What I have been doing is writing a function that maps the categories to
new categories and then write another function that is called on every item
and updates it iff the item id matches.  This works, but it seems really
clunky and I'm assuming there's a simpler way to do it.

; categories is a vector of item vectors, where the item is a hash
(def categories [ [ { :id 1 :text foo } { :id 2 :text bar :ack 5 } ] [
{ :id 3 :age 7 } ] ])

Is there a more elegant workflow for updating categories?  Let's say I want
to update item of id 3 with { :age 12 :somethingElse 29 }, what's the
easiest way to do this?

; so the return would be
[ [ { :id 1 :text foo } { :id 2 :text bar :ack 5 } ] [ { :id 3 :age 12
:somethingElse 29 } ] ]

-- 
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: modifying a single item in a list: is a map the right choice?

2015-01-14 Thread Josh Stratton
That's cool, but I may be reading this from a file like json, applying the
change, and writing it back.  Changing it to a sorted list would take
linear time anyway, right?  And I'd just be writing it back out
immediately.  Still this seems like a very clean solution.  I'll have to
read up on how update-in syntax with sorted maps.  Thanks.

On Wed, Jan 14, 2015 at 10:31 PM, Fluid Dynamics a2093...@trbvm.com wrote:

 On Thursday, January 15, 2015 at 1:24:14 AM UTC-5, strattonbrazil wrote:

 Noob clojure question.  I have a list of items and I want to append a
 subitem to one of them.  They're currently unkeyed because I care about the
 order and it seemed more intuitive that way.

 (def items [{ :id 1 :subitems [] } { :id 2 :subitems [] }])

 So let's say I want a new list where the second one has two a new subitem
 would a map be appropriate, but only operate on the matching id?


 Blerk. That's going to be linear time. Why not use sorted-map?

 (def items (into (sorted-map) {1 {:id 1 :subitems []} 2 {:id 2 :subitems
 []}))

 (defn add-subitem [items id subitem]
   (update-in items [id :subitems] conj subitem))

 Now you can just pick the item out you want by its id, without a linear
 search, but they'll still be sorted by id.

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


modifying a single item in a list: is a map the right choice?

2015-01-14 Thread Josh Stratton
Noob clojure question.  I have a list of items and I want to append a
subitem to one of them.  They're currently unkeyed because I care about the
order and it seemed more intuitive that way.

(def items [{ :id 1 :subitems [] } { :id 2 :subitems [] }])

So let's say I want a new list where the second one has two a new subitem
would a map be appropriate, but only operate on the matching id?

; item-id and subitem in scope
(defn add-subitem-if-id-matches [item]
(if (= (item :id)
; return new item with additional subitem
; return unmodified item
)

and run that through a map?  It seems to work, but I'm not sure if that's
the best way to go about doing it.

(map add-subitem-if-id-matches items) ; returns new list of items where
subitem has been added to one of them.

A more simple example.

'( '(1, hello) '(2, goodbye) )

Would I run something like this through a map if I wanted to only
map/modify certain elements like if the first element was 2 or even or
something?

'( '(1, hello) '(2, ack) )

-- 
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: A (foolish) plan to re-invent IO on top of core.async

2015-01-06 Thread Josh Kamau
There is also vertx.io with the clojure module.

Josh

On Tue, Jan 6, 2015 at 3:43 PM, Max Penet m...@qbits.cc wrote:

 Jet is already very usable and used in production by some notable
 projects/clients.
 I am also working on improving the backpressure story on all fronts at the
 moment (matter of few days at most).

 --
 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: reading to learn and acquire the skill of writing optinal Clojure code

2014-09-26 Thread Josh Kamau
This is how i did it.

I tried to solve https://www.4clojure.com/  problems and look at
corresponding clojure.core functions for solutions.

E.g  look at this https://www.4clojure.com/problem/21   Note the special
restriction (i.e do not use 'nth' function)

The solution to that is actually the implementation of the nth function in
clojure core. So you can go to clojure.core/nth to see how it is
implemented.

Josh

Josh

On Fri, Sep 26, 2014 at 4:28 PM, Leon Grapenthin grapenthinl...@gmail.com
wrote:

 I highly recommend the clojure.core namespace.

 On Friday, September 26, 2014 3:41:31 AM UTC+2, Andy Gibraltar wrote:


 Hi everyone,

 I am learning Clojure. I finished reading the book Clojure Programming. I
 think reading the source code of a Clojure project would help me accelerate
 acquiring the skill. Which codebase do you think is the most appropriate
 for a starter. A code base that I can use as a reference, something concise
 yet has almost all the best practices. Small enough that I can internalize
 and use it as a reference for my own projects. Sorry for asking such an
 open ended question.

 Thanks,
 Andy

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

2014-09-08 Thread Josh Lehman
Wilker, 

It seems that you haven't actually started the transactor. For developing, 
I'd recommend using lein-datomic 
https://github.com/johnwayner/lein-datomic. 

Hope that helps,
-Josh

On Sunday, September 7, 2014 8:06:55 PM UTC-7, Wilker wrote:

 Hi,

 I was using Datomic in memory for a few days, and now I tried to switch 
 for a more persistent storage. First I tried just using the free, but I was 
 getting this error:

 CompilerException java.lang.NoSuchMethodError: 
 clojure.lang.SeqIterator.init(Lclojure/lang/ISeq;)V, 
 compiling:(form-init5913779045640355531.clj:1:11) 

 Then I tried to use pro to see if that works, but end up with same results.

 The funny part is, if I try to connect just after launching the transactor 
 I get this:

 (def conn (d/connect uri))
 CompilerException clojure.lang.ExceptionInfo: Error communicating with 
 HOST localhost on PORT 4334 {:alt-host nil, :peer-version 2, :password 
 ..., :username ..., :port 4334, :host localhost, :version 0.9.4894, 
 :timestamp 1410145249419, :encrypt-channel true}, 
 compiling:(form-init5913779045640355531.clj:1:11) 

 Then if I run same thing again:

 (def conn (d/connect uri))
 CompilerException java.lang.NoSuchMethodError: 
 clojure.lang.SeqIterator.init(Lclojure/lang/ISeq;)V, 
 compiling:(form-init5913779045640355531.clj:1:11) 

 Running (d/create-database) works just fine (I can confirm by checking on 
 the console).

 All that I get from datomic transactor log is this:

 2014-09-08 00:05:24.455 INFO  defaultdatomic.lifecycle - {:tid 26, 
 :pid 58071, :host localhost, :port 4334, :encrypt-channel true, :version 
 0.9.4894, :timestamp 1410145524454, :event :transactor/heartbeat, :rev 
 198}

 I have no more idea about what to do to fix it... You guys know what this 
 issue is about?

 Thanks.
 ---
 Wilker Lúcio
 http://about.me/wilkerlucio/bio
 Woboinc Consultant
 +55 81 82556600
  

-- 
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 clojars down?

2014-07-29 Thread Josh Kamau
I cannot.

Oops! Google Chrome could not find cljars.org


Josh


On Tue, Jul 29, 2014 at 3:44 PM, Di Xu xudi...@gmail.com wrote:

 I can open cljars.org as normal, and can also download jars from there.

 2014-07-29 20:42 GMT+08:00 Yves Parès limestr...@gmail.com:

 Hi, it seems than clojars is down. Lein refuses to start, and apparently
 it won't download jars from maven central either...
 Am I the only one with this problem?

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

2014-07-29 Thread Josh Kamau
Sorry... the url is clojars.org and its working perfectly.

josh


On Tue, Jul 29, 2014 at 3:46 PM, Marc Limotte mslimo...@gmail.com wrote:

 lein is working for me, and is downloading jars from clojars.  Assuming
 it's a network issue on your side, and if you don't need any new jars right
 now (b/c it's just looking for updates), you can try the -o (for offline)
 option.



 On Tue, Jul 29, 2014 at 8:42 AM, Yves Parès limestr...@gmail.com wrote:

 Hi, it seems than clojars is down. Lein refuses to start, and apparently
 it won't download jars from maven central either...
 Am I the only one with this problem?

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


[ANN] ring-transit 0.1.1 released

2014-07-27 Thread Josh Lehman
I've just thrown together a ring middleware for transit 
https://github.com/cognitect/transit-format with an api like that of 
ring-json https://github.com/ring-clojure/ring-json. 

You can check it out here: ring-transit 
https://github.com/jalehman/ring-transit.

-Josh

-- 
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:Lisp :: LSD:Meditation

2014-06-13 Thread Josh Kamau
If i were to be asked, i would restrict the group to:
1. Any type of question that is related to clojure
2. Any type of announcement on clojure core library
3. Any new library/version
4. Any link to a narration on real life usages (e.g how we did xyz with
clojure) or benchmarks  (generally hard facts )
5. Any link to new book, tutorial, training materials.

This is just my opinion, I dont know the group policy and may be its all up
to me to choose what i want to read and what i dont want to and probably
keep my feelings to myself ;)

Josh


On Fri, Jun 13, 2014 at 12:34 PM, Dave Della Costa ddellaco...@gmail.com
wrote:

 I'm not sure what the problem is here.  I've posted personal blog links
 before that were Clojure related; I sincerely thought that it was
 potentially useful to the group, and I more or less got responses that
 supported that.

 That being the case, I'm having a hard time understanding what is so
 different about my blog post and Divyansh's; as far as I can tell, this
 post is relevant to Clojure, even if it's a bit more...exploratory.  It
 has Clojure code examples, it talks about Common Lisp and Python and
 metaprogramming.  It's clearly not random spam.

 So it seems to me that some folks simply don't like the content; that's
 fine, but I think it's a stretch to say that it's not appropriate for
 this list.  Or if it is not appropriate, then even relevant blog posts
 should never be appropriate, and arguably stuff like, say, epic
 ruminations on the nature of literate programming would arguably be even
 less appropriate for the list.

 DD

 (2014/06/13 11:25), Gary Trakhman wrote:
  To be fair, I actually read the thing, but I hoped to see more
  interesting information on LSD, meditation and Clojure than the headline
  would suggest :-).
 
 
  On Thu, Jun 12, 2014 at 10:01 PM, Atamert Ölçgen mu...@muhuk.com
  mailto:mu...@muhuk.com wrote:
 
  There's also Planet Clojure http://clojure.in/.
 
  @Divyansh
 
  Josh, Hussein and Gary are not the only ones who think this sort of
  traffic building is uncool. By traffic building I mean; sending a
  message with a link that has no valuable information for the group
  members. They are probably just nodding their head and thinking that
  sending another response is not necessary. At least that's what I
  did before I saw your response.
 
  90% of the messages in this group doesn't interest me. That's fine.
  Valuable information for someone else. But I certainly wouldn't want
  everybody to post their blogs here regularly. Because each message
  is a tiny little distraction. I'm willing to pay the price because
  when a really cool library is announced for example, I get a big
  reward. Let's keep the benefit/cost ratio, time-wise 
  attention-wise, high.
 
 
 
 
  On Thu, Jun 12, 2014 at 10:05 PM, Gary Trakhman
  gary.trakh...@gmail.com mailto:gary.trakh...@gmail.com wrote:
 
  Twitter's a more organic way to do this.  Your followers can
  read it, decide to retweet or not.
 
 
  On Thu, Jun 12, 2014 at 5:37 PM, Divyansh Prakash
  divyanshprakas...@gmail.com
  mailto:divyanshprakas...@gmail.com wrote:
 
  Sorry if you feel that way. Thought i could share my
  thoughts and start an interesting discussion.
  That is what the group is for.
  You are obviously free to skip anything that doesn't
  interest you. That was the prime reason for the concise
 title.
  I have no intentions of misleading anyone.
 
  --
  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 mailto: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
  mailto:clojure%2bunsubscr...@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
  mailto:clojure%2bunsubscr...@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
  mailto:clojure@googlegroups.com
  Note that posts from new members

Re: Clojure:Lisp :: LSD:Meditation

2014-06-12 Thread Josh Kamau
I feel USED when you use the mailing list to drive traffic to your blog.


On Thu, Jun 12, 2014 at 4:44 PM, Divyansh Prakash 
divyanshprakas...@gmail.com wrote:

 (and rant about other stuff I don't know a whole lot about)

 --
 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: emacs - some output goes to stdout when using cider

2014-05-26 Thread Josh Kamau
Any particular reason why you cant use emacs-live? Its comes configured for
clojure among other stuff out of the box.

Josh


On Mon, May 26, 2014 at 6:32 PM, Don Hill dhill.nov...@gmail.com wrote:


 I am making a switch to emacs and trying to get cider setup. I think for
 the most part everything is working correctly.
 I am in a project with a test.clj file and if I do a (println Hi) C-x
 C-e it goes to repl as expected. If I do something like (+ 1 2 3) it seems
 to go to stdout below the status bar.

 Am I missing some config in emacs that allows all the output to goto the
 repl?

 Thanks.

  --
 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: Potential Intro clojure projects - libraries and ideas with wow factor

2014-04-16 Thread Josh Kamau
Can core.logic be used to implement something like
http://www.optaplanner.org  ?

Josh


On Wed, Apr 16, 2014 at 9:36 AM, utel umeshtel...@gmail.com wrote:

 Thanks Mikera and Andrew for the ideas. Some interesting suggestions
 there. I'll discuss these with my fellow devs. Much appreciated.


 On Tuesday, April 15, 2014 1:14:11 AM UTC+1, Andrew Chambers wrote:

 Clojure logic programming with core.logic (something akin to a sudoku
 solver https://gist.github.com/swannodette/3217582 is a good example) or
 using datomic to have a database with a time machine and datalog for
 queries might be cool (perhaps visualizing the data in the database at
 arbitrary times in the past). Both don't really have equivalents in other
 languages. Other things that are hard to achieve in other languages would
 involve the immutable data structures, concurrency, and macros.


 On Monday, April 14, 2014 9:15:31 AM UTC+12, utel wrote:

 A handful of developers at the organisation I work at, want to encourage
 interest in Clojure with the aim of using it in production amongst the
 organisation's wider developer community (hundreds of developers). We
 ourselves are Clojure hobbyists.

 We wanted to do this through a basic project (with few moving parts), so
 I wanted to get feedback on a couple of aspects:
 1. Examples of basic project ideas that would be compelling to fellow
 developers not familiar with Clojure (e.g. something useful that you can do
 easily with Clojure that's harder to do in more established languages such
 as Java)
 2. Particular libraries that again had a wow factor towards an objective
 not easily achievable in more established languages (perhaps related to
 data analysis, visualisation, or taking advantage of the benefit of lazy
 evaluation in a novel way as examples).

 I realise these questions are somewhat open-ended, but just wanted to
 spark off some ideas for us through bouncing these questions off the google
 group's members.

 Thanks for any leads!

  --
 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: is there a way I can learn clojure with a lot of exercises

2014-04-16 Thread Josh Kamau
more exercises here http://clojure-euler.wikispaces.com/Problem+001


On Wed, Apr 16, 2014 at 10:53 AM, Roelof Wobben rwob...@hotmail.com wrote:



 Thanks,

 Can this site also be good : http://www.braveclojure.com/

 Roelof


 Op woensdag 16 april 2014 09:07:36 UTC+2 schreef Bruce Wang:

 Try 4clojure.com


 On Wed, Apr 16, 2014 at 4:56 PM, Roelof Wobben rwo...@hotmail.comwrote:

 Hello,

 I like to try clojure.
 I have little or none programming background but I know I learn the best
 by reading a piece of text
 and then do exercises about it so I can check if I really understand it.

 What is then the best way to proceed ?

 Roelof

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




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


-- 
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: Uberjar woes

2014-04-11 Thread Josh Lehman
Tom, 

Not sure if you every figured this out, but I'm having the same issue. In 
my case, the error points to the Lifecycle protocol in 
https://github.com/stuartsierra/component
 (com/stuartsierra/component/Lifecycle). 

It's a pretty barebones configuration. 
https://gist.github.com/jalehman/10494205

On Thursday, February 27, 2014 11:49:38 AM UTC-8, Tom Connors wrote:

 Hi Everyone,
 I've been having trouble creating an uberjar of a project and I'm hoping 
 someone here can point me toward a solution.
 After cleaning out the target directory (with lein clean) and 
 preprocessing my cljx, I can run the project with no trouble using lein 
 repl and lein run. I can package up the project (lein with-profile prd 
 uberjar) and get the resultant jar files. After that, the trouble starts. 
 Running the jar (java -jar my-standalone.jar) fails with a 
 NoClassDefFoundError error, pointing at a protocol defined in 
 weaverjester's clout - 
 https://github.com/weavejester/cloutclout/core/Route. 
 I highly doubt clout actually has anything to do with the problem. After 
 creating the uberjar, I can no longer run the project with lein run or lein 
 repl - I get the same error, and I can't do anything with lein without 
 getting that error until I remove the target directory. 
 I've inspected the jar and can see that it contains clout, but just 
 clout/core.clj - no .class files. I edited clout's project.clj to include 
 :aot :all, packaged it into a jar, replaced the clout jar in my local maven 
 repo with that new jar, and re-packaged my project. At this point, when I 
 ran the jar, I got another NoClassDefFoundError, this time pointing at 
 another protocol, but this one from clojure.core: clojure/lang/ILookupHost.
 I've been having this problem with the latest leiningen (2.3.4) and 2.2.0. 
 I've been futzing with my project.clj for some time, but to no avail. Any 
 help greatly appreciated.
 -Tom


-- 
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: Uberjar woes

2014-04-11 Thread Josh Lehman
I've come up with a fix after lots of fiddling, and I cannot quite explain 
it -- but it works!

The component library involves creating records that implement the 
Lifecycle protocol. In every namespace where I implemented that protocol, I 
added a (:gen-class) to the namespace declaration. I also had a *user*namespace 
for development that used required the component library. I moved 
this into the project itself also: (ns user) - (ns fmspider.user). 
Finally, I switched back and forth between having :clean-non-project-files 
set to true and false -- the only thing that worked was having it set to 
*false*. Every time I build, I always start with lein clean to be sure. 

Still not quite sure why it is that things worked this way, or if some 
other combination of the above would yield the same result.

On Friday, April 11, 2014 2:18:27 PM UTC-7, James Reeves wrote:

 Clout doesn't depend on any protocols in Clojure. The only protocol it 
 uses is defined within the clout.core namespace itself.

 Problems like this are often caused by compiled class files on your 
 classpath. Often they are in the target directory, which can be solved by a 
 lein clean. The :clean-non-project-files option being set to false in 
 Josh's configuration looks very suspicious!

 I've also had problems with class files being accidentally included in the 
 jars of dependencies. In rare cases a dependency may contain class files 
 from other projects, and because class files outrank clj source files, you 
 end up with some pretty bizarre behaviour in such cases.

 - James


 On 11 April 2014 22:09, Tom Connors t.v.c...@gmail.com javascript:wrote:

 Hi Josh,
 My solution ended up being pretty lame: I stopped calling a function from 
 clout, and the uberjar magically worked, as disappointing as that 
 explanation is. As far as I could tell, the root cause of my problem was 
 that clout depends on an old version of clojure (1.2, if I recall 
 correctly) that defined a protocol that no longer exists in newer versions.
 It doesn't look to me like you're getting the error for the same reason. 
 Have you tried the standard things, like blow away the target directory and 
 make sure you've required the ns before using its vars? How about.. and I 
 hate this idea too... one by one, remove dependencies + code that uses 
 them, and see if you can get a working jar? 
 When you do manage to figure this out, please post back here, as I'd like 
 to understand this error better (it sure is annoying, huh?).


 On Thursday, February 27, 2014 2:49:38 PM UTC-5, Tom Connors wrote:

 Hi Everyone,
 I've been having trouble creating an uberjar of a project and I'm hoping 
 someone here can point me toward a solution.
 After cleaning out the target directory (with lein clean) and 
 preprocessing my cljx, I can run the project with no trouble using lein 
 repl and lein run. I can package up the project (lein with-profile prd 
 uberjar) and get the resultant jar files. After that, the trouble starts. 
 Running the jar (java -jar my-standalone.jar) fails with a 
 NoClassDefFoundError error, pointing at a protocol defined in 
 weaverjester's clout - 
 https://github.com/weavejester/cloutclout/core/Route. 
 I highly doubt clout actually has anything to do with the problem. After 
 creating the uberjar, I can no longer run the project with lein run or lein 
 repl - I get the same error, and I can't do anything with lein without 
 getting that error until I remove the target directory. 
 I've inspected the jar and can see that it contains clout, but just 
 clout/core.clj - no .class files. I edited clout's project.clj to include 
 :aot :all, packaged it into a jar, replaced the clout jar in my local maven 
 repo with that new jar, and re-packaged my project. At this point, when I 
 ran the jar, I got another NoClassDefFoundError, this time pointing at 
 another protocol, but this one from clojure.core: clojure/lang/ILookupHost.
 I've been having this problem with the latest leiningen (2.3.4) and 
 2.2.0. 
 I've been futzing with my project.clj for some time, but to no avail. 
 Any help greatly appreciated.
 -Tom

  -- 
 You received this message because you are subscribed to the Google
 Groups Clojure group.
 To post to this group, send email to clo...@googlegroups.comjavascript:
 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 javascript:
 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 javascript:.
 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

Re: What's the best clojure library to access HBase?

2014-03-06 Thread Josh Kamau
The last time i searched... i couldnt find any that is still being
maintained. I ended up using the java api and its very simple.

Josh


On Thu, Mar 6, 2014 at 1:13 PM, tao tao.zhou2...@gmail.com wrote:

  the same as the title.

 --
 tao
 Sent with Sparrow http://www.sparrowmailapp.com/?sig

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


-- 
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: Latest web framework for clojure

2014-02-26 Thread Josh Kamau
If you are writting  blog-like application , check out caribou
http://caribou.github.io/caribou/docs/outline.html


On Wed, Feb 26, 2014 at 9:44 PM, Curtis Gagliardi 
gagliardi.cur...@gmail.com wrote:

 If you're interested in the url-generation and data-based routing, there
 are some Compojure competitors like Bidi which have those features without
 bringing on something as large as Pedestal: https://github.com/juxt/bidi(the 
 readme has a nice comparison chart).

 On Tuesday, February 25, 2014 11:57:18 PM UTC-8, Jan Herich wrote:

 It depends also on your requirements. For example if you want your app to
 work in many
 deployment scenarios (standalone Jetty  or Tomcat, J2EE web
 containers...) and you may
 have to use servlet 3.0 API asynchronous features, nothing beats pedestal
 currently.

 The concept of interceptors is little harder to grok then simple ring
 handlers (which are reused
 to the greatest possible extent anyway), but they really make sense and
 truly decomplect
 execution order, unlike traditional ring wrapping handlers.

 The routing systems is also more transparent (data based) then Compojure
 macro routing
 and the url generation facility is nice.

 Sometimes i hear people say that pedestal is unclojurish and complex,
 but i think they
 just don't get the difference between complex and easy. Overall, i think
 that pedestal
 represents core clojure philosophy better then any other clojure server
 side framework.

 Dňa streda, 26. februára 2014 2:13:30 UTC+1 Aravindh S napísal(-a):

 Hi All,
I have been reading clojure for sometime now. I am at a point where I
 want to learn a web framework. I see many options available for clojure
 where few are built upon others. So if I am to learn one, which framework
 does the community recommend?

 Thanks
 Aravindh.S

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


-- 
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: How to override the default port on 3000?

2014-02-25 Thread Josh Kamau
you can also change this line on your project.clj

:ring {:handler myproject.handler/app :port 8080}

Josh



On Tue, Feb 25, 2014 at 5:23 PM, Jason Stewart jstew...@fusionary.comwrote:

 The lein-ring plugin accepts a port number as an argument:

 lein ring server 8080

 Note, that in order to bind to port 80, you will need elevated (root)
 privileges.


 On Tue, Feb 25, 2014 at 9:21 AM, action actioncao2...@gmail.com wrote:

 I do like this:
 #lein new compojure-app guestbook
 #cd guestbook
 #lein ring server

 The server runs on port 3000 by default.
 But how to override the default port?
 Such as runs on port 80?

 thinks


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


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


-- 
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: Hiring Clojure developers for our distributed team at Outpace Systems

2014-02-19 Thread Josh Kamau
Yes... we care to know. I am in Nairobi, Kenya

Josh


On Wed, Feb 19, 2014 at 6:50 PM, Michael Klishin 
michael.s.klis...@gmail.com wrote:


 2014-02-19 18:41 GMT+04:00 Paul Stadig p...@stadig.name:

 If you are interested in working from home on a distributed team writing
 Clojure code, then feel free to contact me. If you aren't quite sure how
 the distributed team thing works, or are concerned about your Clojure skill
 level etc, then please still feel free to contact me. Not everyone at
 Outpace has a background in Clojure.


 Paul,

 I believe last time candidates from non-US timezones were not considered.
 Is it still the case? I'm pretty sure plenty of potential candidates on
 this list care to know.
 --
 MK

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

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


-- 
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: [ANN] mod-lang-clojure (for Vert.x) 1.0.0.Beta1 released

2014-01-23 Thread Josh Kamau
Awesome work guys.   I noted there is also some activity on the lein-vertx
github project.

Josh


On Tue, Jan 21, 2014 at 7:32 PM, Toby Crawley t...@tcrawley.org wrote:

 mod-lang-clojure[0] 1.0.0.Beta1 is no available in Maven Central.

 With this release, the API should be complete, and we hope to get a
 1.0.0.Final out in time to be included in bundled language
 implementation list in Vert.x 2.1.Final (due to be released in the next
 few weeks).

 So if you are interested in Clojure support on Vert.x, take this for a
 spin and help us shake out any issues before 1.0.0.

 You can see what changed in this release in the ChangeLog[1], and see
 how to use it with Vert.x 2.1M3 in the README[2].

 # What is mod-lang-clojure?

 mod-lang-clojure is the Clojure language module for Vert.x[3]. Vert.x is
 an asynchronous polyglot application platform based on Netty.

 - Toby

 [0]: https://github.com/vert-x/mod-lang-clojure/
 [1]:
 https://github.com/vert-x/mod-lang-clojure/blob/master/ChangeLog.md[1]
 [2]: https://github.com/vert-x/mod-lang-clojure#mod-lang-clojure[2]
 [3]: http://vertx.io/

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


-- 
-- 
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: How to handle configuration in Clojure?

2014-01-13 Thread Josh Smith
On Monday, January 13, 2014 8:50:54 AM UTC-5, James Trunk wrote:

 I've been investigating how to handle configuration in a Clojure 
 application/library, and have discovered two main candidates: dynamics vars 
 and argument passing.


I would suggest you add Environment variables to your list.Also,  check 
out the 12 factor app (especially the parts about configuration).   
http://12factor.net/config

I use env vars for most things in my clojure deploys, and it's easy to 
manage/move/everything.  YMMV.

-jbs

-- 
-- 
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: How to handle configuration in Clojure?

2014-01-13 Thread Josh Glover
On 13 January 2014 14:50, James Trunk james.tr...@gmail.com wrote:

 What is the current best practice for handling configuration?

While I haven't tried this myself, this popped up on Planet Clojure a
couple of days back:

http://tech.puredanger.com/2014/01/03/clojure-dependency-injection/

Whilst DI is not precisely config management, the pattern described in
the blog seems applicable.

Cheers,
Josh

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


Enforcing constructor types on defrecord

2013-11-30 Thread Josh Kamau
Hi there ;

Is there a way of enforcing constructor types when using defrecord?

Josh

-- 
-- 
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: Enforcing constructor types on defrecord

2013-11-30 Thread Josh Kamau
Thanks Ben. I will try that.

Josh


On Sat, Nov 30, 2013 at 6:12 PM, Ben Mabey b...@benmabey.com wrote:

 On Sat Nov 30 08:03:18 2013, Ben Mabey wrote:

 On Sat Nov 30 07:41:52 2013, Josh Kamau wrote:

 Hi there ;

 Is there a way of enforcing constructor types when using defrecord?

 Josh

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


 Take a look at Prismatic's Schema.  It has it's own defrecord that can
 be used for this purpose at runtime:

 https://github.com/Prismatic/schema#beyond-type-hints

 Of course if you want compile-time checks you can use core.typed. :)


 Err.. static checks... not really compile-time checks.


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


-- 
-- 
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: [ANN] projars.com

2013-11-28 Thread Josh Kamau
as long as it does not swallow
some of the free software code out there.

I have the same fears.

Josh


On Thu, Nov 28, 2013 at 1:53 PM, Bastien bastiengue...@gmail.com wrote:

 Hi Stanislav,

 Stanislav Yurin jusk...@gmail.com writes:

  In short, on top of every open greatness, it is good to have
  options.

 Indeed.

  The last thing I am willing to do is to build something no one needs,
  so I have decided to evaluate an idea.
  The idea is simple: introducing the commercial option to the great
  ecosystem we already have.
  Proposed http://projars.com concept is similar to well-organised
  clojars/leiningen/maven content delivery system but with
  commercial products in mind.

 I've nothing against such a move, as long as it does not swallow
 some of the free software code out there.  But I guess it won't.

 I'm working on a website where people will be able to ask donations
 more easily for their FLOSS achievements and future projects, I'd love
 to see both directions (more commercial options and more crowdfunded
 FLOSS libraries) encouraged at the same time.

 2 cents,

 --
  Bastien

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


-- 
-- 
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: running command when lein repl starts

2013-11-19 Thread Josh Kamau
Is it intentional that you are using clojure 1.3.0 instead of a newer
version like 1.5.1 ?

Do  lein deps   to download the dependencies.

Then do lein repl

Josh


On Tue, Nov 19, 2013 at 8:08 PM, Andy Smith the4thamig...@googlemail.comwrote:

 Hi,

 How can I get a command such as '(use 'clojure.math.numeric-tower)' to run
 when I start the repl with 'lein repl' ? I currently have my leiningen
 project setup as the following :

 (defproject test 1.0.0-SNAPSHOT
   :description FIXME: write description
   :dependencies [[org.clojure/clojure 1.3.0]
  [org.clojure/math.numeric-tower 0.0.2]])
   :repl-options {
  :dependencies [
  [org.clojure/math.numeric-tower 0.0.2]]
  :init (clojure.core/use 'clojure.math.numeric-tower)}



 and the error I get is as follows :


 andy@Aspire-V3-571:~/projects/clojure/test$ lein repl
 Exception in thread main java.lang.ClassNotFoundException: org.clojure
 (project.clj:1)
 at clojure.lang.Compiler.analyze(Compiler.java:5206)
 at clojure.lang.Compiler.analyze(Compiler.java:5152)
 at clojure.lang.Compiler$VectorExpr.parse(Compiler.java:2592)
 at clojure.lang.Compiler.analyze(Compiler.java:5193)
 at clojure.lang.Compiler.analyze(Compiler.java:5152)
 at clojure.lang.Compiler$VectorExpr.parse(Compiler.java:2592)
 at clojure.lang.Compiler.analyze(Compiler.java:5193)
 at clojure.lang.Compiler.analyze(Compiler.java:5152)
 at clojure.lang.Compiler$MapExpr.parse(Compiler.java:2499)
 at clojure.lang.Compiler.analyze(Compiler.java:5195)
 at clojure.lang.Compiler.analyze(Compiler.java:5152)
 at clojure.lang.Compiler$BodyExpr$Parser.parse(Compiler.java:4671)
 at clojure.lang.Compiler$FnMethod.parse(Compiler.java:4329)
 at clojure.lang.Compiler$FnExpr.parse(Compiler.java:3174)
 at clojure.lang.Compiler.analyzeSeq(Compiler.java:5368)
 at clojure.lang.Compiler.analyze(Compiler.java:5191)
 at clojure.lang.Compiler.eval(Compiler.java:5422)
 at clojure.lang.Compiler.load(Compiler.java:5858)
 at clojure.lang.Compiler.loadFile(Compiler.java:5821)
 at clojure.lang.RT$3.invoke(RT.java:296)
 at leiningen.core$read_project$fn__2167.invoke(core.clj:127)
 at leiningen.core$read_project.invoke(core.clj:126)
 at leiningen.core$read_project.invoke(core.clj:130)
 at leiningen.core$_main.doInvoke(core.clj:320)
 at clojure.lang.RestFn.invoke(RestFn.java:410)
 at clojure.lang.AFn.applyToHelper(AFn.java:161)
 at clojure.lang.RestFn.applyTo(RestFn.java:132)
 at clojure.core$apply.invoke(core.clj:542)
 at leiningen.core$_main.invoke(core.clj:332)
 at user$eval73.invoke(NO_SOURCE_FILE:1)
 at clojure.lang.Compiler.eval(Compiler.java:5425)
 at clojure.lang.Compiler.eval(Compiler.java:5392)
 at clojure.core$eval.invoke(core.clj:2382)
 at clojure.main$eval_opt.invoke(main.clj:235)
 at clojure.main$initialize.invoke(main.clj:254)
 at clojure.main$script_opt.invoke(main.clj:270)
 at clojure.main$main.doInvoke(main.clj:354)
 at clojure.lang.RestFn.invoke(RestFn.java:457)
 at clojure.lang.Var.invoke(Var.java:377)
 at clojure.lang.AFn.applyToHelper(AFn.java:172)
 at clojure.lang.Var.applyTo(Var.java:482)
 at clojure.main.main(main.java:37)
 Caused by: java.lang.ClassNotFoundException: org.clojure
 at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
 at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
 at java.security.AccessController.doPrivileged(Native Method)
 at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
 at
 clojure.lang.DynamicClassLoader.findClass(DynamicClassLoader.java:61)
 at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
 at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
 at java.lang.Class.forName0(Native Method)
 at java.lang.Class.forName(Class.java:270)
 at clojure.lang.RT.classForName(RT.java:1566)
 at clojure.lang.Compiler$HostExpr.maybeClass(Compiler.java:852)
 at clojure.lang.Compiler$HostExpr.access$300(Compiler.java:654)
 at clojure.lang.Compiler.analyzeSymbol(Compiler.java:5572)
 at clojure.lang.Compiler.analyze(Compiler.java:5173)
 ... 41 more



 What am I doing wrong? Thanks in advance.

 Andy

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

Re: [ANN] Yesql 0.2.1 - Clojure SQL queries rethought.

2013-11-18 Thread Josh Kamau
Can i put more than one sql statement in a file?

Josh


On Mon, Nov 18, 2013 at 2:01 PM, Kris Jenkins krisajenk...@gmail.comwrote:



 On Monday, 18 November 2013 03:21:12 UTC, Jeremy Heiler wrote:

 On Mon, Nov 11, 2013 at 6:10 AM, Kris Jenkins krisaj...@gmail.comwrote:

 https://github.com/krisajenkins/yesql

 Yesql is a simple library for blending SQL  Clojure together, cleanly.
 Here's how it works https://github.com/krisajenkins/yesql#rationale,
 and how to use it https://github.com/krisajenkins/yesql#example-usage.


 Very cool. Do you have any thoughts on a caching strategy?


 Yes, for the next version. At the moment it's only changing when the
 defquery is re-eval'd. That's right for production, but a bit of a pain for
 development. In development you want any change to the underlying sql file
 to be picked up immediately. So I plan to do that, picking up the dev/prod
 switch via leiningen, I think.

 (That's caching the definition, of course. I've no plan to cache the
 results of the queries. That's a job for memoize/core.cache.)

 Cheers,
 Kris

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


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


Can't get terminal parameters: Inappropriate ioctl for device error on clojure.java.shell

2013-11-16 Thread Josh Kamau
When i run this:
(clojure.java.shell/sh chat -Vs ' ' 'ATi' 'OK' ' ' 
/dev/ttyUSB0  /dev/ttyUSB0)


I get this:
{:exit 2, :out , :err Can't get terminal parameters: Inappropriate ioctl
for device\n}


When i run the command directly on the shell, it works. What is causing the
error? any options i could set?

Josh.

-- 
-- 
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: a possibly vague question

2013-11-14 Thread Josh Kamau
Try to create a simple app that just demonstrate the issue.  Then send the
sample to the mailing list. Most likely you won't have to send because you
will discover the problem in the process.

Josh
On 14 Nov 2013 23:08, Jim - FooBar(); jimpil1...@gmail.com wrote:

 Hi people,

 I 'll have to apologise in advance for the potential vagueness of my
 question but I am utterly baffled by the behaviour I am seeing and I'd like
 to share  ask.

 I have a (seesaw) GUI with a swingx.busy-label which I want activated when
 certain tasks are performed. The code that i've written so fat works
 perfectly at the repl but for some bizarre reason it won't work when
 attached as a handler to a button. I mean literally the same code works
 perfectly at the REPL while the GUI is up but from the GUI itself the
 effect does not happen, even though the actual work is being done (i.e.
 loading a big pdf file)!

 my question is what could possibly cause such a different behaviour? What
 is so different between the REPL and attaching a handler to a button? If
 anything, the REPL involves a compilation step whereas the handler has been
 sitting there all along... any ideas? I don't even know where to start
 looking since the code runs fine at the repl... This has never happened to
 me before!

 many thanks in advance,

 Jim

 ps: even though I have posted at the seesaw list, I am starting to doubt
 this is a seesaw-related issue simply because it works at the 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/groups/opt_out.


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


Autocomplete for new dependency - counterclockwise

2013-11-12 Thread Josh Kamau
Hi there ;

I have a counterclockwise project on eclipse.  I have just added a new
library dependency to project.clj.  What do i need to do so that the the
namespaces provided by the new library are available during autocomplet..
especially on the repl.

Regards.
Josh

-- 
-- 
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: Autocomplete for new dependency - counterclockwise

2013-11-12 Thread Josh Kamau
Thanks. I had tried that. I guess i was doing something wrong.
Let me try again.

Josh


On Tue, Nov 12, 2013 at 4:53 PM, Niels van Klaveren 
niels.vanklave...@gmail.com wrote:

 You only need to restart the REPL since the new library needs to be on the
 classpath.


 On Tuesday, November 12, 2013 2:48:21 PM UTC+1, Josh Kamau wrote:

 Hi there ;

 I have a counterclockwise project on eclipse.  I have just added a new
 library dependency to project.clj.  What do i need to do so that the the
 namespaces provided by the new library are available during autocomplet..
 especially on the repl.

 Regards.
 Josh

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


-- 
-- 
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: Testing with Angular.js, Clojurescript and Purnam - Code and Part 1

2013-11-05 Thread Josh Kamau
zcaudate,
You realize you have posted on a clojure mailing list??


On Tue, Nov 5, 2013 at 1:31 PM, zcaudate z...@caudate.me wrote:

 Code:  https://github.com/zcaudate/purnam-angular-example
 Demo: http://docs.caudate.me/purnam-angular-example/
 Article: http://z.caudate.me/purnam-angular-js-testing-part-1-services/

 

 Even with the karma http://karma-runner.github.io/ test runner, testing
 in angularjs is painful. It's one thing to be able to write a 
 *angular.js*controller,
 its another to be able to test them. Making it more difficult is the sheer
 complexity of the framework. There are different strategies of testing
 controllers, directives, filters and injectables (values, services,
 factories and providers)

 There are two excellent articles about testing in angular.js by Year of
 Moo. 
 Herehttp://www.yearofmoo.com/2013/09/advanced-testing-and-debugging-in-angularjs.html
  and 
 Herehttp://www.yearofmoo.com/2013/01/full-spectrum-testing-with-angularjs-and-karma.html.
 However, my eyes start hurting when I look at the test code. It is modular,
 it is brilliantly thought out, it is *very* complete... but it is
 seriously hard to get my head around. An example of controller testing can
 be found 
 herehttps://github.com/yearofmoo-articles/AngularJS-Testing-Article/blob/master/test/unit/controllers/controllersSpec.js

 It took me about a couple of days to summon up the courage to even attempt
 to read the code. Then I realised that the tests weren't doing that much at
 all. Most of it was boilerplate and not that interesting. Out of about 5
 lines of test code, something interesting only happened in one of them. I
 abstracted out all the angular.js testing code into 
 macroshttps://github.com/zcaudate/purnam/wiki/Api---purnam-test-angular
 .

 The point I've been making on previous 
 posthttp://z.caudate.me/if-you-cant-beat-them/ is
 that clojurescript rocks if we really embrace javascript libraries through
 macros. With macros for *angular.js*, working with angular.js is so much
 clearer than in javascript.

 I have put together an example 
 projecthttps://github.com/zcaudate/purnam-angular-example that
 shows how one may go about doing a simple app with tests. I'm going to take
 a couple of posts to explain how purnam.angular, purnam.test and
 purnam.test.angular work together.


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


-- 
-- 
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: Any interest in Compojure/Ring screencasts?

2013-11-01 Thread Josh Kamau
I am interested.

Thanks.
Josh


On Fri, Nov 1, 2013 at 3:57 AM, Tilak Thapa tlk.thp@gmail.com wrote:

 +1, @James, i'm in.


 On Wednesday, October 30, 2013 4:32:18 AM UTC+5:45, Russell Whitaker wrote:

 I, for one, would happily pay (my employer's) money for such a thing.

 R

 On Tue, Oct 29, 2013 at 3:39 PM, James Reeves ja...@booleanknot.com
 wrote:
  I'm considering putting together a screencast, or a series of
 screencasts,
  based on my Functional Web Architecture talk. The base presentation
 would be
  improved, and I'd probably wind up going into more detail on certain
 topics.
  I'll probably charge a small fee (perhaps $10 or so) to cover costs.
 
  Would there be any interest in this?
 
  - James

 --
 Russell Whitaker
 http://twitter.com/**OrthoNormalRuss http://twitter.com/OrthoNormalRuss

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


-- 
-- 
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: Clojure + BDD + TDD + Pairing...

2013-10-30 Thread Josh Kamau
I can do it with you if we limit the hours to Saturday and sunday.

I am a noob though i have 2 apps in production. (You can get alot done
without knowing the whole of clojure)

I am in GMT  +3

Thanks.


On Wed, Oct 30, 2013 at 6:43 AM, Marcus Blankenship
mar...@creoagency.comwrote:

 Hi Folks,

 I’m a Clojure n00b, but am interested in finding another n00b who aspires
 to learn Clojure, and do so using BDD / TDD practices through regular
 pairing sessions.  I’ve found novice - novice pairing to be a great way
 to ramp up on skills, but I don’t live near anyone who I can pair with.

 I’m thinking that doing 3 1-hour sessions a week, for a month, would give
 us a nice start.  Obviously, this would be remote pairing via ScreenHero
 (or some other tool).

 Anyone interested?

 Best,
 Marcus


 marcus blankenship
 \\\ Partner, Problem Solver, Linear Thinker
 \\\ 541.805.2736 \ @justzeros \ skype:marcuscreo

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


-- 
-- 
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: Counterclockwise Eclipse Plugin Documentation

2013-10-24 Thread Josh Kamau
Thank you Laurent.


On Thu, Oct 24, 2013 at 8:12 PM, Laurent PETIT laurent.pe...@gmail.comwrote:

 Hello,

 For Counterclockwise, the Eclipse Plugin for Clojure, I've worked on
 the documentation recently.

 tl;dr:
 - The documentation is now at http://doc.ccw-ide.org . I hope you'll
 find it prettier, easier to link at.
 - Technically, it is now in the code's repo, in Asciidoc markup
 format. I hope it will make it easier for people to contribute to it.

 Full story:

 - I switched the main documentation from Google Code's Wiki to the
 doc/ folder in Counterclockwise Github's repository :
 https://github.com/laurentpetit/ccw/tree/master/doc/src

 - The documentation format uses Asciidoc ( http://asciidoctor.org/ )
 and is integrated in the maven build.

 - Now the documentation is per branch, and is rebuilt thanks to
 Travis-CI ( https://travis-ci.org/laurentpetit/ccw/builds ) for each
 branch and each push on Github.

 - Each travis-build/branch Travis build is stored along the product
 artifacts, e.g.

 http://updatesite.ccw-ide.org/branch/master/master-travis000169-git496b970a9f74d7b25efe4ada6d7903cb0a434ea6/doc/
 for Travis's build 169 of commit 496b9 on branch master.

 - As a convenience, there's a permanent location for each branch's
 tip documentation, e.g.
 http://updatesite.ccw-ide.org/branch/master/doc/ for branch master

 - Last but not least, the documentation for the current version is
 available easy at http://doc.ccw-ide.org/

 Cheers,

 --
 Laurent Petit

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


-- 
-- 
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: [ANN] JUST CREATED GOOGLE + CLOJURE COMMUNITY FOR TUNISIA

2013-10-20 Thread Josh Kamau
Conglats.   I am working on the same for Kenya.


On Sat, Oct 19, 2013 at 6:14 PM, Plínio Balduino pbaldu...@gmail.comwrote:

 Congratulations

 IMHO, local communities are the best way to make the language more popular
 and even to create a job market for Clojure.

 Wish you all the success

 Plínio
 On Oct 19, 2013 12:11 PM, Rafik NACCACHE rafik.nacca...@gmail.com
 wrote:

 Dear All,

 It is my pleasure to announce that we just created a Tunisial Local HUB
 for Clojure advocacy, teaching and technical exchange :

 https://plus.google.com/u/1/**communities/**106805143209555111634https://plus.google.com/u/1/communities/106805143209555111634

 Awareness about clojure in Tunisia is quite low, though this is a country
 that accounts for a significant number of talented software engineers.
 S, I think it would be a nice idea to advocate for the language here, I
 mean talent is present and just waits to be converted :)

 I would be grateful if you can join this little effort of mine to assist
 us and make our community look good, and who knows, we could be a good
 starting point for a wider and more global clojure user base :)

 Thank you all,

 Regards

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

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


-- 
-- 
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: Newbie question: How to add external clojure jars properly in Eclipse.

2013-10-18 Thread Josh Kamau
I find it easier to let leiningen handle the dependencies.  Eclipse via
counterclockwise plugin adds dependencies declared in project.clj to the
classpath.

Josh


On Fri, Oct 18, 2013 at 4:42 PM, Christopher Bird seabir...@gmail.comwrote:

 I know this is a pretty old thread, but my questions are quite
 similar/related, so I figured here would be a good place for them.

 I am seriously struggling with both the Eclipse/Kepler-CounterClockwise
 version in general and the command prompt versions of lein.
 My major issue is how to tell the environments which libraries, etc. to
 load. For example, one of the libraries I really want to use is the whole
 zipper approach for dealing with xml.

 From this location http://grokbase.com/t/gg/clojure/11ccz70h0y/xml-zip I
 see the following code:

 (ns play.xml-example
 (:require [clojure.zip :as zip]
 [clojure.data.zip :as zf]
 [clojure.xml :as xml])
 (:use clojure.data.zip.xml))
 And this is what I get:

 C:\Users\Christopher Birdlein repl
 nREPL server started on port 64784 on host 127.0.0.1
 REPL-y 0.2.1
 Clojure 1.5.1
 Docs: (doc function-name-here)
   (find-doc part-of-name-here)
   Source: (source function-name-here)
  Javadoc: (javadoc java-object-or-class-here)
 Exit: Control+D or (exit) or (quit)

 user= (ns play.xml-example
   #_= (:require [clojure.zip :as zip]
   #_= [clojure.data.zip :as zf]
   #_= [clojure.xml :as xml]
   #_= )
   #_= (:use clojure.data.zip.xml))

 FileNotFoundException Could not locate clojure/data/zip__init.class or
 clojure/data/zip.clj on classpath:   clojure.lang
 .RT.load (RT.java:443)
 user=
  So, clearly I need to get  the libs onto the classpath. The questions are
 what libs, where and how?

 Thanks in advance for any/all help

 Chris
 On Wednesday, September 7, 2011 2:09:01 PM UTC-5, Joseph Li wrote:

 hi all,

 I have a bare bone Clojure project created in Eclipse with
 Counterclockwise plugin and am trying to (use clojure.java.jdbc).
  I tried adding the jar file downloaded from Maven repo to the
 project's build path but everytime it runs the (use) line from the
 repl it will  give a ClassNotFoundException.

 I ended up downloading the source and put it right there along with my
 own but still have to fully qualify with the ns name to use anything
 there.

 Is Maven/Leiningen pretty much the only way to obtain clojure lib
 properly?

 Thanks,
 Joseph

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


-- 
-- 
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: Newbie question: How to add external clojure jars properly in Eclipse.

2013-10-18 Thread Josh Kamau
Install counterclockwise plugin on your eclipse. Then import your project
into eclipse. There right click the project and there is something like
Convert to leiningen project .

Hope that helps.
Josh.


On Fri, Oct 18, 2013 at 5:41 PM, Christopher Bird seabir...@gmail.comwrote:

 Josh, thanks for replying. The code sample was from my batch lein and not
 the counterclockwise version. So I am clearly still totally messed up[!

 C


 On Friday, October 18, 2013 9:11:54 AM UTC-5, Josh Kamau wrote:

 I find it easier to let leiningen handle the dependencies.  Eclipse via
 counterclockwise plugin adds dependencies declared in project.clj to the
 classpath.

 Josh


 On Fri, Oct 18, 2013 at 4:42 PM, Christopher Bird seab...@gmail.comwrote:

 I know this is a pretty old thread, but my questions are quite
 similar/related, so I figured here would be a good place for them.

 I am seriously struggling with both the Eclipse/Kepler-**CounterClockwise
 version in general and the command prompt versions of lein.
 My major issue is how to tell the environments which libraries, etc. to
 load. For example, one of the libraries I really want to use is the whole
 zipper approach for dealing with xml.

 From this location 
 http://grokbase.com/t/gg/**clojure/11ccz70h0y/xml-ziphttp://grokbase.com/t/gg/clojure/11ccz70h0y/xml-zipI
  see the following code:

 (ns play.xml-example
 (:require [clojure.zip :as zip]
 [clojure.data.zip :as zf]
 [clojure.xml :as xml])
 (:use clojure.data.zip.xml))
 And this is what I get:

 C:\Users\Christopher Birdlein repl
 nREPL server started on port 64784 on host 127.0.0.1
 REPL-y 0.2.1
 Clojure 1.5.1
 Docs: (doc function-name-here)
   (find-doc part-of-name-here)
   Source: (source function-name-here)
  Javadoc: (javadoc java-object-or-class-here)
 Exit: Control+D or (exit) or (quit)

 user= (ns play.xml-example
   #_= (:require [clojure.zip :as zip]
   #_= [clojure.data.zip :as zf]
   #_= [clojure.xml :as xml]
   #_= )
   #_= (:use clojure.data.zip.xml))

 FileNotFoundException Could not locate clojure/data/zip__init.class or
 clojure/data/zip.clj on classpath:   clojure.lang
 .RT.load (RT.java:443)
 user=
  So, clearly I need to get  the libs onto the classpath. The questions
 are what libs, where and how?

 Thanks in advance for any/all help

 Chris
 On Wednesday, September 7, 2011 2:09:01 PM UTC-5, Joseph Li wrote:

 hi all,

 I have a bare bone Clojure project created in Eclipse with
 Counterclockwise plugin and am trying to (use clojure.java.jdbc).
  I tried adding the jar file downloaded from Maven repo to the
 project's build path but everytime it runs the (use) line from the
 repl it will  give a ClassNotFoundException.

 I ended up downloading the source and put it right there along with my
 own but still have to fully qualify with the ns name to use anything
 there.

 Is Maven/Leiningen pretty much the only way to obtain clojure lib
 properly?

 Thanks,
 Joseph

  --
 --
 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=enhttp://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/**groups/opt_outhttps://groups.google.com/groups/opt_out
 .


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


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

Re: Are there any GUI based Clojure apps out there?

2013-10-17 Thread Josh Kamau
you mean something like this https://github.com/arthuredelstein/clooj


On Thu, Oct 17, 2013 at 4:31 PM, Jonathon McKitrick jmckitr...@gmail.comwrote:

 I'd be interested in seeing some client-side apps with a GUI, if there are
 any.  'Ants' is a good demo, but I'm looking for something a little more.
  ;-)

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


-- 
-- 
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: ANN: ClojureScript 0.0-1933

2013-10-11 Thread Josh Kamau
Just curious, why the version number very different from most of other
projects that i have seen?

Otherwise conglats.
Josh


On Fri, Oct 11, 2013 at 3:28 PM, David Nolen dnolen.li...@gmail.com wrote:

 ClojureScript, the Clojure compiler that emits JavaScript source code.

 README and source code: https://github.com/clojure/clojurescript

 New release version: 0.0-1933

 Leiningen dependency information:

 [org.clojure/clojurescript 0.0-1933]

 Changes:
 * / in symbol now always delimits a namespace
 * tools.reader 0.7.9, addresses Windows line ending convention

 Enhancements:
 * referred vars and macros now verified
 * replace asserts with errors, now file and line location for all analyzer
 and compiler errors

 Bug fixes:
 * CLJS 600  604: LazySeq regressions
 * CLJS 605: Allow alias target to change when recompiling file
 * CLJS 456: test case for CLJS 544
 * CLJS 603: namespace and variadic function shadowing
 * CLJS 566: 1 arity method for partial
 * CLJS 601: multiple cases of fn arity now emits warning
 * CLJS 613: unify try special form with Clojure
 * CLJS 602: better error message for too many arguments to fn

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


-- 
-- 
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: [ANN] mod-lang-clojure for Vert.x 0.2.0 released

2013-10-08 Thread Josh Kamau
Hi Guys;

For me, the eventbus is the killer feature in Vertx. I think there will be
many developers who would like to embed vertx into  into their existing
applications to enable 'realtime' communication with the browser via the
eventbus.  I would love to be able to do this as easily as possible.
Otherwise i appreciate the work done so far.

Josh


On Tue, Oct 8, 2013 at 6:37 PM, Hans-J. Schmid 
hans-j.sch...@hans-jschmid.com wrote:

 Hi Toby,

 thanks for the info.

 I was actually in contact with Stream Liu and he made an update to the
 project on https://github.com/stream1984/ring-vertx-adapter.

 It stills needs some polishing according to Stream (refering to the
 project page: It is very common that run project of clojure with repl in
 lein, But i have not yet enough time to make a plugin to wrap vert.x's
 clojure as a module in lein.) But so far the adapter is very usable for me
 now.

 Thanks for your support.
 Hans-J.


 On Tuesday, October 8, 2013 4:34:04 PM UTC+2, Toby Crawley wrote:

 Hans-J.:

 I haven't yet had a chance to try out Stream's ring adapter, but I hope
 to do so soon.

 I think it should probably be published as a jar for embedded use, and
 as a Vert.x module that depends on that jar for use in a Vert.x
 container. Can you file against the ring adapter[1] asking for a
 release?

 Isaiah Peng and I are currently working on a lein plugin[2] that should
 make working with lein-based Vert.x projects easier. It will include
 support for specifying Vert.x module dependencies in project.clj, but
 isn't quite there yet. If running Vert.x apps with lein is something
 that interests you, we'd love some help :)

 [1]: 
 https://github.com/stream1984/**ring-vertx-adapter/issueshttps://github.com/stream1984/ring-vertx-adapter/issues
 [2]: 
 https://github.com/isaiah/**lein-vertxhttps://github.com/isaiah/lein-vertx

 Hans-J. Schmid writes:

  Hi Toby,
 
  would it be possible to have the ring-vertx-adapter as a jar that we
 can
  include as a dependency in our Clojure projects? Couldn't find anything
 on
  Clojars or Maven and the sample code uses embedded vertx.
 
  Kind regards,
  Hans-J.
 
  On Wednesday, September 18, 2013 1:49:38 PM UTC+2, Toby Crawley wrote:
 
 
  Josh Kamau writes:
 
   Does this have the ring adapter bundled in ?
  
 
  No, the ring adapter is a separate project
  (https://github.com/**stream1984/ring-vertx-adapterhttps://github.com/stream1984/ring-vertx-adapter
 )**, and will likely
  remain so.
 
  --
  Toby Crawley
  http://immutant.org | http://torquebox.org
 
 
  --


 --
 Toby Crawley
 http://immutant.org | http://torquebox.org

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


-- 
-- 
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: [ANN] mod-lang-clojure for Vert.x 0.2.0 released

2013-09-18 Thread Josh Kamau
Does this have the ring adapter bundled in ?

Thanks


On Wed, Sep 18, 2013 at 5:16 AM, Toby Crawley t...@tcrawley.org wrote:

 mod-lang-clojure[0] 0.2.0 was released earlier today, and is now
 available in Maven Central.

 The biggest change in 0.2.0 is the addition of a ClojureScript wrapper
 around the client-side vertxbus.js.[1]

 For a full list of changes, see the ChangeLog[2].

 # What is mod-lang-clojure?

 mod-lang-clojure is a fledging Clojure language module for
 Vert.x[3]. Vert.x is an asynchronous polyglot application platform based
 on Netty.

 [0]: https://github.com/vert-x/mod-lang-clojure/
 [1]:
 https://github.com/vert-x/mod-lang-clojure/blob/0.2.0/api/src/main/clojure/vertx/client/eventbus.cljs
 [2]: https://github.com/vert-x/mod-lang-clojure/blob/master/ChangeLog.md
 [3]: http://vertx.io/
 --
 Toby Crawley
 http://immutant.org | http://torquebox.org

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


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


Clojure BBM Channel

2013-09-17 Thread Josh Comer


For those using the beta version of BBM Channels, I have created a new 
channel all about clojure. Below is the barcode with which to join.

Cheers,

Josh

https://lh6.googleusercontent.com/-H6C_EUGNYeY/UjjUeCqdhKI/BmU/XTIuDfhWqqU/s1600/IMG_0171_edit.png

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


clojure.java.jdbc connection pool example

2013-09-13 Thread Josh Kamau
Hello there ;

I am in desparate need of a clojure.jdbc with a connection pool example.

I have googled and the link to github example is broken.

Please help.

Thanks.
Josh

-- 
-- 
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: clojure.java.jdbc connection pool example

2013-09-13 Thread Josh Kamau
Thanks alot.

Let me check them out.

Josh


On Fri, Sep 13, 2013 at 1:41 PM, Shantanu Kumar kumar.shant...@gmail.comwrote:

 Hi Josh,


 On Friday, 13 September 2013 15:52:47 UTC+5:30, Josh Kamau wrote:

 Hello there ;

 I am in desparate need of a clojure.jdbc with a connection pool example.


 You can see an example here that uses Apache DBCP (please excuse the plug):
 https://github.com/kumarshantanu/clj-dbcp

 There are C3P0 and BoneCP connection pool libraries too:
 https://github.com/opiskelijarekisteri-devel/clj-bonecp

 http://stackoverflow.com/questions/11571433/what-is-the-proper-way-to-store-a-global-connection-in-clojure

 Shantanu

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


-- 
-- 
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: clojure.java.jdbc connection pool example

2013-09-13 Thread Josh Kamau
Thanks.

I have used C3P0 for now... I will look at tomcat7 pool though

Josh


On Fri, Sep 13, 2013 at 3:19 PM, gixxi 
christian.meichs...@informatik.tu-chemnitz.de wrote:

 Hi Josh,

 I would opt for using Tomcat 7 Pool API -
 http://tomcat.apache.org/tomcat-7.0-doc/jdbc-pool.html

 The following code wraps the pool api and provides reading a config file

 (ns foo
   (:require [clojure.java.io :as io])
   (:import [java.io PushbackReader])
   (:gen-class))

 (defn conf [file]
   Reads a config file containing the connection params (url, driver)
   (binding [*read-eval* false]
 (with-open [r (io/reader file)]
   (read (PushbackReader. r)

 (defn datasource [file]
   creates a pooled data source
   (let
 [config (conf file) ds (new org.apache.tomcat.jdbc.pool.DataSource) pp
 (new org.apache.tomcat.jdbc.pool.PoolProperties)]
 (do
   (.setDriverClassName pp (:classname config))
   (.setUrl pp (:subname config))
   (.setUsername pp (:user config))
   (.setPassword pp (:password config))
   (.setTestOnBorrow pp true)
   (.setValidationQuery pp SELECT 1)
   (.setMaxActive pp 5)
   (.setInitialSize pp 1)
   (.setMaxWait pp 1)
   (.setPoolProperties ds pp)
   (identity ds

 create a file dbconnection.ini with you jdbc connection params as per the
 following example (uses derby in-memory db)

 {
 :classname org.apache.derby.jdbc.EmbeddedDriver
 :subprotocol memory
 :subname jdbc:derby:memory:myDB;create=true
 :user 
 :password 
 }

 now you can load the config and create a pooled connection as wished

 (def ds (datasource (clojure.java.io/as-file db.properties)))

 you can obtain a connection using

 {:datasource ds}


 Cheers
 Christian

 Am Freitag, 13. September 2013 12:22:47 UTC+2 schrieb Josh Kamau:

 Hello there ;

 I am in desparate need of a clojure.jdbc with a connection pool example.

 I have googled and the link to github example is broken.

 Please help.

 Thanks.
 Josh

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


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


  1   2   >