Re: [ClojureScript] Re: Preparing proposal for presentation on replikativ

2016-08-03 Thread Daniel Kersten
I would be very interested in learning about how to use replikativ: what
can and can't it store, when is and isn't it a good fit, demo/sample code
of common and not so common use cases etc
I've looked at replikativ and even went down the "learn lots about CRDTs"
rabbit hole and think I have an OK understanding of the theory, but I'm
still not sure when and how to actually use replikativ.
Although it's probably best to assume not everyone in the audience is
familiar with CRDTs, so should probably include a brief primer.

On Wed 3 Aug 2016 at 05:46, Ashish Negi  wrote:

> Hi Christian
>
> Thanks for replikativ and asking suggestions.
> I would like to also know about general problems (both of domain and
> language) you faced while developing library,
> and how / how not clojure helped you ?
>
> --
> Note that posts from new members are moderated - please be patient with
> your first post.
> ---
> You received this message because you are subscribed to the Google Groups
> "ClojureScript" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to clojurescript+unsubscr...@googlegroups.com.
> To post to this group, send email to clojurescr...@googlegroups.com.
> Visit this group at https://groups.google.com/group/clojurescript.
>

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


Re: [ANN] walmartlabs/datascope 0.1.0

2016-07-01 Thread Daniel Kersten
This is brilliant! I was looking for something like this to create images
to use in talk slides. Thank you!
On Thu 30 Jun 2016 at 20:11,  wrote:

> Tried this out to visualize a DFA used for dictionary matching. Very cool.
>
>
> On Monday, June 27, 2016 at 1:57:56 PM UTC-4, Howard M. Lewis Ship wrote:
>>
>>
>> A library that can be used to render typical Clojure data structures
>> using Graphviz.
>>
>> https://github.com/walmartlabs/datascope
>>
>> --
>> Howard M. Lewis Ship
>>
>> Senior Mobile Developer at Walmart Labs
>>
>> Creator of Apache Tapestry
>>
>> (971) 678-5210
>> http://howardlewisship.com
>> @hlship
>>
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with
> your first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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: understanding a clojuredocs merge example

2016-05-12 Thread Daniel Kersten
Yes, only the first map passed into baz (only one passed in anyway in the
example) is kept, anything else is thrown away. Seems like a strange
example when something like this would have sufficed to get the point of
merge across:

(defn baz [options]
   (let [options (merge {:opt1 "default-1" :opt2 "default-2"}
options)]
  options))
(baz {:opt1 "custom-1" :opt3 "custom-3"});;=> {:opt3 "custom-3" :opt1
"custom-1 :opt2 "default-2"}


On Thu, 12 May 2016 at 07:45 hiskennyness  wrote:

> I do not understand something this example:
>
>
> https://clojuredocs.org/clojure.core/merge#example-54c7b859e4b0e2ac61831cdf
>
> Specifically:
>
> (defn baz [& options]
>>(let [options (merge {:opt1 "default-1" :opt2 "default-2"}
>> (first options))]
>>   options))
>> (baz {:opt1 "custom-1" :opt3 "custom-3"});;=> {:opt3 "custom-3" :opt1 
>> "custom-1 :opt2 "default-2"}
>>
>>
> IIANM, that throws away all but the first map in the rest parameter
> options.
>
> Is there more going on here than I realize?
>
> --
> 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] Doubling down on Onyx

2016-02-25 Thread Daniel Kersten
Congratulations! Fantastic news. I think thats my cue to finally go ahead
and learn to use Onyx :)

On Thu, 25 Feb 2016 at 00:07 Colin Fleming 
wrote:

> Hi Michael,
>
> Congratulations! That's fantastic - I'm really happy to see more people
> being able to work full time on tools :)
>
> Cheers,
> Colin
>
> On 25 February 2016 at 05:22, Michael Drogalis 
> wrote:
>
>> Hi everyone,
>>
>> I'm happy to announce that, starting next week, I'll be supporting the Onyx
>> Platform  full time.
>> I want to thank the incredible Clojure community that's helped to make
>> Onyx a
>> successful open source project. Read on in the blog post
>> 
>> for specifics, but I wanted to drop
>> a message here to say how excited I am to push Clojure forward as a
>> distributed systems/data analysis
>> front runner.
>>
>> -- Michael
>>
>> --
>> 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 as first language

2016-02-22 Thread Daniel Kersten
In my experience running the local clojure user group, a lot of clojure
beginners (NOT programming beginners) struggle with two things: the
paradigm switch (immutable data etc) and clojure's error messages.

I think if a beginner to programming started with clojure, they may be able
to sidestep the paradigm switch (because they haven't yet learned any
alternative approaches), but would struggle even more with the error
messages. Java stack traces are rather daunting at the best of times, but I
can imagine a beginner seeing something cryptic like wrong arity followed
by a 20 line stack trace would be rather demoralising.

Since this is a problem even seasoned programmers (but new to clojure)
have, I feel this needs to be improved before I'd be comfortable
recommending the language to absolute programming beginners.

Beyond that, as long as you introduce the concepts one at a time (should be
relatively easy, since clojure is all about untangling the various
concepts), then I think clojure would make a pretty interesting language to
teach programming with. When I tutored first year CS students in the past,
the biggest issue was introducing too much at once, but I feel that most of
clojure can be drip-fed as needed.
On Mon 22 Feb 2016 at 07:55 Michael Sperber  wrote:

>
> Terje Dahl  writes:
>
> > I believe that the simplicity of Clojure's syntax in combination with its
> > clean functional nature and prefix notation makes it ideal as a "first
> > language" for anyone who wants to start programming - including, and
> > perhaps especially kids.
>
> There's a lot of research out of the PLT and DeinProgramm projects on
> this. You'll find the relevant ones here:
>
> http://deinprogramm.de/publications.html
>
> These are not about Clojure per se, but discuss Scheme, which is close
> enough.
>
> tl;dr: No, Clojure is not an ideal language for teaching beginners.  For
> teaching beginners, you should use a language specifically engineered
> for beginners, such as the teaching languages that come with Racket.
> (The transition to Clojure from these languages should be quite easy,
> though.)
>
> --
> Regards,
> Mike
>
> --
> 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: No eval in ClojureScript!?

2016-02-13 Thread Daniel Kersten
Clojurescript does have eval, in the cljs.js namespace:
https://crossclj.info/ns/org.clojure/clojurescript/1.7.228/cljs.js.cljs.html#_eval
Take a look at http://yogthos.net/posts/2015-11-12-ClojureScript-Eval.html for
an example and https://swannodette.github.io/2015/07/29/clojurescript-17/ for
some more details on dynamic compilation of clojurescript code in
clojurescript.

On Sat, 13 Feb 2016 at 15:25 ru  wrote:

> Dear ClojureScript users and team!
>
> Without "eval" function ClojureScript can't be recognized as a
> full-fledged LISP. "Code as data" paradigm can't be implemented without
> "eval". What purpose of code constructed programmatically, if it can not be
> evaluated?! In that sence plain old JavaScript is more LISP than
> ClojureScript. Am I right? May be I have mised something important in that
> problem?
>
> Sincerely,
>   Ru
>
> --
> 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: [ClojureScript] Re: ANN replikativ 0.1.0 - strong eventual consistent P2P replication for clj and cljs

2016-01-20 Thread Daniel Kersten
I've actually been looking at Replikativ (and CRDT's in general) over the
past ~3 weeks, so I'm very happy to hear that Replikativ is moving
forwards. It looks incredibly interesting.

On Wed, 20 Jan 2016 at 16:30 Thomas  wrote:

> Looks very interesting and I suspect there were some pretty hard problems
> to solve!!!
>
> Thank you for open sourcing this.
>
> Thomas
>
> --
> Note that posts from new members are moderated - please be patient with
> your first post.
> ---
> You received this message because you are subscribed to the Google Groups
> "ClojureScript" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to clojurescript+unsubscr...@googlegroups.com.
> To post to this group, send email to clojurescr...@googlegroups.com.
> Visit this group at https://groups.google.com/group/clojurescript.
>

-- 
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: Naming convention for atoms, refs, etc.?

2015-12-10 Thread Daniel Kersten
I write such code like this:

(defn sdescriptive-name [] )
(def my-atom (atom (descriptive-name)))

Where descriptive-name would describe the data shape or purpose.
This way the atom is not obscured behind many lines of code and the
data-generation is factored into a testable function with a hopefully
self-documenting name.

On Thu, 10 Dec 2015 at 10:27 Colin Yates  wrote:

> I know it is dangerous to make sweeping statements, but any solution to “a
> lot of code obscures meaning therefore do X” is often solving the wrong
> thing - the real problem is "a lot of code that obscures meaning” :-).
>
> I hope that doesn’t come across as condescending as I fear...
>
>
> On 10 Dec 2015, at 06:02, Mars0i  wrote:
>
> Another use case, fwiw:
>
> (def my-atom
>   (let [...
>  
>  ...]
> (atom ...)))
>
> A special naming convention for (e.g.) atoms makes it clear that what's
> below the many lines of let bindings (and maybe comment lines, too) is
> going to produce an atom; you don't have to read down and find the one line
> that contains '(atom'.
>
> --
> 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: Naming convention for atoms, refs, etc.?

2015-12-07 Thread Daniel Kersten
Good point, Colin, about mixed refs and atoms. That might change things a
little (although in my years of Clojure, I have never needed to mix them to
the point of needing to clarify).
I would still prefer a textually descriptive name over a symbolic prefix or
suffix in this case though. At the very least, something like foo-atom or
foo-ref would be clear to people not used to the convention, while foo&
could mean anything. I think usually one can come up with better
descriptions than -atom too.

But... Maybe I'm just a little bit too symbol averse 樂
On Mon 7 Dec 2015 at 08:37 Colin Yates <colin.ya...@gmail.com> wrote:

> +1.
>
> I haven’t done an extensive study, but I am sure all of my atoms’s stand
> out from other fns/vars because the name makes it obvious. For example,
> ‘shopping-cart’ can _only_ sensibly be state which can only be an atom.
>
> Having said that, if I had mixed refs and atoms then I might consider
> splitting those, but in general I find it obvious and intuitive when
> looking through past code which are atoms and which are fns/vars.
>
> Might just be me though :-).
>
> On 7 Dec 2015, at 08:26, Daniel Kersten <dkers...@gmail.com> wrote:
>
> I personally don't like this.
>
> An atom won't suddenly change value without your knowledge because to get
> its value, you must use @ or deref (which should be a big warning that,
> yes, this value might change between calls to deref).
>
> Adding sigils, in my opinion, adds to the noise and makes it harder to
> read. I personally find sigils to be a noisy mistake in other languages
> (perl, php etc) and in my opinion you can get more benefit through a
> suitable naming convention such as a -state prefix, eg: foo-state
>
> I think, mainly my dislike for sigils is on variables and not so much on
> functions as I'm ok with foo? being a predicate and foo! being unsafe in
> STM. I think that's because they tell you useful meta information about
> what the function does, but to use a variable, I already have to know what
> data it's representing in order to call the correct functions on it and
> annotating it with sigils doesn't help much (unless perhaps you go full
> blown Hungarian notation, but even that isn't rich enough to adequately
> describe the nested data structures we use in Clojure - good descriptive
> variable names are much better at conveying content and purpose).
>
> I guess it may largely just be personal taste, although I would also take
> the wider community into account: there's a lot of code out there not using
> this convention - will that become confusing if you rely on symbols to tell
> you that a variable is an atom?
> On Mon 7 Dec 2015 at 00:27 Mars0i <marsh...@logical.net> wrote:
>
>> On Sunday, December 6, 2015 at 5:52:02 PM UTC-6, Glen Mailer wrote:
>>>
>>> I saw some sample code that prefixed the atom name with a ! recently,
>>> seemed to look sensible to me.
>>>
>>> (swap! !state conj :whatever)
>>>
>>> And so on.
>>>
>>
>> This idea is conceptually elegant, since the marker, !, is the same as
>> the related function suffix.
>>
>> I worry that having two bangs with a space between them, as in the swap!
>> example above, is a little bit visually confusing.   Also, I wonder whether
>> placing @ next two another non-alphanumeric character is visually confusing
>> or messy.
>>
>> As an experiment, I just started using & as a suffix for variables whose
>> values are atoms.:
>> (def state& (atom 1))
>> (swap! state& inc)
>> @state&
>>
>> Using only a suffix character means that you don't have a punctuation
>> character next to @, which I prefer.
>>
>> (I wouldn't want to use ! as the suffix for variables that are not
>> functions, though.  (swap! state! inc) potentially very confusing.  It's
>> not that someone reading it couldn't figure it out, but if I saw that, I'd
>> have to think for a second, and then keep remembering that state! is not a
>> function.)
>>
>> It occurred to me that I've seen both & and $ used in some languages to
>> suggest pointer dereferencing, so there's some vague harmony to using one
>> of them as indicators as markers of statefulness.  "Ampersand" sounds
>> vaguely like "atom".  If one wanted to have separate marker characters for
>> atoms, refs, and agents, maybe & is a good choice for atoms.  Not sure it's
>> necessary to have different conventions for these three distinct uses,
>> though.
>>
>> --
>> You received this message because you are subscribed to the Google
>> Groups "Clojure" group.
>> To post to

Re: Naming convention for atoms, refs, etc.?

2015-12-07 Thread Daniel Kersten
I personally don't like this.

An atom won't suddenly change value without your knowledge because to get
its value, you must use @ or deref (which should be a big warning that,
yes, this value might change between calls to deref).

Adding sigils, in my opinion, adds to the noise and makes it harder to
read. I personally find sigils to be a noisy mistake in other languages
(perl, php etc) and in my opinion you can get more benefit through a
suitable naming convention such as a -state prefix, eg: foo-state

I think, mainly my dislike for sigils is on variables and not so much on
functions as I'm ok with foo? being a predicate and foo! being unsafe in
STM. I think that's because they tell you useful meta information about
what the function does, but to use a variable, I already have to know what
data it's representing in order to call the correct functions on it and
annotating it with sigils doesn't help much (unless perhaps you go full
blown Hungarian notation, but even that isn't rich enough to adequately
describe the nested data structures we use in Clojure - good descriptive
variable names are much better at conveying content and purpose).

I guess it may largely just be personal taste, although I would also take
the wider community into account: there's a lot of code out there not using
this convention - will that become confusing if you rely on symbols to tell
you that a variable is an atom?
On Mon 7 Dec 2015 at 00:27 Mars0i  wrote:

> On Sunday, December 6, 2015 at 5:52:02 PM UTC-6, Glen Mailer wrote:
>>
>> I saw some sample code that prefixed the atom name with a ! recently,
>> seemed to look sensible to me.
>>
>> (swap! !state conj :whatever)
>>
>> And so on.
>>
>
> This idea is conceptually elegant, since the marker, !, is the same as the
> related function suffix.
>
> I worry that having two bangs with a space between them, as in the swap!
> example above, is a little bit visually confusing.   Also, I wonder whether
> placing @ next two another non-alphanumeric character is visually confusing
> or messy.
>
> As an experiment, I just started using & as a suffix for variables whose
> values are atoms.:
> (def state& (atom 1))
> (swap! state& inc)
> @state&
>
> Using only a suffix character means that you don't have a punctuation
> character next to @, which I prefer.
>
> (I wouldn't want to use ! as the suffix for variables that are not
> functions, though.  (swap! state! inc) potentially very confusing.  It's
> not that someone reading it couldn't figure it out, but if I saw that, I'd
> have to think for a second, and then keep remembering that state! is not a
> function.)
>
> It occurred to me that I've seen both & and $ used in some languages to
> suggest pointer dereferencing, so there's some vague harmony to using one
> of them as indicators as markers of statefulness.  "Ampersand" sounds
> vaguely like "atom".  If one wanted to have separate marker characters for
> atoms, refs, and agents, maybe & is a good choice for atoms.  Not sure it's
> necessary to have different conventions for these three distinct uses,
> though.
>
> --
> 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: prettier stacktraces?

2015-10-02 Thread Daniel Kersten
https://github.com/venantius/ultra is also worth a look (its basically a
wrapper plugin that uses aviso/pretty and others under the hood)

On Thu, 1 Oct 2015 at 21:52 Howard Lewis Ship  wrote:

> Without the plugin, I typically added the call to
> io.aviso.repl/install-pretty-exceptions in my user.clj, or in some other
> early-loading namespace.
>
> On Mon, Jun 1, 2015 at 11:57 AM, John Gabriele  wrote:
>
>> On Monday, June 1, 2015 at 2:31:46 PM UTC-4, nikolay.k...@gmail.com
>> wrote:
>>>
>>> I think this  is what you're
>>> looking for.
>>>
>>>
>> Intriguing.
>>
>> How can I get this to work automatically? I've got a project created via
>> `lein new app my-app`, and I want to see the pretty stacktrace when I run
>> the app via `lein run` and things blow up.
>>
>> I tried just adding `[io.aviso/pretty "0.1.18"]` to my project.clj's
>> :dependencies, but that doesn't change the stack trace output in my
>> terminal.
>>
>> 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.
>>
>
> --
> Howard M. Lewis Ship
>
> Starting with WalMart Labs on Sep 28th!
>
> Creator of Apache Tapestry
>
> (971) 678-5210
> http://howardlewisship.com
> @hlship
>
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with
> your first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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: Lispers of Legends

2015-08-17 Thread Daniel Kersten
This sounds like a lot of fun! Good luck with it. Sadly I don't have enough
time to try it myself, but I will also be watching how you get on.

On Mon, 17 Aug 2015 at 14:06 pepijn de vos pepijnde...@gmail.com wrote:

 Thanks!

 I found out you can only have two members on a team, so I’m already full
 (Hi Alex).

 I’m currently working out how to optimise for casters.
 Ideally you’d know the exact damage of their skills, but this info is not
 available as plain data, and implementing 5*125 abilities is infeasible.

 So for AP poke champions i made a “typical” poke ability that I use in my
 model.
 The model is basically mana * mana regen * ability power to get
 sustainable damage output.

 Pepijn

 On 17 Aug 2015, at 14:55, Michael McLellan jmikem...@gmail.com wrote:

 Dota player, not League player -  but this looks really cool. I'm not sure
 if I'll have any time to help out but I'll definitely keep an eye on your
 project to see what you come up with.

 On Sunday, August 16, 2015 at 1:02:46 AM UTC-4, Pepijn de Vos wrote:

 Hi all,

 Are there any League of Legends players on this list?
 Riot has announced the second API challenge, and there is lots of fun and
 prizes to be had.
 https://developer.riotgames.com/discussion/announcements/show/2lxEyIcE

 I'm building something in the item set category. I'm using Simulated
 Annealing to generate optimal item sets for a given set of metrics.
 https://github.com/pepijndevos/LolItemSets

 Example of a Greaves ADC build that balances damage per second and life
 steal per second:

 $ lein run 5 0.5 0.5 0
 Items: (Essence Reaver Phantom Dancer Essence Reaver Infinity Edge Phantom 
 Dancer)
 DPS: 2104.108092806
 life steal: 20.0
 armor: 81.976
 attack damage: 350.008004
 attack speed: 2.1472
 crit: 90.0


 Unfortunately I'm quite busy, so I might not have the time to turn it
 into something usable in time.
 So I was wondering if there are one or two people who would like to join
 my team.
 If so, send me your summoner name and github account.
 If it turns out there are a lot of interested people, I'll give
 preference to people on EUW and names I've seen on #clojure

 The main things that need to happen are:

- Turn it into a snazzy cljs app. I've never done this, so help
welcome.
- Add metrics for different roles and tweak parameters. Almost done
with ADC, starting with Tank, followed by Assassin.
- Export the actual item set.
- As a stretch goal, include runes, masteries, passives, and
opponents in the equation. This gets complicated and laborious quick,
though.

 Keep lisping!

 Pepijn


 --
 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/uv5LE1yY3wU/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: [ANN] `comidi`: a committee approach to defining HTTP routes

2015-07-01 Thread Daniel Kersten
Regarding the Whats next in the README:

*looking into swagger integration. I could swear I found some bidi-swagger
bindings somewhere a while back, but am not finding them at the moment*

Could you perhaps be thinking of the Yada swagger integration?
http://yada.juxt.pro/user-guide.html#Swagger yada.swagger is designed to be
used with bidi.

https://github.com/juxt/yada/blob/master/src/yada/swagger.clj



On Wed, 1 Jul 2015 at 10:45 Chris Price ch...@puppetlabs.com wrote:

 Hiya.


 We really like the syntax of compojure for defining HTTP routes, but have
 had some trouble with use cases where we'd really like to be able to
 introspect the route tree, and aren't able to do so because the nested
 functions are pretty opaque.

 After spending some time trying to workaround that, and giving up, we
 decided to look into bidi, which has been awesome.  The data-driven route
 tree is really, really useful.

 However, a wholesale port of all of our existing apps directly from
 compojure to bidi seemed daunting.  Enter `comidi`:

 https://github.com/puppetlabs/comidi

 This is a small library that uses bidi to build up route trees, but
 provides a compojure-like syntax for defining the routes, and uses
 compojure's render capabilities to support flexible syntax for specifying
 your individual handlers for each route.

 We've also got a related project that integrates comidi with our
 Trapperkeeper framework and the dropwizard metrics library, to give you
 middleware that will automatically track request metrics for each route in
 your bidi/comidi route tree.

 This is all a work in progress: notably, we had built up some prismatic
 schemas around the route structures, but since the latest release of bidi
 ships with its own schemas, we'll probably try to upgrade to that and
 reconcile the differences soon.

 We also have some plans for improving the ability to wrap middleware
 around the route tree at various levels, and to look into some ring-swagger
 integration soon.

 --
 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] thi,ng/geom 0.0.856 (new dataviz module)

2015-06-17 Thread Daniel Kersten
Mine too, this is fantastic work and the charts are very pretty :)

On Wed, 17 Jun 2015 at 20:05 Ivan L ivan.laza...@gmail.com wrote:

 this is quickly becoming my clojurescript goto viz api.  keep up the great
 work!

 --
 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: erinite/template

2015-06-08 Thread Daniel Kersten
Hi everyone,

I am working on a collection of web development libraries to accomplish
various tasks that I've found myself wanting or needing in recent months.
Collectively, I've dubbed them Erinite.

The first of these libraries is erinite/template, a Clojure(script) hiccup
transformation library inspired by Enlive.

https://github.com/Erinite/template

The idea is that transformations are specified similarly to how you would
in Enlive (a map of selectors to transformations), with the key difference
that the transformation rules are themselves just data.
My personal use cases for this are twofold: to be able to process the exact
same template both on the server and the client; and to be able to store
templates and their transformations in an externally editable form (perhaps
in a database).

I would love to get some feedback before I look at where I would like to
take the library next. For example, something I'm thinking about is
compiling hiccup+transformations into Om, Reagent or freactive components
that will efficiently render changes.

-- 
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] Time-Bombed Open License - thoughts?

2015-06-07 Thread Daniel Kersten
One thing worth pointing out is that OSS needn't be free as in beer.

I've paid for OSS SaaS products because I don't want to host and admin them
myself, for example.

If your service provides something above and beyond what the source
provides (and the OSS freedom), then you *may* still have a business. Maybe.

On Sun, 7 Jun 2015 10:42 Alan Moore kahunamo...@coopsource.org wrote:

 Fergal,

 *Warning* - Wall of text ahead! If you think OSS works perfectly fine the
 way it is today feel free to press delete now...

 I've been holding back commenting on this thread to see where it would go.
 It is nice to see everyone's take on the need for (or not) a solution to
 the lack of an OSS business model. From what I can tell, there really
 isn't a business model in OSS at all. Almost by definition, the market
 for OSS is a failed market. What other industry/market exists where the
 price of goods is $0?

 Freedom issues aside, when you give away the fruits of your hard labor you
 are doing just that, giving it away and that in no way constitutes a sale.
 The Free Rider problem is alive and well, that is just human nature. I
 would love to live in a world where this isn't true and I actively work
 towards a future when we can all just work on whatever scratches our itch,
 but so far we are not there yet.

 Of course, ancillary to the lack of a price/valuation for the code itself,
 companies still make money by various other means given the environment
 created by the OSS they give away. I doubt that Clojure or any other OSS
 project has ever made any significant cash flow just giving away code.
 Conferences, books, consulting services, freemium, value added Closed
 Source/Dual License products and all the rest make up the difference
 (hopefully!) Sometimes just the marketing visibility generated by giving
 away code is enough to cover the costs of producing it. In that way, OSS
 can be accounted for as a marketing give away from which other revenue
 and goodwill will flow. This is obvious stuff we all know.

 To be perfectly honest, I am not a fan of the GPL or any other viral
 license. I do not believe code needs to be free. Code is code, an
 inanimate artifact of human labor. Everyone is free to give theirs away - I
 think this is admirable and altruistic behavior that we need more of. I'm
 very grateful that Rich and all the rest of the Clojure developers,
 contributors, library authors, etc. are giving their time, effort and focus
 to make this community what it is, awesome! A very big shout out to all of
 you.

 Clearly there is a spectrum of software that runs the gamut from operating
 systems, languages, databases, tools and other utility code, up through
 more targeted platforms such as SAS, CRM, SalesForce type systems. Another
 example class of software might target an industry such as Construction
 Project Management systems or even custom software written in-house or by a
 consultancy for a specific customer (that could, in theory, be refactored
 and sold to another customer), software written for a specific piece of
 hardware (my day job) and finally software written by the NSA, which has no
 market value whatsoever. As the utility for a wider audience decreases so
 too does the potential market, which in turn affects how licensing terms
 are chosen for any given project.

 Each of these classes of software seems to have different requirements for
 licensing terms. Typically, OSS projects tend to fall under the utility
 class and has the widest audience, almost by necessity/definition, and
 seems to do best with very lenient license terms. All of these classes of
 software overlap to some degree in their needs for things like developer
 mind share or the availability of engineers to work on a project,
 technology or code base.

 Layered on top of the pragmatic concerns listed above are the larger moral
 (e.g. freedom) and societal (IP/patents, OccupyStartups?) factors that
 influence the choice of licensing terms for a code base. Clearly the GPL
 and other Open Source licenses are very opinionated in their terms.

 In reviewing your license terms, I don't know what class of software your
 license is intended to target. Your approach may have a fatal flaw in that
 the time it takes to bootstrap is highly variable and having a fixed
 deadline might fit some projects/markets but not others.

 In my thirty years of working in the Silicon Valley for many different
 startups we were almost always too early into the market. This left us
 running out of money and scrambling to find other sources of revenue
 (pivoting in modern parlance) and inevitably shuttering the business or
 being bought out for very small fractions of the potential value. We built
 a Tivo-like system before there was a Tivo, we did ads and coupons on gas
 pumps, ATMs and grocery checkout terminals long before there was Groupon,
 we built teleradiology systems before telemedicine became a thing, etc.
 etc. I once filed a trademark 

Re: Help with data structure transformation

2015-06-06 Thread Daniel Kersten
x and y are destructured into the key and value of each map entry. Z is
nil.

The second example uses seq to convert the map into a sequence of map
entries and then it destructures the seq (not the map entries themselves).
The third example does destructure the map entries.

(let [[a b c] [1 2]] [a b c])
[1 2 nil]

Since map entries are treated like two element vectors, they get
destructured like that let does.
Since the third example is in a for, it does this for each map entry and
places the results in a sequence.

On Sat, 6 Jun 2015 12:24 gvim gvi...@gmail.com wrote:

 On 06/06/2015 05:01, Sean Corfield wrote:
  Page 84 is where it shows that maps are a sequence of pairs.
 
  The destructuring in James's code is on vectors -- the pairs in the
  sequence.
 
  Hope that helps?
 
  Sean
 

 Page 84 describes the sequence abstraction in general but it's the
 implicit seq in for destructuring that threw me as I can't recall an
 example of it in any books I've read. I don't know what to make of this,
 for example:

 (seq {:a aa :b bb :c cc})
 ([:c cc] [:b bb] [:a aa])   ;; Fine so far

 (let [[x y z] (seq {:a aa :b bb :c cc})] [x y z])
 [[:c cc] [:b bb] [:a aa]]   ;; Consistent with first example above

 (for [[x y z] {:a aa :b bb :c cc}] [x y z])
 ([:c cc nil] [:b bb nil] [:a aa nil]);; WTF?

 Taken together these make no sense to me.

 gvim

 --
 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] Time-Bombed Open License - thoughts?

2015-06-05 Thread Daniel Kersten
To chime in on why would I do this:

Lots of companies already are successfully built on open source, so I don't
buy the *but then I can't make money* argument - at least, not as a
blanket statement . There are two models I've commonly seen used: The
direct Red Hat model (open source software, commercial support) and the
indirect Cognitect model (Datomic is closed source, but its built with and
on a wealth of open source which Cognitect maintain). The Red Hat model
could probably work for Datomic as its something where customers likely
want commercial support for, but its unlikely to work for Cursive.

Basically, it can and does work for many people, but to directly address
the question why? - I've been involved in startups for a few years and a
very common question I was asked by potential customers is *but what if
you go out of business? Will we still be able to use the service?*

What Fergal is proposing (or the escrow alternative that Franklin
mentioned) aims to solve that and give these customers peace of mind.

This is likely only relevant to early stage startups, however. An
established company like Cognitect likely doesn't have this issue and
therefore has more flexibility in how they offer their products.

At the end of the day, its up to each individual to decide whats best for
them, their software and their business, but having options available is a
good thing, if this license can be made work.


On Fri, 5 Jun 2015 at 13:27 Franklin M. Siler m...@franksiler.com wrote:


 On Jun 5, 2015, at 0711, Fergal Byrne fergalbyrnedub...@gmail.com wrote:

  The GPL already has a clause which allows the owner (and downstream
 user) to defer, for 12 months, the full obligations of GPL - see this guy's
 take:
 https://github.com/zooko/tgppl/blob/master/COPYING.TGPPL-v2-draft.rst
 
  Our idea is a bit more startup-friendly - on the commercial side of the
 dual license, everyone can keep their improvements/extensions closed for up
 to the full duration of the time-bomb, but they then have to give it all
 back.
 
  As to enforceability, I'm guessing copying the language of GPL is
 hopefully sufficient. These things are rarely tested as far as I know, but
 I'm sure someone knows better than me.
 
 I think the GPL, MIT, Apache, etc. licenses are probably fine for real
 world use.  Why?  Because everyone uses them.  They are industry norms.

 The license you linked is a draft; however, mainline GPLv3 has some
 specific terms related to timing- see section 6(b).

 The thing is that licenses are not “contracts” in the sense that a
 contract is offer + acceptance + consideration.  A license is a promise not
 to sue, and there are a number of subtle but important things that may or
 may not work in that situation.  For example, there is no blanket rule on
 the relationship between fair use and a license agreement.  All of this is
 complicated in that purchased software may have a controlling contract on
 top of the licensing agreement, so the enforceability of the system as a
 whole can get quite messy.

 All I’m saying here: I’m not sure that a court will buy that “if you do X
 before this date, I won’t sue you; but then if you do this after Y date, I
 will” is a valid license.  It’s certainly not the norm.

 Frank


 Franklin M. Siler
 Counselor at Law|||   franksiler.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: When use Pedestal, Hoplon, Bidi and Route-one?

2015-06-01 Thread Daniel Kersten
As far as I can tell, in that table isomorphic means that you can go both
from URL to route and from route to URL, whereas cljs means you can
use it from clojurescript in the browser.

I personally use bidi and its great. Because its just data, it means that
you can easily combine and compose routes. Because it works in both clj and
cljs it means you can use the same or very similar routes or routing code
both in client and server should you want to do that. I'm sure the others
are great too, but I have no experience with them (besides compojure). I
did try silk when it first came out but I found bidi easier ultimately (at
least, at the time).

On Sun, 31 May 2015 at 13:37 Krzysztof Władyka krzysz...@wladyka.eu wrote:

 Hi,

 I am trying figure out which one (Pedestal, Hoplon, Bidi) should i use? I
 didn't find any good article in the Internet which help me with this choice.

 From https://github.com/juxt/bidi i can read Pedestal is isomorphic, but
 Bidi is also cljs. What is it mean? What is the difference?


 I found compojure is to simply. I can't even generate URLs in HTML
 templates. I started looking something else. I found also route-one
 (library to generate URLs working with compojure), but i guess soon i will
 discover i need something more then compojure have again.

 My intuition say me to choose between: Pedestal, Hoplon and Bidi.


 What i need:
 I want have independent business model architecture like
 http://blog.8thlight.com/uncle-bob/2012/08/13/the-clean-architecture.html

 http://blog.find-method.de/index.php?/archives/209-Dependency-inversion-in-Clojure.html

 I don't want depend this part of code with any framework. Less dependency
 is better.


 On next stage i want inject this model business into something like
 bridge, which will be the connector with user interface. It can be time for
 framework or additional libraries.

 And at least i want create frontend user interface as website. It will be
 dynamic content with ClojureScript or mayby static. I don't know. I have to
 thing about both.


 What i found out in Clojure i really like conception on building my own
 set of libraries based on my preferences. But i don't want write my own
 code to use things like generate URLs for routes. So mayby i should also
 consider route-one?


 Please write something clever what help me choose one or complicate my
 live with some other option to choose :)
 https://github.com/juxt/bidi
 https://github.com/pedestal/pedestal
 https://github.com/tailrecursion/hoplon
 https://github.com/clojurewerkz/route-one

 --
 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-08 Thread Daniel Kersten
I haven't used Luminus since before 2.0, so I guess it may have changed a
lot since. At the time, I was disheartened by the amount of code generated.
I will take another look when I get time.

On Tue, 5 May 2015 at 14:06 Dmitri dmitri.sotni...@gmail.com wrote:

 Luminus uses a minimal amount of generated code. It completely embraces
 the composable library approach. The difference from rolling your own each
 time is that it provides some structure and it's a curated set of libraries
 that are known to work well together.


 On Tuesday, May 5, 2015 at 3:46:09 AM UTC-4, Dan Kersten wrote:

 On Monday, May 4, 2015 at 4:41:02 AM UTC-4, Sven Richter wrote:

 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?


 This is the reason I don't use Luminus or Modularity or others that rely
 heavily on leiningen template-based codegen. Its very difficult to upgrade
 the generated code, especially if you've had to add to or modify it.

 I'm experimenting with an approach that would generate only the
 project.clj file and directory structure (putting everything else into
 libraries), but don't yet have anything to release (my code is currently
 very targeted at my own use case, but in time I'd like to generalize it a
 bit and let others at it).

  --
 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: juxt/bidi ring question

2015-05-05 Thread Daniel Kersten
I'm going to take a wild guess and say: missing wrap-content-type middleware
perhaps?

On Mon, 4 May 2015 at 20:37 Fluid Dynamics a2093...@trbvm.com wrote:

 On Monday, May 4, 2015 at 3:21:19 PM UTC-4, clifford wrote:

 Thanks @fluiddynamics your right on the money.

 On Monday, 4 May 2015 17:34:26 UTC+2, clifford wrote:

 Hi

 I am using juxt/bidi for route matching.

 with the following routes:

 (def routes [/ {index.html :index
 articles/ {index.html :article-index
  [:id] :article}}])


 It correctly matches at the REPL.

 (match-route routes /articles/4)
 = {:handler :article, :route-params {:id 4}}


 However in the browser, when I hit the url, localhost:3000/articles/4
 It attempts to download a file with name 4, can anybody let me know
 what I'm doing wrong here?

 Clifford


 YW. Now, just to satisfy the curious (and maybe help anyone else who runs
 into a similar problem): what was causing the Content-Type not to be
 correct?

 --
 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-05 Thread Daniel Kersten
On Monday, May 4, 2015 at 4:41:02 AM UTC-4, Sven Richter wrote:
 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?


This is the reason I don't use Luminus or Modularity or others that rely
heavily on leiningen template-based codegen. Its very difficult to upgrade
the generated code, especially if you've had to add to or modify it.

I'm experimenting with an approach that would generate only the project.clj
file and directory structure (putting everything else into libraries), but
don't yet have anything to release (my code is currently very targeted at
my own use case, but in time I'd like to generalize it a bit and let others
at it).

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


ring.middleware.reload and figwheel

2015-04-30 Thread Daniel Kersten
Hi,

I've got a clojure(script) project where I use figwheel to live-reload cljs
and this works great, but I'm now trying to set up live reloading of the
server-side clojure too.
Since I don't want to run multiple jvm/lein instances, I'm using figwheels
:ring-handler feature to add my server ring handler into figwheels embedded
webserver.
In the past, I've live-reloaded my server code using the reloaded workflow,
but since figwheel gives me a cljs repl and not a clj repl, I don't know
how to do that without running the server independently.

So, instead I'm just trying to get ring.middleware.reload working, but its
not picking up file changes.

Has anyone got this working? Alternatively, does anyone have any tips on
getting a nice workflow without running multiple jvm/lein instances?

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.


Re: [ClojureScript] Re: [ANN] Clojure 1.7.0-beta1 released

2015-04-13 Thread Daniel Kersten
Ouch! But that actually makes a lot of sense.

On Mon, 13 Apr 2015 14:58 Alex Miller a...@puredanger.com wrote:

 There is a ticket to consider a portable solution to this issue:

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


 On Monday, April 13, 2015 at 5:45:35 AM UTC-5, David Nolen wrote:

 The only reason :default exists is because *anything* in JavaScript can
 be thrown and there needs to be some way to catch non-Error derived values.
 This is not the case for Java of course. :default could probably be aliased
 to Throwable, but in the meantime differences like this are now handleable
 via conditional reading.

 David


 On Mon, Apr 13, 2015 at 6:37 AM, Robin Heggelund Hansen 
 skinn...@gmail.com wrote:

 Hmm... In Clojurescript you can do the following

 (try
   ;; throw something
   (catch :default e
  e))

 When I try the same thing in Clojure, it seems to not be supported. Is
 there any plans to support this syntax in Clojure 1.7?


  --
 Note that posts from new members are moderated - please be patient with
 your first post.
 ---
 You received this message because you are subscribed to the Google Groups
 ClojureScript group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to clojurescript+unsubscr...@googlegroups.com.
 To post to this group, send email to clojurescr...@googlegroups.com.
 Visit this group at http://groups.google.com/group/clojurescript.


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


Re: [ANN][book] Clojure Reactive Programming

2015-03-27 Thread Daniel Kersten
Just bought a copy too. So far looks great! Can't wait to read the rest of
it :)

On Fri, 27 Mar 2015 at 12:52 Luc Prefontaine lprefonta...@softaddicts.ca
wrote:

 Bought it myself too...
 If this is some kind of  marketing stunt, it
 caught me off guard...  (sic)

 Luc P.


  The list is so cool that I think this discussion is actually part of the
  book's marketing strategy. It worked! I just bought my copy ;-)
 
  On Thu, Mar 26, 2015 at 4:57 PM, Colin Yates colin.ya...@gmail.com
 wrote:
 
   Hi Leonardo, I haven't read it yet but I am very much looking forward
   to it based on other people's responses :).
  
   On 26 March 2015 at 15:52, Leonardo Borges 
 leonardoborges...@gmail.com
   wrote:
Thanks everyone for the kind words!
   
It makes it all worth it :)
   
Cheers,
Leonardo
   
   
On Thursday, March 26, 2015 at 11:44:27 AM UTC-3, Shaun Mahood wrote:
   
Just thought I would leave a quick note for anyone interested in the
   book
(and hopefully get the thread back on topic). I'm about 1/3 through
 the
   book
and have found it really well written and interesting so far. It's
 an
excellent introduction to reactive programming in general and for
   clojure
specifically, and is easy to follow for a relative beginner in both
   clojure
and reactive programming. If you have any interest at all in the
 topic I
highly recommend picking it up.
   
Thanks for writing it Leonardo!
   
On Tuesday, March 24, 2015 at 8:26:02 AM UTC-6, Leonardo Borges
 wrote:
   
Hi all,
   
Some of you may know that I have been working on a book for the
 better
part of last year.
   
I'm happy to announce it has finally been published! Here's the
 link:
https://www.packtpub.com/web-development/clojure-reactive-
 programming
   
I hope you find it useful! I've had a great time putting it
 together!
   
Cheers,
Leonardo Borges
www.leonardoborges.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.
  
 
 
 
  --
  Hildeberto Mendonça, Ph.D
  Blog: http://www.hildeberto.com
  Community: http://www.cejug.net
  Twitter: https://twitter.com/htmfilho
 
  --
  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.
 
 --
 Luc Prefontainelprefonta...@softaddicts.ca sent by ibisMail!

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

Re: Joplin: No method in multimethod 'migrate-db' for dispatch value: :sql

2015-03-21 Thread Daniel Kersten
Make sure you require the sql migrations in your jub.datasources source
file. This is probably it since jub.datasources cannot find the correct
defmethod for migrate-db. Also make sure the migrations are on the
classpath.

On Sat, 21 Mar 2015 at 09:38 Hildeberto Mendonça m...@hildeberto.com wrote:

 Hello,

 I'm trying to use Joplin for database migration in the project
 javaee-utility-belt (despite the name, it's written in Clojure ;-) The way
 I found to start programming in Clojure at work:
 https://github.com/htmfilho/javaee-utility-belt), but I'm getting the
 following exception:

 #CompilerException java.lang.IllegalArgumentException: No method in
 multimethod 'migrate-db' for dispatch value: :sql,
 compiling:(jub/core.clj:5:16)

 I've added joplin.core in my dependencies:

   :dependencies [[org.clojure/clojure 1.6.0 ]
  [org.clojure/java.jdbc 0.3.6 ]
  [mysql/mysql-connector-java 5.1.25]
  [joplin.core 0.2.9 ]]

 I'm trying to call Joplin from code to run the migration automatically at
 every execution. For that, I wrote datasource.clj as follows:

 (ns jub.datasource
   (:require [clojure.java.jdbc :as jdbc]
 [joplin.core   :as joplin]))

 (def mysql-db {:subprotocol mysql
:subname //localhost:3306/jub
:userjub_user
:passwordpsswd})

 (def joplin-target {:db {:type :sql, :url (str jdbc:mysql: (get mysql-db
 :subname)
?user=  (get mysql-db
 :user)
password=  (get mysql-db
 :password))}
 :migrator resources/migrators/sql})

 (defn migrate-mysql-db []
   (joplin/migrate-db joplin-target))

 Then, I'm calling migrate-mysql-db from core.clj, as follows:

 (ns jub.core
   (:require [jub.log-file  :refer :all]
[jub.datasource:refer (migrate-mysql-db)])
   (:gen-class))

 (migrate-mysql-db)

 When I start the repl (lein repl) the function (migrate-mysql-db) is
 called and the exception above is produced.

 You can see the code in this branch:
 https://github.com/htmfilho/javaee-utility-belt/tree/Issue%237

 Can anybody help me with this issue? Thanks in advance!

 --
 Hildeberto Mendonça https://twitter.com/htmfilho

 --
 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: Om design query

2015-03-06 Thread Daniel Kersten
I should have been clearer. I was thinking by using callbacks like Colin
suggests. I've had code that looks like this before:

(om/build component data {:opts {:cb #(om/set-state! owner %)}}

On Fri, 6 Mar 2015 14:43 James Reeves ja...@booleanknot.com wrote:

 On 6 March 2015 at 09:13, Colin Yates colin.ya...@gmail.com wrote:

 I know this is a different direction than a lot of people but I store
 everything in the app-state and so far it has worked well. There are a
 hundred reasons why this (storing everything in app-state) is a
 terrible idea, but I haven't run into any of them.


 I was considering that. It seems wrong, but I hadn't been able to think of
 any specific problems that would come of it.


 If you did want to store component-local state then channels or a
 simple cb would suffice. I would go with a callback in this case as it
 seems to be a pure implementation detail of the 'layout' component. If
 the children of the layout are external to the layout (i.e. the layout
 component is a generic reusable thing) then can you now simply put the
 logic in the IDidMount of the container and then query the dom itself
 for all children of that container?


 Oh, now that's an interesting idea. I was trying to do everything through
 components in a very declarative way, but perhaps this is a case where it
 would be useful to reach into the DOM instead, and manually rearrange the
 positions after a IDidMount or IDidUpdate event.

 - 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: Who's using Clojure?

2015-03-06 Thread Daniel Kersten
Regarding hiring, it seems to me that most of the smaller companies aren't
hiring clojure developers but rather training other developers.

I know one local former java shop that now mostly uses clojure for new
development and non of their team of ~10 had any prior clojure experience.
In my own startup I'm one of only two developers and the other guy had no
prior clojure experience but picked it up in a matter of weeks.

To add to the who's using clojure conversation: I know three companies
here (Dublin, Ireland) who are using Clojure heavily (and one or two more
US companies who use it who have operations here but I think they're
already mentioned on the lists here).

On Fri, 6 Mar 2015 09:53 Rangel Spasov raspa...@gmail.com wrote:

 Haha this is the funniest thing I've read in a while! Good luck, forge on!
 :)


 On Thursday, March 5, 2015 at 7:47:41 AM UTC-8, Michael Richards wrote:

 I'm about to start training 4 devs on my team at Oracle in Clojure.  My
 manager is very nervous about putting Clojure into the product.  I'm
 forging on regardless :)  I rewrote some components of our product in
 Clojure in my spare time, mainly as a proof of concept that we could do
 some of our analytics in the streaming model rather than in the data
 warehousing model.  As sometimes happens, the POC was so simple and fast
 that the team is now interested in productizing it.

 In our last 1-1 meeting, my manager told me he had searched LinkedIn for
 Clojure and only got 9000 matches.   Whereas his search for Java turned
 up 80 million or some such.  My rebuttal is that those are the 9000
 smartest developers, so you should be trying to recruit them.


 --mike


 On Tuesday, April 19, 2011 at 7:38:14 AM UTC-7, Damien wrote:

 Hi Everyone,

 I'm on a mission: introducing Clojure in my company, which is a big
 consulting company like many others.

 I started talking about Clojure to my manager yesterday.
 I was prepared to talk about all the technical benefits and he was
 interested.
 I still have a long way to go but I think that was a good start.

 However I need to figure out how to answer to one of his questions: who
 is using Clojure?

 Obviously I know each of you is using Clojure, that makes almost 5,000
 people.
 I know there is Relevance and Clojure/core.
 I read about BackType or FlightCaster using Clojure.

 But, let's face it, that doesn't give me a killer answer.

 What could help is a list of success stories, a bit like MongoDB
 published here:
 http://www.mongodb.org/display/DOCS/Production+Deployments

 Is there a place where I could find this kind of information for Clojure?

 Thanks

 --
 Damien Lepage
 http://damienlepage.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: Om design query

2015-03-06 Thread Daniel Kersten
You can provide refs to dom calls and use om/get-node to retrieve them:

(dom/div #js {:ref foo} ...)

(om/get-node owner foo)

It is tied to the owner though and I'm not entirely sure what that means
for grabbing refs from other components - as far as I'm aware, it will work
just fine for children but maybe not for siblings. Worth a try though.

On Fri, 6 Mar 2015 at 18:37 Glen Mailer glenja...@gmail.com wrote:

 In ordinary React I think I would keep all of this logic in the parent,
 and read from the DOM in didUpdate. There's a feature called refs which can
 be used to grab references to the rendered children to get their DOM nodes.

 I'm afraid I don't know how to do the equivalent in Om.

 --
 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: Om design query

2015-03-06 Thread Daniel Kersten
I've successfully used component local state for similar tasks while
working with DimpleJS charts.

On Fri, 6 Mar 2015 05:46 Tom Lynch tfly...@gmail.com wrote:

 One workable possibility:

 * init a core.async channel in the container
 * pass the channel from the container into each child component at build
 time using :opts or :state
 * send the discovered size of each child component, with identifying data,
 as a channel message during IDidMount

 I don't find these sorts of solutions terribly elegant but it would be
 usable I think.


 Tom


 On Friday, 6 March 2015 12:42:12 UTC+8, James Reeves wrote:

 I've been writing an application using Om, and I've come across a problem
 I haven't been able to find a good solution for. I'd be grateful for any
 ideas people might have on how to proceed.

 In a nutshell, I have a bunch of elements that need to be arranged
 according to a specific algorithm. They cannot overlap, so I need to know
 the sizes of all the elements in order to arrange them.

  --
 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: [ClojureScript] Re: ANN: Om 0.8.6, Hello CLJSJS

2015-02-02 Thread Daniel Kersten
 I personally like data. om-tools also calls it data.

On 2 February 2015 at 12:55, Khalid Jebbari khalid.jebb...@gmail.com
wrote:

 Indeed, data is better than app.

 Khalid aka DjebbZ
 @Dj3bbZ

 On Mon, Feb 2, 2015 at 10:49 AM, Sebastian Bensusan sbe...@gmail.com
 wrote:

 Thanks Khalid,

 The way I see it, Om has three concepts regarding state:

 1. The global state defined with atom. Named `app-state`
 2. The cursor passed to each component with the relevant parts of the
 global state. Named `app`
 3. Local state of each component, initialized in `IInitState` and
 manipulated with `(set-state! owner korks v)` and `(get-state owner)`. It
 is a property of the owner object so it is not directly referenced.

 I agree that `app` is ambiguous for 2 but I wouldn't like to call it
 `app-state` nor `state` since those could also be confused with 1 and 3.
 Nothing better than `cursor` or `data` comes to mind. Some other parts of
 the Documentation (the Example in https://github.com/swannodette/om) use
 `data` and I think it works even if it is a meaningless term for a fn
 argument. If you agree and nobody raises objections I'll change `app` to
 `data`.

 Sebastian

 --
 Note that posts from new members are moderated - please be patient with
 your first post.
 ---
 You received this message because you are subscribed to a topic in the
 Google Groups ClojureScript group.
 To unsubscribe from this topic, visit
 https://groups.google.com/d/topic/clojurescript/bruQ9os5wmM/unsubscribe.
 To unsubscribe from this group and all its topics, send an email to
 clojurescript+unsubscr...@googlegroups.com.
 To post to this group, send email to clojurescr...@googlegroups.com.
 Visit this group at http://groups.google.com/group/clojurescript.


  --
 Note that posts from new members are moderated - please be patient with
 your first post.
 ---
 You received this message because you are subscribed to the Google Groups
 ClojureScript group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to clojurescript+unsubscr...@googlegroups.com.
 To post to this group, send email to clojurescr...@googlegroups.com.
 Visit this group at http://groups.google.com/group/clojurescript.


-- 
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: [ClojureScript] Re: ANN: Om 0.8.6, Hello CLJSJS

2015-01-27 Thread Daniel Kersten
A figwheel-based tutorial would be fantastic.

I don't have an awful lot of time to convert it right now, but if nobody
does before I do get time, I'll happily take a stab at it. Will likely be a
month or two though.

On 27 January 2015 at 16:24, David Nolen dnolen.li...@gmail.com wrote:

 I think expecting every last thing to work especially from third parties
 who may be wisely lagging behind is unlikely at least for the near future.

 I haven't kept up with Light Table and what issues it may have. Now is
 probably a good time to remove the Light Table centric nature of the Om
 tutorials and switch to a Figwheel based thing that doesn't require
 anything more than your text editor of choice.

 The wiki has always been community editable and I would love to see people
 push it forward especially with stuff like this. I will have less time for
 such things as I focus more on Om core and ClojureScript enhancements.

 David

 On Tue, Jan 27, 2015 at 10:46 AM, Olav Nymoen o...@comoyo.com wrote:

 Just testing clojurescript out so many possible pitfalls on my side here.

 Does the new javascript externals stuff break lighttables live external
 browser functionality?

 Following the basic intro tutorial I cannot get live updates to work. The
 mies-om om-tut is based on 0.8.4 , and it cannot reference
 com.facebook.react, while 0.8.6 cannot find cljsjs.react.

 It compiles nicely with lein, but I can't seem to get the lighttable live
 REPL stuff to work.

 Olav

 On Tuesday, January 27, 2015 at 1:57:19 AM UTC+1, David Nolen wrote:
  The only significant change is that Om now relies on the cljsjs.react
 artifact instead of the one I maintained myself. cljsjs.react has the
 benefit that usage of React with addons instead of plain React may be
 configured via Maven in your pom.xml or your project.clj. It's exciting to
 see that we are already reaping the benefits of :foreign-libs and Maven
 over existing JavaScript solutions for managing dependencies.
 
 
  This release also includes a fix for a very subtle set-state! bug
 discovered by Brenton Ashworth.
 
 
 
  Feedback welcome!
 
 
  https://github.com/swannodette/om
 
 
 
  David

 --
 Note that posts from new members are moderated - please be patient with
 your first post.
 ---
 You received this message because you are subscribed to the Google Groups
 ClojureScript group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to clojurescript+unsubscr...@googlegroups.com.
 To post to this group, send email to clojurescr...@googlegroups.com.
 Visit this group at http://groups.google.com/group/clojurescript.


  --
 Note that posts from new members are moderated - please be patient with
 your first post.
 ---
 You received this message because you are subscribed to the Google Groups
 ClojureScript group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to clojurescript+unsubscr...@googlegroups.com.
 To post to this group, send email to clojurescr...@googlegroups.com.
 Visit this group at http://groups.google.com/group/clojurescript.


-- 
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] Introducing 'Phoenix' - a new library for declarative configuration and wiring of Component-based systems

2015-01-25 Thread Daniel Kersten
Hi James,

This looks nice. I do have one question: is it possible to load parts of a
configuration from environment variables?

Eg, in your location-aware configuration example, lets say I wanted to
specify the database user and pass configuration options as you do for the
dev configurations, but I want to load them from environment variables in
the prod configuration?

Or, better yet, if it were pluggable (through tagged literals maybe?), so
that I can choose where to load configuration from, eg, zookeeper or etcd).

On Sat Jan 24 2015 at 3:20:13 PM James Henderson ja...@jarohen.me.uk
wrote:

 Hi all,

 I've just released Phoenix - a library for declarative configuration and
 wiring of Component-based systems. Phoenix came out of a number of
 discussions at ClojureX, thank you to all involved for their suggestions
 and feedback :)

 https://github.com/james-henderson/phoenix

 If you’ve written a traditional Component-based system, you’ve probably
 experienced having to create and maintain a plethora of ‘system.clj’,
 ‘dev.clj’, ‘user.clj’ etc type namespaces in order to wire-up the system,
 set up configuration-based switches, and duplicate the code to
 start/stop/reload the system. Phoenix removes the need for all of this,
 replacing it with one (or more, if you choose) EDN declaration of how your
 system should be wired up. It should also compose well with any other
 Components you (or anyone else) may have already written.

 For a sample project, you can run 'lein new phoenix-webapp your-project',
 then 'cd your-project' and 'lein dev'. Once the nREPL is up, running '
 (phoenix/reload!)' will stop the system, reload any namespaces, and
 restart the system.

 Phoenix is just one possible way of wiring up such a system - I understand
 that there are a fair few ideas floating around out there at the moment!
 I'd be really interested to hear your thoughts - whether it be 'this is
 mostly right, but I wouldn't do that part like that', or 'you've gone about
 this completely the wrong way, because ...' - let me know!

 Cheers,

 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: [ClojureScript] Re: ANN: ClojureScript 0.0-2719, JavaScript Dependencies

2015-01-24 Thread Daniel Kersten
Thanks David for your continued hard work - another fantastic release. This
looks really good and solves real problems.

On Sat, 24 Jan 2015 16:09 David Nolen dnolen.li...@gmail.com wrote:

 On Sat, Jan 24, 2015 at 11:01 AM, Khalid Jebbari khalid.jebb...@gmail.com
  wrote:

 A question (maybe stupid/obvious) : why do you need to declare the min
 version of js lib ? The normal version + the extern file is all that's
 needed to compress the file with the Closure Compiler, no ?


 Declaring the minified version is completely optional.

 JavaScript libraries generally ship minified versions so why not leverage
 it? Including the un-minified version into the Closure Compiler build is
 usually asking for trouble (I encountered problems with React in the past)
 and just slows down advanced builds by having more JavaScript to process,
 especially large libraries like React (30KLOC).

 David

 --
 Note that posts from new members are moderated - please be patient with
 your first post.
 ---
 You received this message because you are subscribed to the Google Groups
 ClojureScript group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to clojurescript+unsubscr...@googlegroups.com.
 To post to this group, send email to clojurescr...@googlegroups.com.
 Visit this group at http://groups.google.com/group/clojurescript.


-- 
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: equivalent of Compojure resources in juxt/bidi

2015-01-11 Thread Daniel Kersten
Hi,

Take a look at https://github.com/juxt/bidi#resources-and-resourcesmaybe

Regards,
Dan

On 11 January 2015 at 19:27, cliff clifford.goldb...@gmail.com wrote:

 Hi

 I am trying to mimic the following Compojure behaviour, in juxt/bidi

 (defroutes routes
   (*resources* /)
   (GET /* req (io/resource index.html)))



 (def http-handler (reload/wrap-reload (api #'routes)))


 In Compojure, the 'resources' function seems to load all resources by
 default from /resources/public/.
 When I try set up the equivalent routes in bidi, I keep getting errors of
 resources not found.

 How would you do this in, juxt/bidi ?

 Thanks
 Clifford

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

2015-01-05 Thread Daniel Kersten
I'm building a fairly simple online store site using http-kit, ring, bidi,
enlive, clj-rethinkdb, stripe-clj, clauth, mailer and DomKM's server-side
Om rendering technique on the server and  cljs-http, om, bootstrap-cljs,
markdown-clj and core.async on the client.

It's not my day job so it's progressing rather slowly, but it works quite
well for me so far. The back end is basically a rest api that can also
prerender certain URL routes and there are two client apps: the store
itself and an admin interface.

The store has a simple product listing, you can view individual products, a
shopping cart, checkout, stripe credit card payment and `static` (markdown)
pages for about, terms of service etc.

The admin page allows you to create and update products (details, price,
upload images) and edit the markdown for the `static` pages.

-- 
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] silc - a tiny entity database for clojure (games)

2014-12-03 Thread Daniel Kersten
Is it possible to retrieve all entities with a set of attributes,
regardless of the attribute values?

On Wed, 3 Dec 2014 06:19 Atamert Ölçgen mu...@muhuk.com wrote:

 I don't feed trolls.

 On Wed, Dec 3, 2014 at 10:10 AM, Atamert Ölçgen mu...@muhuk.com wrote:

 Why are you using BigDecimal's for indices? If you want to go big, isn't
 BigInt a better choice?

 Actually, I would just use Long's. (MAX_VALUE = 9223372036854775807)

 On Wed, Dec 3, 2014 at 10:04 AM, Atamert Ölçgen mu...@muhuk.com wrote:

 This is a very nice example of abstraction. Using a hash-map is just an
 implementation detail.

 However I'd be very interested to hear if there are any other compelling
 use cases for this.


 Sparsely populated tables, unstructured anything... We used an EAV
 abstraction (over SQL) to build a product database. Different product types
 have very different fields, even same types of product might have different
 fields sometimes. In hindsight normalized relational tables would have been
 a better fit (the decision was made before I joined).

 In your README, the change and delete examples give the impression that
 they're mutating the db, but they actually return an updated db if I'm not
 mistaken.


 On Wed, Dec 3, 2014 at 6:37 AM, dan.stone16...@gmail.com wrote:

 I have put together a quick library http://github.com/danstone/silc
 that allows you to manage many entities and their attributes in a pure way
 with indexing for performance, include composite indexes.

 The intention of the library is certainly as the basis for an entity
 component system for games, that is how I am using it. However I'd be very
 interested to hear if there are any other compelling use cases for this.

 Pull requests welcome!

 Thanks,

 Dan

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




 --
 Kind Regards,
 Atamert Ölçgen

 -+-
 --+
 +++

 www.muhuk.com




 --
 Kind Regards,
 Atamert Ölçgen

 -+-
 --+
 +++

 www.muhuk.com




 --
 Kind Regards,
 Atamert Ölçgen

 -+-
 --+
 +++

 www.muhuk.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: snubbed on clojurescript one

2014-11-18 Thread Daniel Kersten
Pedestal App (the clojurescript frontend library) is dead. Server side
pedestal seems to be very much alive.

On Tue, 18 Nov 2014 19:19 Sean Corfield s...@corfield.org wrote:

 On Nov 18, 2014, at 10:57 AM, Ashton Kemerling ashtonkemerl...@gmail.com
 wrote:

 I thought the pedestal frontend is not being developed. I would recommend
 om, reagent, or dommy depending on what your goals are.


 The commit list makes Pedestal look pretty active:
 https://github.com/pedestal/pedestal/commits/master

 That said, Pedestal is a pretty complex beast although the documentation
 is massively improved lately:

 https://github.com/pedestal/pedestal/tree/master/guides/documentation

 As Ashton says tho’, it really depends on what your goals are. There’s a
 general mindset in the Clojure community to favor small, composable
 libraries over full stack frameworks - even tho’ there are a few full stack
 frameworks emerging nowadays (go look at
 https://github.com/caribou/caribou for example).

 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: Idiomatic way to return a single value from an async function

2014-11-11 Thread Daniel Kersten
You could do both:

Make the channel optional. If it's provided, use that and return it. If
it's not provided, create a new one and use and return that.

This way the caller gets to decide which they wish to use based on who the
owner of the channel should be or if the channel should be reused elsewhere.

For example, for a once-off call, creating s new channel may make more
sense but if the function is called frequently it might make more sense to
reuse one channel, especially if this channel is used with other plumbing
like pub/sub or mult which you would otherwise need to set up every time.

On Mon, 10 Nov 2014 17:42 Mike Haney txmikes...@gmail.com wrote:

 Eric Normand has an interesting article on this here:
 http://www.lispcast.com/core-async-code-style

 --
 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: [ClojureScript] ANN: Om 0.8.0-alpha1, Reference Cursors!

2014-10-18 Thread Daniel Kersten
Fantastic work, David! Thank you for all your hard work on Om!

This is definitely an exciting release and I look forward to playing with
it over the coming days. I'll be sure to report back on my experience with
it.

On 18 October 2014 16:53, David Nolen dnolen.li...@gmail.com wrote:

 I'm happy to announce the release of Om 0.8.0-alpha1. This release
 includes the single biggest conceptual enhancement since its initial
 release - Reference Cursors.

 As we begin to build larger and larger applications with Om, we
 often run afoul of the need to organize our application around a
 hierarchical tree. This is more problematic than in React itself as Om
 emphasizes a programming model that supports full snapshotting of the
 application state. This seemingly beneficial property actually
 exacerbates the hierachical issue and often leads to an incredible
 amount non-modular programming!

 The introduction of Reference Cursors allow Om programmers to stop
 thinking in terms of trees and return to a more natural mode of UI
 programming - simply calling out into shared APIs around application
 data precisely where you need it. No need to pass data through
 intermediate components on way to the target child component -
 Reference Cursors allow you to get at the data exactly where it is
 required and this without abandoning the ability to time travel over
 your application state.

 There are more thoughts and details here:
 https://github.com/swannodette/om/wiki/Advanced-Tutorial#reference-cursors

 Please give Reference Cursors a try in your application and send lots
 of feedback!

 This is an alpha release. No previous Om APIs should be affected,
 however the Reference Cursor feature is largely untested beyond
 a simple example in the repo.

 https://github.com/swannodette/om

 Cheers,
 David

 --
 Note that posts from new members are moderated - please be patient with
 your first post.
 ---
 You received this message because you are subscribed to the Google Groups
 ClojureScript group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to clojurescript+unsubscr...@googlegroups.com.
 To post to this group, send email to clojurescr...@googlegroups.com.
 Visit this group at http://groups.google.com/group/clojurescript.


-- 
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 this a reasonable use of core.async?

2014-09-18 Thread Daniel Kersten
I personally think Thomas' is best if load may vary as it is more
predictable and straightforward to understand. If we're talking about line
code, here's a shortened version that I don't feel sacrifices readability
(typed on a phone so please excuse typos...):

(let [exec (Executors newFixedThreadPool 4)
   results (- widgets
(mapv (fn [it] (.submit exec
#(long-running-widget-processor it
   (mapv #(.get %)))]
  (.shutdown exec)
  results)

I think the pure futures version kinda like what Gary suggested is best
though because it's straightforward, to the point, idiomatic and you
eliminate the need for core.async.

Having said that,  if you are already using core.async elsewhere in your
project then I don't see anything particularly wrong with your way.
 On 18 Sep 2014 06:41, Beau Fabry imf...@gmail.com wrote:

 Larry your solution includes the cognitive overhead of another entire
 library and process model. future is part of core, and as I realised when
 Gary posted the doall's were unnecessary anyway.

 On Thursday, September 18, 2014 3:26:36 PM UTC+10, larry google groups
 wrote:


  Thanks for that Larry but I think this is a bit of overkill for my
 scenario.

 If I'm counting correctly, your original example has 10 lines of code,
 and my example has 11 lines of code (minus the try/catch and the closure
 and the namespace declaration). So these 2 solutions are the same length.
 These are the 11 lines of code:

 (def ^:private persistence-channel (lamina/channel))

 (defn persist-this-item [context-wrapper-for-database-call]
   (lamina/enqueue persistence-channel
   (fn [] (persistence/make-consistent
 context-wrapper-for-database-call

 (defn worker []
   (loop [closure-with-item-inside @(lamina/read-channel
 persistence-channel)]
  (closure-with-item-inside)
 (recur @(lamina/read-channel persistence-channel

 (defn start-workers []
   (dotimes [_ 6]
 (future (worker

 Maybe its just that I'm familiar with the code, but these 11 lines of
 code seem cleaner to me than your 10 lines of code, at least in part
 because you are doing stuff like calling (doall) which strikes me as a bit
 suspicious.

 Do you really feel the 1 extra line of code is overkill? This solution
 seems to do what you want, and it's the same length as your solution.





 On Wednesday, September 17, 2014 8:48:09 PM UTC-4, Beau Fabry wrote:

 Thanks for that Larry but I think this is a bit of overkill for my
 scenario. The code I pasted is almost verbatim what we have in our
 production codebase, so the ability to queue new jobs etc is really not
 needed. Cheers though.

 On Thursday, September 18, 2014 9:38:47 AM UTC+10, larry google groups
 wrote:


  We don't have streams of data here, the long running tasks have
 side-effects. I would
  prefer to avoid adding another whole framework just to run a few long
 running jobs in p//.


 I guess I should show you some code, so you can see how simple this is.
 I'll copy-and-paste some code that I use.

 One simple way I use Lamina is to save stuff to a database. I don't
 want the save action happening in my main thread, so I put the data in a
 channel, and I let some workers pull that data off the channel and put it
 in the database. So what follows is the whole file, this about 30 lines of
 code, including some try/catch stuff that you probably don't need:

 (ns loupi.persistence-queue
   (:require
[loupi.persistence :as persistence]
[slingshot.slingshot :as ss]
[lamina.core :as lamina]))

 (def ^:private persistence-channel (lamina/channel))

 (defn persist-this-item [context-wrapper-for-database-call]
   (lamina/enqueue persistence-channel
   (fn []
 (ss/try+
  (persistence/make-consistent
 context-wrapper-for-database-call)
  (catch Object o (ss/throw+ {:type
 :loupi.supervisor/problem
  :message Error in
 persistence-queue/persist-this-itme.
  :data o}))

 (defn worker []
   (loop [closure-with-item-inside @(lamina/read-channel
 persistence-channel)]
 (ss/try+
  (closure-with-item-inside)
  (catch Object o (ss/throw+ {:type :loupi.supervisor/problem
  :message Error in
 persistence-queue/worker.
  :closure closure-with-item-inside
  :data o})))
 (recur @(lamina/read-channel persistence-channel

 (defn start-workers []
   (dotimes [_ 6]
 (println Starting up the persist queue workers.)
 (future (worker



 I call (start-workers) when the app starts. When I save something to
 the database, I call (persist-this-item) and I put a closure on the
 channel. The workers eventually grab that closure and execute it.

 Clearly, that closure can do whatever you like. To borrow from your
 original 

Re: [ANN] om-bootstrap 0.2.6 released

2014-09-18 Thread Daniel Kersten
In Om, a good place to put things that need render to have been called is
in IDidMount. You can get the DOM node for your component with (om/get-node
owner) or (om/get-node owner ref) if you want a sprcific node with a :ref
attribute set.
On 17 Sep 2014 22:06, Rostislav Svoboda rostislav.svob...@gmail.com
wrote:

 Concerning sortable tables, at the moment I do following (don't laugh):

 cp https://github.com/google/closure-library/blob/master/closure/goog/ui/
 tablesorter.js resources/public/js/out/goog/ui/

 index.html:
 html
 ...
 body
 div id=dbase0/div
 script src=http://fb.me/react-0.11.1.js;/script
 script src=js/out/goog/base.js type=text/javascript/script
 script src=js/main.js type=text/javascript/script
 script type=text/javascriptgoog.require(om_async
 .client);/script
 script type=text/javascriptgoog.require(goog.ui.TableSorter
 );/script
 ...
 /body
 /html

 client.cljs:
 (defn table-sorter [elem-id]
   (let [el (gdom/getElement elem-id)]
 (if (nil? el)
   (println (str ERROR: (gdom/getElement \ elem-id \) is nil))
   (let [component (TableSorter.)
 alphaSort goog.ui.TableSorter.alphaSort
 numericSort goog.ui.TableSorter.numericSort
 reverseSort (goog.ui.TableSorter.createReverseSort numericSort
 )]
 (.decorate component el)
 (.setSortFunction component 1 alphaSort)
 (.setSortFunction component 2 reverseSort)

 ...

 ;; pseudo code here:
 (dom/table #js {:id table-id :onMouseOver (fn [] (table-sorter table-id))}
(dom/thead nil
   (apply dom/tr nil
  (map #(dom/th nil %) table-header-values)))
(apply dom/tbody nil
   (apply dom/tr nil
  (map #(dom/td nil %) table-rows-values)))



 I.e. the table-sorter function makes my tables sortable but I have to
 postpone it's execution until the dom/table get's rendered.
 $(document).ready(..) and/or jayq.macros/ready don't work so I hack the
 meat with :onMouseOver

 I started to fight with sortable tables just a few hours ago so some more
 googling and/or your help might lead to better result.
 Thx in advance

 Bost


 On 17 September 2014 16:40, Daniel doubleagen...@gmail.com wrote:

 I could have said that in a slightly less vitriolic way.  Apologies.


 On Tuesday, September 16, 2014 8:45:37 AM UTC-5, Sam Ritchie wrote:

 I fully agree that with more features, the library would be useful to a
 larger range of folks :) Pull requests welcome, as always.

 I'm developing each component as needed as I convert paddleguru.com
 over to Om. The input components and basic tables, panels, buttons and
 navbars came first; the rest are on their way.

 My thought on open source is, document well and release early. There's
 no reason to keep all the existing stuff closed because the tables module
 isn't fully sexed out.

   Daniel doubleagen...@gmail.com
  September 16, 2014 at 7:17 AM
 Good work.  Although I hate to say it, It's of little use for most
 projects without more out-of-the-box table options eg searchable, sortable,
 paginated, never-ending.

 On Wednesday, August 27, 2014 2:05:27 PM UTC-5, Sam Ritchie wrote:
 --
 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.
   Sam Ritchie sritchi...@gmail.com
  August 27, 2014 at 1:05 PM
  This release adds a bunch of new active components - notably, dropdown
 buttons, split dropdown buttons and a navbar. The navbar allowed me to beef
 up the doc site with a proper navbar, more pages and client-side javascript
 navigation using Secretary and Html5 pushState:

 http://om-bootstrap.herokuapp.com

 Code:

 https://github.com/racehub/om-bootstrap

 Leiningen:

 [racehub/om-bootstrap 0.2.6]


 RELEASE NOTES:

 - Upgraded Clojurescript dependency on the doc site to get around this
 bug: http://dev.clojure.org/jira/browse/CLJS-839. Added a note.

 This hash code bug was causing `bs-class-set`'s internal lookup in
 `class-map` to sporadically fail in Safari 7.0.x.

 From https://github.com/racehub/om-bootstrap/pull/13:
 - `om-bootstrap.util/clone-with-props` can now clone proper om
 components by injecting extra attributes into the om cursor.
 - `:on-select` handlers on top level nav elements now get called if set,
 along with the current nav-item `:on-select` handlers

 ### New Components

 - `dropdown-mixin` (mixins.cljs)

Re: [ANN] om-bootstrap 0.2.6 released

2014-09-18 Thread Daniel Kersten
Forgot to add: IDidMount/did-mount only gets called after mounting.  If you
want to run code after later renders you can use IDidUpdate.
On 18 Sep 2014 09:16, Daniel Kersten dkers...@gmail.com wrote:

 In Om, a good place to put things that need render to have been called is
 in IDidMount. You can get the DOM node for your component with (om/get-node
 owner) or (om/get-node owner ref) if you want a sprcific node with a :ref
 attribute set.
 On 17 Sep 2014 22:06, Rostislav Svoboda rostislav.svob...@gmail.com
 wrote:

 Concerning sortable tables, at the moment I do following (don't laugh):

 cp https://github.com/google/closure-library/blob/master/closure/goog/ui/
 tablesorter.js resources/public/js/out/goog/ui/

 index.html:
 html
 ...
 body
 div id=dbase0/div
 script src=http://fb.me/react-0.11.1.js;/script
 script src=js/out/goog/base.js type=text/javascript
 /script
 script src=js/main.js type=text/javascript/script
 script type=text/javascriptgoog.require(om_async
 .client);/script
 script type=text/javascriptgoog.require(goog.ui.TableSorter
 );/script
 ...
 /body
 /html

 client.cljs:
 (defn table-sorter [elem-id]
   (let [el (gdom/getElement elem-id)]
 (if (nil? el)
   (println (str ERROR: (gdom/getElement \ elem-id \) is nil))
   (let [component (TableSorter.)
 alphaSort goog.ui.TableSorter.alphaSort
 numericSort goog.ui.TableSorter.numericSort
 reverseSort (goog.ui.TableSorter.createReverseSort
 numericSort)]
 (.decorate component el)
 (.setSortFunction component 1 alphaSort)
 (.setSortFunction component 2 reverseSort)

 ...

 ;; pseudo code here:
 (dom/table #js {:id table-id :onMouseOver (fn [] (table-sorter
 table-id))}
(dom/thead nil
   (apply dom/tr nil
  (map #(dom/th nil %) table-header-values)))
(apply dom/tbody nil
   (apply dom/tr nil
  (map #(dom/td nil %) table-rows-values)))



 I.e. the table-sorter function makes my tables sortable but I have to
 postpone it's execution until the dom/table get's rendered.
 $(document).ready(..) and/or jayq.macros/ready don't work so I hack the
 meat with :onMouseOver

 I started to fight with sortable tables just a few hours ago so some more
 googling and/or your help might lead to better result.
 Thx in advance

 Bost


 On 17 September 2014 16:40, Daniel doubleagen...@gmail.com wrote:

 I could have said that in a slightly less vitriolic way.  Apologies.


 On Tuesday, September 16, 2014 8:45:37 AM UTC-5, Sam Ritchie wrote:

 I fully agree that with more features, the library would be useful to a
 larger range of folks :) Pull requests welcome, as always.

 I'm developing each component as needed as I convert paddleguru.com
 over to Om. The input components and basic tables, panels, buttons and
 navbars came first; the rest are on their way.

 My thought on open source is, document well and release early. There's
 no reason to keep all the existing stuff closed because the tables module
 isn't fully sexed out.

   Daniel doubleagen...@gmail.com
  September 16, 2014 at 7:17 AM
 Good work.  Although I hate to say it, It's of little use for most
 projects without more out-of-the-box table options eg searchable, sortable,
 paginated, never-ending.

 On Wednesday, August 27, 2014 2:05:27 PM UTC-5, Sam Ritchie wrote:
 --
 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.
   Sam Ritchie sritchi...@gmail.com
  August 27, 2014 at 1:05 PM
  This release adds a bunch of new active components - notably,
 dropdown buttons, split dropdown buttons and a navbar. The navbar allowed
 me to beef up the doc site with a proper navbar, more pages and client-side
 javascript navigation using Secretary and Html5 pushState:

 http://om-bootstrap.herokuapp.com

 Code:

 https://github.com/racehub/om-bootstrap

 Leiningen:

 [racehub/om-bootstrap 0.2.6]


 RELEASE NOTES:

 - Upgraded Clojurescript dependency on the doc site to get around this
 bug: http://dev.clojure.org/jira/browse/CLJS-839. Added a note.

 This hash code bug was causing `bs-class-set`'s internal lookup in
 `class-map` to sporadically fail in Safari 7.0.x.

 From https://github.com/racehub/om-bootstrap/pull/13:
 - `om-bootstrap.util/clone-with-props` can now clone proper om
 components by injecting extra

Re: [ANN] Clojure 1.7.0-alpha2

2014-09-10 Thread Daniel Kersten
I've also been explaining them the same way as Mark.

On 10 September 2014 17:28, Plínio Balduino pbaldu...@gmail.com wrote:

 That's also my explanation about the use of exclamation mark.

 IMHO, +1 for volatile, without !.

 Plínio

 On Wed, Sep 10, 2014 at 1:05 PM, Mark Engelberg mark.engelb...@gmail.com
 wrote:

 When I explain to new Clojurists what the ! means, I explain that it
 calls attention to a mutation function that is unsafe to call inside a
 transaction.  Many programmers coming from Scheme are used to thinking of !
 as meaning *anything* involving mutation, but that's not the case in the
 Clojure.  This more subtle distinction (that it needs to be unsafe in a
 transaction) clarifies why swap! has an exclamation point, but ref-set does
 not, even though both involve mutation.

 Assuming my description of Clojure's use of ! is correct (and if I'm
 wrong and am not thinking of some important counterexample, please let me
 know), then it doesn't really make sense for volatile to be called
 volatile!.  Yes, volatiles are less safe than atoms, but the creation of
 the volatile itself is perfectly fine to occur in a transation.  Only
 vswap! and vreset! require the exclamation point.

 I'd go one step further and question why we need new names vswap! and
 vreset!, when swap! and reset! are perfectly clear and sufficient.  As
 Clojure has become increasingly interface and protocol-driven, it makes
 less and less sense to have a proliferation of function names for the same
 behavior on different underlying objects.  vswap!, for example, is exactly
 the semantics you'd expect if you overloaded swap!, describing it as a
 function that can be applied to both atoms and volatiles, where volatiles
 are the more thread-unsafe, less atomic, alternative, because that's the
 nature of the underlying box.

 --Mark

 --
 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: Sente - is it possible to close a connection?

2014-08-25 Thread Daniel Kersten
Hi Peter,

Thanks for chiming in. Actually I missread the code since chsk/close is
handled on the client, but if course it is sent from the server, which is
what I want. Thanks for clarifying. I don't mind it reconnecting (in fact,
it's desirable for what I want).

Basically what I want to achieve is this:
Connections get load balanced between servers
If a server goes down, the connection is dropped, sente automatically
reconnects, the new connection is load balanced to a live server This all
works out of the box.

The case I wanted to solve is: since connections are sticky while they are
live, if a server is under heavy load and wants to hand some connections to
another server, it needs to force the client to reconnect so it can get
load balanced again. Both techniques mentioned above work for this, but
since chsk/close is server sent, tha is perfect.

So no rush on disconnect :-)

Re: chsk/close potentially being removed in the future,  perhaps a
reconnect! (I can't think of a use case for the server telling a client
that it's done with comms, definitely seems to be the clients job - it
could ignore the server anyway and open a new connection) function can be
added to the server that simply sends that event. This way if the event is
later removed, this function can be updated and nobodies code will break.

Since its a one-liner I can totally write it for you if you like ;-)

Thanks again (to both of you) and thanks Peter for a wonderful library.
On 25 Aug 2014 07:33, Peter Taoussanis ptaoussa...@gmail.com wrote:

 Hi guys,

  (sente/chsk-reconnect! my-chsk) to disconnect (and then reconnect) a
 connection.

 Yup, you can call `chsk-reconnect!` from the client to reset its
 connections. This is useful mostly for picking up possible session changes
 after authentication, etc.

 There isn't currently a client-side `disconnect!` fn, but it'd be trivial
 to add (GitHub issue/PR welcome).


  I think you can send :chsk/close:

 Yeah, Sam's right (thanks Sam!). The server can send a `[:chsk/close]`
 event to a user-id to have all of those user's connections terminated. If
 any clients are still active though, they'll just automatically attempt to
 reconnect again.

 You'd normally send this event during the server's normal procedure to
 logout+cleanup a user.


  It seems that both chsk-reconnect! and :chsk/close events will let the
 client control its connection state, but there doesn't seem to be any way
 for the server to do so.

 Note that the `[:chsk/close]` special event is issued from the server, not
 the client. Reason it isn't documented yet is that it's still subject to
 change and may actually be dropped in future. Any change to the current
 behaviour will be listed in the CHANGELOG though.


  Still, I'd like the server to be able to sever connections, although its
 not a big deal since I can have the server send an event to tell the client
 to do so.

 Sure. One minor clarification: Sente intentionally decouples the notion of
 connection status and intention. It'll never assume that a dropped
 connection is _intentional_ - so it'll always try to recover.

 Connections come and go. It's the (higher-level) channel socket that you
 must close to convey that you're done with all comms and don't want any
 more connections. The (higher-level) channel socket can only be closed
 intentionally, it won't ever close due to changing network conditions, etc.

 Clients can indicate that they're done with all comms with a
 `(chsk/disconnect! client-chsk)` call.

 To do this from the server's end, the server may send some notification
 event to a user's clients - and those clients may choose to honour the
 termination request with `(chsk/disconnect! client-chsk)` calls.

 Does that make sense?

 So it sounds like the client-side `disconnect!` fn is what you want. Again
 - issues/PR welcome! Otherwise will try get this in by Wednesday, just busy
 juggling some urgent tasks.

 Cheers! :-)

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

Sente - is it possible to close a connection?

2014-08-24 Thread Daniel Kersten
Hi,

I'm trying programmatically close a connected sente connection (either on
the server or the client).

Is this possible?

Thanks,
Dan.

-- 
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: Sente - is it possible to close a connection?

2014-08-24 Thread Daniel Kersten
After some more digging[1], I see that the client can call
(sente/chsk-reconnect!
my-chsk) to disconnect (and then reconnect) a connection.
Looking at the comments in the code[2], it does this by closing the socket
and then it gets auto-reconnected. I guess that means its not possible to
disconnect without automatically reconnecting, but for now this behaviour
is sufficient for me.

Hopefully this is useful to others, as I don't see chsk-reconnect!
documented anywhere.

[1] https://github.com/ptaoussanis/sente/issues/63 and
https://github.com/ptaoussanis/sente/blob/93a8660b23c001cb50701f80f78d9a86fd4f5433/src/taoensso/sente.cljx#L555
[2]
https://github.com/ptaoussanis/sente/blob/93a8660b23c001cb50701f80f78d9a86fd4f5433/src/taoensso/sente.cljx#L632
and
https://github.com/ptaoussanis/sente/blob/93a8660b23c001cb50701f80f78d9a86fd4f5433/src/taoensso/sente.cljx#L732


On 24 August 2014 18:06, Daniel Kersten dkers...@gmail.com wrote:

 Hi,

 I'm trying programmatically close a connected sente connection (either on
 the server or the client).

 Is this possible?

 Thanks,
 Dan.


-- 
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: Sente - is it possible to close a connection?

2014-08-24 Thread Daniel Kersten
Interesting, thanks!

I actually looked for something like that but seem to have overlooked it. I
saw :chsk/closed but not :chsk/close

It seems that both chsk-reconnect! and :chsk/close events will let the
client control its connection state, but there doesn't seem to be any way
for the server to do so. I guess this makes sense, since the client is the
one doing the connecting. Still, I'd like the server to be able to sever
connections, although its not a big deal since I can have the server send
an event to tell the client to do so.


On 24 August 2014 22:40, Sam Ritchie sritchi...@gmail.com wrote:

 I think you can send :chsk/close:


 https://github.com/ptaoussanis/sente/blob/master/src/taoensso/sente.cljx#L335

 This doesn't look documented either, but according to the code it'll do
 the trick.

   Daniel Kersten dkers...@gmail.com
  August 24, 2014 at 11:30 AM
 After some more digging[1], I see that the client can call 
 (sente/chsk-reconnect!
 my-chsk) to disconnect (and then reconnect) a connection.
 Looking at the comments in the code[2], it does this by closing the socket
 and then it gets auto-reconnected. I guess that means its not possible to
 disconnect without automatically reconnecting, but for now this behaviour
 is sufficient for me.

 Hopefully this is useful to others, as I don't see chsk-reconnect!
 documented anywhere.

 [1] https://github.com/ptaoussanis/sente/issues/63 and
 https://github.com/ptaoussanis/sente/blob/93a8660b23c001cb50701f80f78d9a86fd4f5433/src/taoensso/sente.cljx#L555
 [2]
 https://github.com/ptaoussanis/sente/blob/93a8660b23c001cb50701f80f78d9a86fd4f5433/src/taoensso/sente.cljx#L632
 and
 https://github.com/ptaoussanis/sente/blob/93a8660b23c001cb50701f80f78d9a86fd4f5433/src/taoensso/sente.cljx#L732



 --
 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.
   Daniel Kersten dkers...@gmail.com
  August 24, 2014 at 11:06 AM
 Hi,

 I'm trying programmatically close a connected sente connection (either on
 the server or the client).

 Is this possible?

 Thanks,
 Dan.
 --
 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.


 --
 Sam Ritchie (@sritchie)
  Paddleguru Co-Founder
 703.863.8561
 www.paddleguru.com
 Twitter http://twitter.com/paddleguru // Facebook
 http://facebook.com/paddleguru

 --
 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: [ClojureScript] Re: ANN: Om 0.7.0

2014-08-01 Thread Daniel Kersten
That's awesome, thank you for the amazing work, David!

Are there any plans to merge the ind-components branch into master any time
soonish?


On 1 August 2014 21:29, David Nolen dnolen.li...@gmail.com wrote:

 Thanks for the correction, fixed!

 On Fri, Aug 1, 2014 at 4:26 PM, Rostislav Svoboda
 rostislav.svob...@gmail.com wrote:
  Thanx a lot guys!
 
  The biggest change is depending on ClojureScript 0.0-2277 and
 
  BTW the Using it section of README.md still says 0.0-2173:
 
  (defproject foo 0.1.0
...
:dependencies [[org.clojure/clojure 1.5.1]
   [org.clojure/clojurescript 0.0-2173]
   [om 0.7.0]]
...)
 
  --
  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.

 --
 Note that posts from new members are moderated - please be patient with
 your first post.
 ---
 You received this message because you are subscribed to the Google Groups
 ClojureScript group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to clojurescript+unsubscr...@googlegroups.com.
 To post to this group, send email to clojurescr...@googlegroups.com.
 Visit this group at http://groups.google.com/group/clojurescript.


-- 
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: Help Getting Sente to Work

2014-07-31 Thread Daniel Kersten
Hi Timothy, I just wanted to note that you can control the port Austin uses
through environment variables. I do this so I can port forward, for example.

This probably won't help you though, as httpkit and the browser repl can't
run on the same port.
On 30 Jul 2014 16:24, Timothy Washington twash...@gmail.com wrote:

 Hey Peter,

 Responses are inlined.


 On Tue, Jul 29, 2014 at 12:51 AM, Peter Taoussanis ptaoussa...@gmail.com
 wrote:

 Wrt the CSRF issue, I'll try running again without it.


 Out of curiosity, sure - but if you've already gone to the effort of
 setting up the CSRF I'd leave it in (better to have it) :-)


 Yep, I agree ;)




 Now, a port changed fixed the issue for me. But before I passed in a
 *chsk-url-fn*, I was still getting a 404, even when trying with a
 browser (ie, using the correct port).


 Not sure about that, may be that something in your setup is tripping up
 the default `chsk-url-fn`. Would appreciate a GitHub issue on it and I'll
 take a closer look - may be a bug.


 Ok, new github issues is here
 https://github.com/ptaoussanis/sente/issues/58.



 That 404 went away when I included the CSRF middleware. I still had to
 pass in a custom *chsk-url-fn*, but I could use it through the browser,
 for example.


 My guess is that the 404 is going away because you're passing in a custom
 `chsk-url-fn`, not because of the CSRF middleware. I.e. it's a broken chsk
 url that's causing the 404, not anything to do with the CSRF.


 Actually, that 404 did go away when I included the CSRF middleware. And
 that's weird, I'll admit, because the webserver was not running on 
 *ws://172.28.128.5:58269/chsk
 http://172.28.128.5:58269/chsk*.

 However, I was still experiencing the broken chsk channel. That's when I
 included the custom *chsk-url-fn*. The tricky thing, I think, is that the
 browser-repl uses a different port (i default browser-repl is 9000, ii.
 austin's browser-repl port changes each session), than the running http-kit
 server (8090). So when *make-channel-socket!* calls chsk-url-fn
 https://github.com/ptaoussanis/sente/blob/65fcf8d9be14bfc69a7798b5c159780d1d2a3804/src/taoensso/sente.cljx#L850
 (which is the *default-chsk-url-fn*), (encore/get-window-location)
 https://github.com/ptaoussanis/sente/blob/65fcf8d9be14bfc69a7798b5c159780d1d2a3804/src/taoensso/sente.cljx#L843
  is
 returning the URL with the browser-repl's port. I'm not sure how you'd get
 around that if you're using a browser-repl, vs just running in a plain
 browser runtime. Seems to come down to the behaviour of (.-location
 js/window)
 https://github.com/ptaoussanis/encore/blob/master/src/taoensso/encore.cljx#L1187
  (in
 *encore/get-window-location*). Ie, in my browser-repl, invoking `*(.-location
 js/window)*` gives me http://*172.28.128.5:33283/347
 http://172.28.128.5:33283/347*/repl/start?..., (not 
 http://*172.28.128.5:8090
 http://172.28.128.5:8090*/...).

 cljs.user (.-location js/window)




 #
 http://172.28.128.5:33283/347/repl/start?xpc=%7B%22cn%22%3A%222qJDPo7hur%22%2C%22tp%22%3Anull%2C%22osh%22%3Anull%2C%22ppu%22%3A%22http%3A%2F%2F172.28.128.5%3A8090%2Frobots.txt%22%2C%22lpu%22%3A%22http%3A%2F%2F172.28.128.5%3A33
 \

 283%2Frobots.txt%22%7D




 And I'm just grokking the false `*websocket?`* allowance now. Ie, an
 https ajax connection would give me a sente URL of 
 *wws://172.28.128.5:8090/chsk
 http://172.28.128.5:8090/chsk*. Is that right? What about plain http?


 The `chsk-url-fn` will be called with:
 1. The path as given to the client-side `make-channel-socket!` fn (usu.
 /chsk).
 2. A window location map of the current page.
 3. A bool indicating whether Sente is requesting a WebSocket (true) or
 Ajax (false) connection.

 From these, your fn will need to produce an URL that matches your
 server-side channel socket route.

 For WebSocket connections you'll want the URL to start with ws://
 (insecure) or wss:// (secure).
 For Ajax connections you'll want the URL to start with http://;
 (insecure) or https://; (secure).

 I wouldn't stress too much about that though - let's start with a GitHub
 issue since it's quite possible I can mod the default fn to cover your
 use-case automatically. Ideally you shouldn't need to fiddle with any of
 this :-)

 Cheers!


 Nice one - thanks Peter.


 Tim Washington
 Interruptsoftware.com http://interruptsoftware.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 

Re: Is this behavior with recur and pre/post a bug?

2014-07-26 Thread Daniel Kersten
The intuitive behaviour (to me) would be that :pre is applied to every
recur as stated and post is applied only to the eventually returned value
and this *_should_ *be considered a bug. My logic is as follows:


   1. A (pure, for simplicity of this argument) function, in the absence of
   erroneous inputs or bugs, should behave the exact same with and without
   pre/post conditions.
   2. The function body should be the same with and without pre/post
   conditions. That is I expect to be able to take any function and add
   pre/post conditions - given #1 above, there shouldn't be any difference
   except that the version with conditions will throw an exception when bad
   inputs/outputs are detected. That is, I think of pre/post conditions like I
   think of logging.
   3. Pre conditions should be applied to the function inputs whenever the
   function is given inputs - since recur essentially calls the function
   again, pre conditions should therefore be applied to each recur.
   4. Post conditions should be applied to the function return value. Since
   recur doesn't really return anything (and is working on intermediary
   possibly incomplete state anyway), post conditions should be applied only
   to the final returned value.

The reason I consider this a bug is because it violates 1, 2 and 3. Not
considering it a bug because of implementation details is, IMHO, not the
right approach, even if the patch never gets accepted and this never gets
fixed.

That's my opinion anyway, hopefully its useful in some way.


On 25 July 2014 23:37, Ambrose Bonnaire-Sergeant 
abonnaireserge...@gmail.com wrote:

 Yes :pre should apply to every recur, like usual without :post.

 user= ((fn [a] {:pre [(number? a)]} (recur 'a)) 1)
 AssertionError Assert failed: (number? a)  user/eval5376/fn--5377
 (form-init687485383035947214.clj:1)

 That probably means that if :post is present, the preconditions should be
 moved inside the inner loop instead.

 I can see how destructuring makes this a little tricky.

 Thanks,
 Ambrose


 On Sat, Jul 26, 2014 at 6:27 AM, Steve Miner stevemi...@gmail.com wrote:

 My first patch was buggy with destructured args so I had to withdraw it.

 While working on a better patch, I came up against a related issue:
 Should the :pre conditions apply to every recur call. I'm saying no.  The
 :pre conditions should be checked just once on the initial function call
 and never during a recur. Any other opinions?

 On Jul 25, 2014, at 10:57 AM, Steve Miner stevemi...@gmail.com wrote:

  Ticket CLJ-1475 with my patch.
 
  http://dev.clojure.org/jira/browse/CLJ-1475

 --
 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: Help Getting Sente to Work

2014-07-26 Thread Daniel Kersten
Speaking of CSRF, I have a slightly different setup from the Sente examples
where I use sente for all my communication after the initial load, whereas
the Sente examples use normal HTTP to perform logins and only use Sente
after login. This way the login request can set the client-id and CSRF
token. In my setup I can't do this because I do all requests over Sente
(and my html/js files are served by a static web server, so I can't set it
from those requests either).

What I do to get around this is have a script src=/init before my
clojurescript js and the /init route sets up the client-id token and
returns var csrf_token =  Then on the client I can pass the token to
sente as js/csrf_token.

I left this out in my previous mail because I thought it wasn't relevant
and wanted to keep the code simple, but I guess it might be useful after
all if you are doing something similar to what I'm doing.

Btw, as far as I can remember, sente has an option to turn CSRF off - at
least, I've used it without CSRF. Obviously you should only do that during
development :)


On 26 July 2014 12:50, Bob Hutchison hutch-li...@recursive.ca wrote:


 Hi Tim,

 I think I went through this when I was first starting with Sente. You need
 to setup the CSRF handling part, in the example code by including
 ring-anti-forgery/wrap-anti-forgery in your routes. *AND* you have to make
 sure that you are using one of those routes before you try to use Sente’s
 connection stuff, otherwise your session won’t have certain critical
 attributes set (e.g. __anti-forgery-token). I think the 404s are from the
 anti-forgery stuff rejecting your request. And I think Sente is assuming
 it’s setup. This was a while ago so maybe I’m not remembering it quite
 right.

 Cheers,
 Bob

 On Jul 26, 2014, at 12:33 AM, Timothy Washington twash...@gmail.com
 wrote:

 Hi all,

 I'm using [com.taoensso/sente 0.15.1
 https://github.com/ptaoussanis/sente], and having trouble connecting
 the client to the server. I'm sure it's something simple, but not obvious,
 as this is taken directly from the examples on sente's github page. Anyone
 seen and fixed the error in fig.1? The clojurescript and clojure code are
 in fig 2 and 3 respectively.


 WebSocket connection to 'ws://172.28.128.5:58269/chsk' failed: Error
 during WebSocket handshake: Unexpected response code: 404
  WebSocket error: [object Event] VM1707:1689
  Chsk is closed: will try reconnect (8). VM1707:1689

 fig.1 - Chrome network error message

 (ns my.ns
   (:require-macros
[cljs.core.match.macros :refer (match)] ; Optional, useful
[cljs.core.async.macros :as asyncm :refer (go go-loop)])
   (:require
;;[clojure.browser.repl :as repl]
[cljs.core.match] ; Optional, useful
[cljs.core.async :as async :refer (! ! put! chan)]
[taoensso.sente :as sente :refer (cb-success?)]))


 (let [{:keys [chsk ch-recv send-fn state]}
   (sente/make-channel-socket! /chsk {:type :auto})]

   (def chsk   chsk)
   (def ch-chskch-recv)
   (def chsk-send! send-fn)
   (def chsk-state state))

 (defn one []
   (chsk-send! [:some/request-id {:name Rich Hickey :type Awesome}]))


 *fig.2 - my.cljs *


 (ns my.http.ns
   (:require [compojure.core :refer :all]
 ...

 ;; Sente stuff
 [clojure.core.match :as match :refer (match)] ; Optional,
 useful
 [clojure.core.async :as async :refer (! !! ! !! put! chan
 go go-loop)]
 [taoensso.sente :as sente]))


 (let [{:keys [ch-recv send-fn ajax-post-fn ajax-get-or-ws-handshake-fn]}
   (sente/make-channel-socket! {})]

   (def ring-ajax-postajax-post-fn)
   (def ring-ajax-get-or-ws-handshake ajax-get-or-ws-handshake-fn)
   (def ch-chsk   ch-recv)
   (def chsk-send!send-fn))

 ...

 (defn create-approutes [project-config browserrepl]

   (defroutes app-routes

 ;; Sente stuff
 (GET  /chsk req (ring-ajax-get-or-ws-handshake req)) ; tried both
 ring-ajax-get-or-ws-handshake and *#'*ring-ajax-get-or-ws-handshake
 (POST /chsk req (ring-ajax-postreq)); same
 here for trying both


 (GET / []
  (- (ring-resp/response (with-browser-repl index.html
 browserrepl))
  (ring-resp/content-type text/html)))

 (route/resources / {:root resources/public/})
 (route/not-found Not Found)))

 *fig.3 - my.clj *


 Tim Washington
 Interruptsoftware.com http://interruptsoftware.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 

Re: subtle om + core.async problems

2014-07-25 Thread Daniel Kersten
You could simplify your fix code a small bit by using go-loop and when,
like this:

(go-loop []
  (let [[v ch] (alts! [dump-chan (om/get-state owner :exit-chan)])]
(when (= ch dump-chan)
  (.log js/console dumping state:)
  (.log js/console (pr-str (om/get-state owner)))
  (recur

This won't work in your code because my-form's parent owns dump-chan, but
if a component owns the channel, an alternative approach is to simply close
dump-chan in IWillUnmount and change your go block to something like this:

(go-loop []
  (when-let [v (! dump-chan)]
(.log js/console dumping state:)
(.log js/console (pr-str (om/get-state owner)))
(recur)))

In my own code, I've abstracted my go blocks into om-tools mixins that
handle the killing of go blocks.

I'm not sure why the second problem happens. As a general rule, I never
create new resources in render (IMO render should be pure functional: app
state and local state in - new dom nodes out; but as the child stores the
channel between calls to parents render, this breaks that rule) and I've
never had the issue.
Since base isn't being re-rendered in this case, I'm not sure why this
would be a problem here.



On 24 July 2014 02:35, Sean Corfield s...@corfield.org wrote:

 You'll want to read this thread:
 https://groups.google.com/forum/#!topic/clojurescript/DHJvcGey8Sc

 In particular:

 So if you have code that's like this, those components will want to clean
 up after themselves in IWillUnmount.

 That should address your first problem?

 I'm not sure what to suggest right now about the second problem.

 Sean


 On Jul 23, 2014, at 4:19 PM, Alexander Hudek alexan...@hudek.org wrote:

 I've encountered two subtle but serious problems using om with core.async.

 The first one is illustrated by this code:

 https://github.com/akhudek/om-async-error

 First, one obvious solution here is to move the dump-chan inside the form
 state.
 However, it's written this way to illustrate the error which originally
 arose in a
 dialog component that took both an action channel that receives button
 presses
 and a dialog content component. It exposed the action channel in this way
 in
 order to be flexible.

 I believe the cause of this error is that when you toggle the form in the
 demo
 to off, it unmounts the component. However, the go-block is still active
 and
 listening to the channel. When you toggle the form back on, a new component
 is created and mounted. Now you have two components listening on the same
 channel!

 The ideal solution might be to find a way to end the go block when the
 component
 unmounts. This is easy to do on a case by case basis, but not easy to do
 in a
 completely generic fashion. Here is one solution:


 https://github.com/akhudek/om-async-error/blob/alts-fix/src/om_async_error/core.cljs

 The second problem is easy to fix, however, I don't understand why it
 happens.

 https://github.com/akhudek/om-async-error/tree/chan-opts-bug

 Instead of initializing the dump channel in the base components state, we
 initialize
 it when creating the form component. As soon as you start typing into the
 form
 the channel breaks. It was suggested on irc that this might be because of
 a
 re-render of base would create a new channel, but the form component will
 not
 be re-mounted because it's already mounted. However, putting in some debug
 code shows that there is no re-render of the base component occurring
 between
 when the channel works and when it doesn't.

 I'm posting this here mostly to warn people to be wary of these
 situations. Of
 course, if you have any suggestions or explanations for these I'd love to
 hear them.

 Alex





-- 
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: subtle om + core.async problems

2014-07-25 Thread Daniel Kersten
The way I use mixins is really simple and might be a bit too specific to
how I currently use channels I plan to explore the idea more, but haven't
had the time yet. I'm sure you can build much more sophisticated
abstractions.

I don't have the code in front of me right now, but the basic idea is as
follows: Before om-tools, I had a subscribe function that wrapped
core.async/sub. You pass it a keyword topic, owner and a function that
takes the value as its argument. All messages on the channel take the form
[topic value]. I also had a matching unsubscribe function that took owner
and killed the go blocks created by all subscribe calls in that component.
The problem I had was that it was very easy to forgot to call unsubscribe
in IWillUnmount (plus the extra boilerplate was a bit annoying). So I wrote
a mixin that looks something like this:

(defmixin subscriber
  (will-unmount [owner]
(my-unsubscribe owner))
  (subscribe [owner topic callback]
(my-subscribe owner topic callback)))

Which can then be used like this:

(defcomponentk a-component [owner]
  (:mixins subscriber)
  (did-mount [_]
(.subscribe owner :foo (fn [v] ...)))
  (render [_]
...))


For your purposes, perhaps something like this would work:

(defmixin go-block-aware
  (init-state []
{:exit-chan (async/chan)})
  (will-unmount [owner]
   (async/put! (om/get-state owner :exit-chan) true))

  (go [owner callback]
(let [exit-chan (om/get-state owner :exit-chan)]
  (go-loop []
(let [[v ch] (async/alts! [dump-chan exit-chan])]
  (when (= ch dump-chan)
(callback v)
(recur)))

And use like this:

(defcomponentk a-component [owner]
  (:mixins go-block-aware)
  (did-mount [_]
(.go owner (fn [v] ...)))
  (render [_]
...))







On 25 July 2014 19:12, Alexander K. Hudek alexan...@hudek.org wrote:

 Could you describe your mixin a bit more? We’ve just written an om
 component and macro to help clean up go-blocks in cases like these. Several
 of our components take channels as input from parent components to allow
 for more sophisticated communication. We’ll post a link to this manager
 component today or tomorrow after we add some documentation.

 Regarding the second problem, we don’t typically do that either. I was
 just being lazy when writing the error demo and ran into. Curious
 behaviour, but easy to avoid the problem.


 From: Daniel Kersten dkers...@gmail.com dkers...@gmail.com
 Reply: clojure@googlegroups.com clojure@googlegroups.com
 clojure@googlegroups.com
 Date: July 25, 2014 at 5:26:56 AM
 To: clojure@googlegroups.com clojure@googlegroups.com
 clojure@googlegroups.com
 Subject:  Re: subtle om + core.async problems

  You could simplify your fix code a small bit by using go-loop and when,
 like this:

  (go-loop []
   (let [[v ch] (alts! [dump-chan (om/get-state owner :exit-chan)])]
 (when (= ch dump-chan)
   (.log js/console dumping state:)
   (.log js/console (pr-str (om/get-state owner)))
   (recur

 This won't work in your code because my-form's parent owns dump-chan, but
 if a component owns the channel, an alternative approach is to simply close
 dump-chan in IWillUnmount and change your go block to something like this:

 (go-loop []
   (when-let [v (! dump-chan)]
 (.log js/console dumping state:)
 (.log js/console (pr-str (om/get-state owner)))
 (recur)))

 In my own code, I've abstracted my go blocks into om-tools mixins that
 handle the killing of go blocks.

 I'm not sure why the second problem happens. As a general rule, I never
 create new resources in render (IMO render should be pure functional: app
 state and local state in - new dom nodes out; but as the child stores the
 channel between calls to parents render, this breaks that rule) and I've
 never had the issue.
 Since base isn't being re-rendered in this case, I'm not sure why this
 would be a problem here.



 On 24 July 2014 02:35, Sean Corfield s...@corfield.org wrote:

 You'll want to read this thread:
 https://groups.google.com/forum/#!topic/clojurescript/DHJvcGey8Sc

 In particular:

 So if you have code that's like this, those components will want to
 clean up after themselves in IWillUnmount.

 That should address your first problem?

 I'm not sure what to suggest right now about the second problem.

 Sean


 On Jul 23, 2014, at 4:19 PM, Alexander Hudek alexan...@hudek.org wrote:

 I've encountered two subtle but serious problems using om with
 core.async.

 The first one is illustrated by this code:

 https://github.com/akhudek/om-async-error

 First, one obvious solution here is to move the dump-chan inside the form
 state.
 However, it's written this way to illustrate the error which originally
 arose in a
 dialog component that took both an action channel that receives button
 presses
 and a dialog content component. It exposed the action channel in this way
 in
 order to be flexible.

 I believe the cause of this error is that when you toggle

Re: Help Getting Sente to Work

2014-07-25 Thread Daniel Kersten
My server looks like this and its been working for me for the past few
months without issue:

(defroutes ws-routes
  (GET  /cmd/chsk req (ring-ajax-get-or-ws-handshake req))
  (POST /cmd/chsk req (ring-ajax-postreq)))





(defn run

  [ [routes]]

  (let [site  (http-handler/site (compojure/routes ws-routes routes))
webserver (httpkit/run-server site {:port 3002})
{:keys [ch-recv send-fn ajax-post-fn ajax-get-or-ws-handshake-fn
connected-uids]} (sente/make-channel-socket! {})]
(def ring-ajax-postajax-post-fn)
(def ring-ajax-get-or-ws-handshake ajax-get-or-ws-handshake-fn)
(def ch-chsk   ch-recv) ; ChannelSocket's
receive channel
(def chsk-send!send-fn) ; ChannelSocket's send API fn
(def connected-uidsconnected-uids) ; Watchable,
read-only atom
(def server webserver)
(sente/start-chsk-router-loop! sente-message-router ch-chsk)
webserver))



Where sente-message-router is a function that receives messages from the
client.

In my actual codebase, there is a little more additional code for setting
up client-id's and CSRF tokens too.

On 26 July 2014 05:33, Timothy Washington twash...@gmail.com wrote:

 Hi all,

 I'm using [com.taoensso/sente 0.15.1
 https://github.com/ptaoussanis/sente], and having trouble connecting
 the client to the server. I'm sure it's something simple, but not obvious,
 as this is taken directly from the examples on sente's github page. Anyone
 seen and fixed the error in fig.1? The clojurescript and clojure code are
 in fig 2 and 3 respectively.


 WebSocket connection to 'ws://172.28.128.5:58269/chsk' failed: Error
 during WebSocket handshake: Unexpected response code: 404
  WebSocket error: [object Event] VM1707:1689
  Chsk is closed: will try reconnect (8). VM1707:1689

 fig.1 - Chrome network error message

 (ns my.ns
   (:require-macros
[cljs.core.match.macros :refer (match)] ; Optional, useful
[cljs.core.async.macros :as asyncm :refer (go go-loop)])
   (:require
;;[clojure.browser.repl :as repl]
[cljs.core.match] ; Optional, useful
[cljs.core.async :as async :refer (! ! put! chan)]
[taoensso.sente :as sente :refer (cb-success?)]))


 (let [{:keys [chsk ch-recv send-fn state]}
   (sente/make-channel-socket! /chsk {:type :auto})]

   (def chsk   chsk)
   (def ch-chskch-recv)
   (def chsk-send! send-fn)
   (def chsk-state state))

 (defn one []
   (chsk-send! [:some/request-id {:name Rich Hickey :type Awesome}]))


 *fig.2 - my.cljs *


 (ns my.http.ns
   (:require [compojure.core :refer :all]
 ...

 ;; Sente stuff
 [clojure.core.match :as match :refer (match)] ; Optional,
 useful
 [clojure.core.async :as async :refer (! !! ! !! put! chan
 go go-loop)]
 [taoensso.sente :as sente]))


 (let [{:keys [ch-recv send-fn ajax-post-fn ajax-get-or-ws-handshake-fn]}
   (sente/make-channel-socket! {})]

   (def ring-ajax-postajax-post-fn)
   (def ring-ajax-get-or-ws-handshake ajax-get-or-ws-handshake-fn)
   (def ch-chsk   ch-recv)
   (def chsk-send!send-fn))

 ...

 (defn create-approutes [project-config browserrepl]

   (defroutes app-routes

 ;; Sente stuff
 (GET  /chsk req (ring-ajax-get-or-ws-handshake req)) ; tried both
 ring-ajax-get-or-ws-handshake and *#'*ring-ajax-get-or-ws-handshake
 (POST /chsk req (ring-ajax-postreq)); same
 here for trying both


 (GET / []
  (- (ring-resp/response (with-browser-repl index.html
 browserrepl))
  (ring-resp/content-type text/html)))

 (route/resources / {:root resources/public/})
 (route/not-found Not Found)))

 *fig.3 - my.clj *


 Tim Washington
 Interruptsoftware.com http://interruptsoftware.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

Re: [question] Multimethods vs case

2014-07-10 Thread Daniel Kersten
It does work.

As far as I can tell, the namespace with defmethod must require the
namespace with defmulti and also the namespace with defmethod must be
required from some other namespace that is being executed.

Eg:

*foo.clj:*
(ns foo)
(defmulti mmtest identity)
(defmethod mmtest :default [_] (println default))

*bar.clj:*
(ns bar
  (:require [foo]))
(defmethod mmtest :bar [_] (println in bar))

*core.clj:*
(ns core
  (:require [foo :refer [mmtest]] ; The mm we want to call
   [bar])) ; include the :bar impl

(println Testing)
(mmtest :bar) ; Prints in bar


If you don't require bar from core, it will print default instead.

Note, in this example I require foo and bar from core and use mmtest in
core too - you don't need to require bar from the same namespace that you
use in from like I did here. You just need to make sure that the (defmethod
...) call gets executed before you call mmtest.



On 10 July 2014 19:09, Elric Erkose elric.erk...@gmail.com wrote:

 This sounds interesting. I tried to define a multimethod in one file and a
 method in another file. I had no success.

   --
 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: Instaparse - thank you!

2014-06-12 Thread Daniel Kersten
I started playing with Instaparse recently too and its by far the nicest
parsing library I've used (after having used a few in C++, Java and Python
over the years). It makes parsing a pleasant and fun experience :)

So: Thank You Mark!


On 12 June 2014 03:43, Devin Walters dev...@gmail.com wrote:

 I think it's annularly understood that Mark is the bee's knees. Thanks for
 the fantastic, well-documented instaparse. It's saved me a *lot* of time to
 date, and it taught me a lot about parsers.

 Honorable mention to Sean Corfield for starting this thread and being such
 a model member of the community for what is shaping up to be the better
 part of a decade. Crazy, but true.

 Oh yeah, and all of you reading this. It's extremely exciting (and
 lucrative) to me to see all of my ranty Clojure is the future! bets
 paying off. :) Rhetorical question: How cool is it to be a part of this
 whole Clojure thing?

 Best Regards,
 '(Devin Walters)

 On Jun 11, 2014, at 20:25, Scott Thoman sc...@thoman.org wrote:

 +1 !

 I'm about to use it in a production deployment.  It has been a pleasure to
 use!

 --
 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 binding for OrientDB

2014-06-01 Thread Daniel Kersten
clj-orient hasn't been updated in 2 years, while OrientDB is in very active
development. Therefore, I would say that it is now quite dated.

A good alternative would be to use the Tinkepop API and looking into
https://github.com/clojurewerkz/archimedes - OrientDB has transitioned to
using Tinkerpop as its native graph API anyway, so if you want to use the
graph abstractions, then Tinkerpop seems like the best choice.
On the other hand, if, like me, you are more interested in the document
database (that happens to have fantastic graph-like direct links between
documents), then the Java API would probably be more suitable.


On 1 June 2014 15:34, Paulo Suzart paulosuz...@gmail.com wrote:

 Hi Zubair,

 It seems to be more then active:
 https://github.com/orientechnologies/orientdb/blob/master/history.txt

 This is the most recent release. But the bindings for many languages seems
 so outdated. :(

 Regards


 On Monday, May 26, 2014 11:11:47 AM UTC-3, Zubair Quraishi wrote:

 Hi Eduardo,
  Is this Clojure OrientDB project still Active?
 Thanks
 Zubair

 On Tuesday, August 2, 2011 3:17:33 AM UTC+2, eduardoejp wrote:

 I have been working on this library for a little while and I would
 like to present it to you:
 https://github.com/eduardoejp/clj-orient

 I hope this can be of help for the Clojure and OrientDB communities.

  --
 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: non-literate, excellent documentation style

2014-05-25 Thread Daniel Kersten
There are also Clojure tools to generate documentation like this:
https://github.com/gdeer81/marginalia


On 25 May 2014 20:55, Angel Java Lopez ajlopez2...@gmail.com wrote:

 Yes, it is based on docco
 http://jashkenas.github.io/docco/
 Check
 https://github.com/jashkenas/backbone/blob/master/package.json
 the doc scripts is
 doc: docco backbone.js  docco examples/todos/todos.js
 examples/backbone.localstorage.js,


 On Sun, May 25, 2014 at 4:51 PM, Marek Srank markus.mas...@gmail.comwrote:

 Based on the name of the css file I'd say they use
 http://jashkenas.github.io/docco/ ;)

 Marek


 On Sunday, May 25, 2014 9:45:19 PM UTC+2, da...@axiom-developer.orgwrote:

 Giving my LP horse a rest I'd like to call your attention
 to backbone.js and the way they arrange documentation.

 It is less of a story form or why explanation and
 more on the details which are not apparent in the code.

 I don't know what tool was used to create it.

 http://backbonejs.org/docs/backbone.html

 Tim Daly

  --
 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: Save map contentns to external file?

2014-05-15 Thread Daniel Kersten
To write the data to a file, you could do something like this:

(spit filename (pr data))

And to read it back in, you could do something like:

(clojure.edn/read-string (slurp filename))


On 15 May 2014 07:20, Steven Jones ple...@gmail.com wrote:

 Hi

 I am developing an Overtone MIDI application and wish to save/read the
 state of a map to an external file.  The map keys are always integers,
 specifically MIDI program numbers. The map values however have one of two
 forms. They are either explicit association list of key/value
 pairs or functions which return assoc list.

 I could handle the task if the map values where always explicit list. My
 real problem is how do I write out a Clojure function to an external
 file and later reconstruct it? Ideally the file would be pure text but
 that's not an absolute requirement.  Are there any standard methods for
 doing such a thing?


 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: What to use use for writing GUI's

2014-05-04 Thread Daniel Kersten
I'm a massive fan of Qt and have done a lot of Qt/QML in C++ in the past,
but lately when I've needed to do a GUI (and could use Clojure), I've been
making it Web based and using ClojureScript with Om. Since jetty/http-kit
run nicely as embedded servers, you could have your application run locally
and launch a browser (rather than running it on a server) if you wanted,
and if you have the ClojureScript talk to the Clojure server through
sente, you _almost_ won't even notice its not all plain Clojure since
communication looks more or less like a core.async channel.

Might be a bit much to learn if you're new to Clojure, though.

I haven't used swing or Qt in Clojure, so can't comment on them.


On 4 May 2014 10:44, Cecil Westerhof cldwester...@gmail.com wrote:

 2014-05-04 10:20 GMT+02:00 Cecil Westerhof cldwester...@gmail.com:




 2014-05-04 10:09 GMT+02:00 Colin Fleming colin.mailingl...@gmail.com:

 There's really no only way to do anything in Clojure, since you can
 always drop down to Java interop. So anything that's available to Java is
 available to Clojure, too. Not all the options have a nice Seesaw-like
 wrapper over it of course, but they're generally still quite usable. I do a
 reasonable amount of Swing work without Seesaw, mostly because it takes a
 while to start up, but Seesaw has a lovely API if that's not such an issue
 for you. Swing is generally a fine option, if you look at IntelliJ you'll
 see it's possible to make it quite pretty and functional, although it's a
 lot of work to get to that stage.

 Other options are QTJambi or SWT - I don't know anything about Pivot and
 the demos didn't work for me either in Firefox or Safari but it looks like
 that might be an option too. JavaFX may also be an option, although I don't
 know much about it. Or you can go for more esoteric options like embedding
 Chromium in a native app wrapper and use ClojureScript, which is what
 LightTable and other projects do.

 It really depends on your requirements, but the above are all viable
 options.


 ​Well, I am a newbie with GUI, so best to start with seesaw if there is
 no real reason not to use Swing I think then. (I do not remember why Swing
 was discouraged.) I have to look into the start-up time. I did not know
 about that.

 By the way: as I understood it JavaFX is only an option if you only
 develop for Windows.


  ​I see that there is also clj-swing. What would are the advantages of
 either compared to the other?

 --
 Cecil Westerhof

 --
 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: Style - Keyword access or accessors?

2014-04-22 Thread Daniel Kersten
I've personally always used keywords. I don't see any value in aliasing
:foo to foo. For navigating nested maps, get-in, update-in and assoc-in
with keywords seem natural and practical to me.


On 22 April 2014 10:43, Colin Yates colin.ya...@gmail.com wrote:

 (This has been discussed before but as this is fairly subjective I am
 interested in whether people's opinion has changed)

 What are people's experiences around using keywords or defined accessors
 for navigating data structures in Clojure (assuming the use of maps)?  Do
 people prefer using raw keywords or do people define accessors.

 For example, given {:my-property 10} would people inline my-property or
 define a (defn my-property [m] (:my-property m))?  If you use keywords then
 do you alias them (i.e. (def my-property :my-property)?

 My experience is that accessors become painful and restrictive really
 quickly (navigating nested maps for example) so keywords are the way to go.
  I tend to have a domain.clj which documents my domain and defines all the
 important abstractions (i.e. (def my-property :my-property).  I find this
 very useful, combined with marginalia for documentation purposes.  It also
 offers some aid in refactoring as multiple abstractions might resolve to
 the same keyword (i.e. value-group and bracket-group might resolve to
 :group).

 But, to be blunt, it can be a little cumbersome.  I also refer :as the
 namespace, so instead of (get-in m [:a :b]) it is (get-in m [dom/a dom/b]).

 What are your thoughts (and any other hints/tips for maintaining large
 Clojure code bases?)

 --
 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: What's clojure killer app? I don't see any.

2014-04-20 Thread Daniel Kersten
For me the killer thing about Clojure isn't a specific library or
feature, its the philosophy that the community fosters and the collection
of features and libraries that this nurtures:


   - Simplicity
   - Decomplection (extreme separation of concerns)
   - Data-centric code (data-structure-first, explicit data, sequence
   abstraction, ...)
   - Immutability (which is really an enabler for the above)
   - Managed state and side effects
   - Small libraries that do one thing well, but can be composed as needed
   to build solutions that are well fitted to the problem

All these things lead to easier to understand, easier to maintain, easier
to test, easier to extend and adapt code.

But.. if we must name some libraries and tools that I consider part of the
killer ecosystem:

   - Om
   - core.async as a glue between components and libraries
   - Enlive, enliven, enfocus, kioo
   - If it lives up to its promises, Pedestal, when its ready
   - Typed Clojure looks like it could become an integral and indispensable
   part of the ecosystem
   - Storm
   - Though I haven't yet used it, going by the community response, Datomic
   - Ring

Together these things, in my opinion, make Clojure quite special.


On 20 April 2014 01:19, Sean Corfield s...@corfield.org wrote:

 On Apr 19, 2014, at 9:15 AM, Paulo Suzart paulosuz...@gmail.com wrote:

 Been following the list for some time and specially paying attention to
 what could be the killer clojure app as Akka is for Scala.


 I don't think Akka is a killer app for Scala. Scala is a multi-paradigm
 general purpose language that is a better Java as well as a functional
 programming language. I think the whole killer app for a language is a
 ridiculous idea to be honest.

 I keep seeing small libs (I like libs) popping up like ants, but I don't
 believe none of them (alone at least)  can make clojure explode and become
 main technology in a old school /ordinary company.


 The more important question is Does Clojure need to become 'mainstream'?
 for some definition of 'mainstream'. I think the answer is no. We're past
 the time of one language to rule them all. For years it was C/C++, then
 it slowly shifted to Java, and then C# became a dominant language for
 Windows while Java dominated everywhere else. But that homogeneity has pros
 and cons. Lately we've seen an explosion of programming languages, most of
 which are general purpose, and many of which are based on the JVM. Now we
 have choice: we can use whatever language we find most suitable for the
 task at hand - or even whatever language we just plain ol' prefer! A
 company can use multiple languages and know they'll all play nicely
 together. Each team can choose their favorite JVM language and it won't
 cause problems with other teams. This is a HUGE improvement on the only
 Java world in my opinion.

 What made me give up scala was Scalaz


 Well, that I can understand :)

 Sorry guys, I've been posting about Clojure since 2009, and still can't
 see it becoming the main technology even being the CTO of the company.


 A lot of companies are using Clojure for everyday things. A lot of
 companies are quite happily using Clojure as their main technology. But if
 the CTO is too conservative to pick Clojure, that's their choice. It's
 worth remembering that Clojure endeavors to be a general-purpose
 language suitable in those areas where Java is suitable. --
 http://clojure.org/rationale

 At World Singles, we use Clojure for accessing databases (MySQL and
 MongoDB), interacting with third party web services (JSON, XML, REST, even
 SOAP - ugh, but it's so much nicer than doing it in Java!), analyzing data,
 transforming data, managing internationalization, logging, environment
 control... pretty much everything. We use it for all our long-running
 background processes - one of which generates and sends about 1.5M HTML
 emails a day and runs millions of JSON queries against a custom search
 engine. We have a real-time chat server written in Clojure (based on a Java
 Socket.IO implementation). We're just starting down the path of using
 ClojureScript for an internal-facing analysis app - using Om and D3 for
 real-time data display, with core.async over web sockets (via Sente).

 All new server-side development is in Clojure for us. Two reasons:

 * The Clojure code is much simpler, shorter and easier to maintain.
 * The team *love* writing Clojure! They're having more fun in their jobs
 than ever.

 The immutability, easy concurrency, DSLs and so on - those are all icing
 on the cake.

 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 

Re: cljsbuild dev/release, different debug levels

2014-04-04 Thread Daniel Kersten
I'd love to know the correct answer to this too, but in the meantime,
here's how I've been doing it:

I define the release version in some namespace. To use it, I require this
namespace. Eg release-namespace/func

Then I create a separate file for the debug build and I require the release
namespace and overwrite the function (remember, they're compiled to normal
javascript variables):

(defn debug-func ...)
(set! release-namespace/func debug-func)

Finally, in my project.clj (or profile.clj), I add the debug file to the
:source-paths in the debug build settings.


Though I haven't tried it, I believe you can do something similar in normal
clojure using alter-var-root.





On 3 April 2014 16:06, t x txrev...@gmail.com wrote:

 The correct statement should be: I *no longer* use cljx. :-)

 On Thu, Apr 3, 2014 at 8:05 AM, t x txrev...@gmail.com wrote:
  I don't use cljx. It slows down lein cljsbuild auto.
 
  I'm using pure clojurescript. Is there a way to get the dev /
  release tag passed somehow?
 
  On Thu, Apr 3, 2014 at 6:58 AM, Alex Robbins
  alexander.j.robb...@gmail.com wrote:
  If you used cljx, you could probably use the feature expressions to do
 what
  you want.
 
  https://github.com/lynaghk/cljx
 
  You'd need to set up a custom rule for it, but it seems well within the
  scope of the project.
 
 
  On Thu, Apr 3, 2014 at 8:50 AM, t x txrev...@gmail.com wrote:
 
  Hi,
 
I'm trying to figure out how to do the following:
 
Have a shared cljs/* ...
 
For the dev build, have (debug ...) compile to (js/console.log ...)
 
For the release build, have (debug ...) compile to (do).
 
Basically, I want different things to happen depending on whether
  the build is dev or release.
 
Does anyone have an example of how to do this?
 
  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.

 --
 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: Good resources on dataflow based programming

2013-12-26 Thread Daniel Kersten
*Given an infinite number of cores, the time to process a set of dataflow
functions is equivalent to the the time that the longest function took to
do its processing.*

It sounds like you've just discovered Amdahls Law :-D
https://en.wikipedia.org/wiki/Amdahl%27s_law

As for the articles, the hierarchies one is interesting to me mainly
because a dataflow network is basically a flat hierarchy: the network will
still run if you remove, exchange or add to parts of it. I noticed this a
lot when I did some Max/MSP development and it changed how I approached
problems. It was a very exploratory approach, but the difference to using a
REPL is that its easy to change code deeply integrated in other code and
re-evaluate whichever parts you want to test (actually, I do this in
Clojure by evaluating my code from my editor rather than in a REPL, but it
still feels different from rewiring a visual language).

In Pedestal, you can see this when you remove, exchange or add, eg,
transform functions - this does not affect the rest of the dataflow at all
as they are independent and isolated. I find this a very powerful and
pleasant way to program, which is why I linked that article.

The other article obviously doesn't apply in pedestal-app's because
javascript cannot run the code in parallel, but I found that conceptually
it has helped me understand how and why to isolate code and how it all fits
together. I also envision that the pedestal dataflow system will eventually
become part of pedestal-service (they ported it to use core.async, I'm
assuming this was to make this a possibility), in which case, it actually
can run in parallel and pipelined.

I hope the articles made things clearer and not more confusing!


On 25 December 2013 02:40, Stephen Cagle same...@gmail.com wrote:

 Just a quick thought I had as I was walking home.

 Given an infinite number of cores, the time to process a set of dataflow
 functions is equivalent to the the time that the longest function took to
 do its processing. The efficiency is the (sum of time that all the dataflow
 functions took) / ( (count of the dataflow functions) * (the time of the
 longest running dataflow function) ). Given this, optimization is really
 simple. Take the longest running dataflow function, and see if you can
 somehow split it into smaller functions. Nothing profound here, but I
 thought it was interesting how evident optimizations might be when you
 use a dataflow processing model.

 On Tuesday, December 24, 2013 3:50:43 PM UTC-8, Stephen Cagle wrote:

 One thing that I am seeing on a re-read is that I conflated the notion of
 the data flow function and the paths. I was sort of thinking that the data
 flow functions sit at a particular path location. Similar to how a value
 sits in a location in memory. It is more appropriate to say that the data
 flow function is associated (referred isn't quite right) with a particular
 path location.

 Taking this a bit further, a data flow function DOES NOT actually know
 who its inputs are. It only knows that it takes input values in/of a
 certain form. The schema that specifies how one set of paths map to another
 path are possibly separate from the schema that specifies which dataflow
 function is associated with which path.

 On Tuesday, December 24, 2013 1:36:16 PM UTC-8, Stephen Cagle wrote:

 Thank you. I only read the last two articles so far; some notes.

 http://my.opera.com/Vorlath/blog/2008/01/06/simple-
 example-of-the-difference-between-imperative-functional-and-data-flow

 I realized that I really wasn't getting what dataflow was about. I was
 viewing dataflow paths as a sort of hook that I could hang values on. I had
 never externalized the fact that each path only refers to the things it
 inputs upon. Specifically, I was modeling some of the patterns like path A
 passes a value to B, B does some computation, and puts the result on path
 A. This isn't neccessarily wrong, but it appears that I was using dataflow
 paths in a way similar to function evaluation.

 He makes a big deal out of not needing to know where his inputs come
 from, as well as not needing to invoke a function to create his inputs, but
 it still seems he must have a reference to his inputs.

 The effectively automatic parallellization of the code is pretty neat.
 Not so much because it is parallelized (which can be done in other
 systems), but mostly because it required no forethought or synchronization.
 It is automatically parallelized and pipelined. Neato. Of course, we aren't
 going to get much of that in js without some work.

 The second to last paragraph was another head turner. I had previously
 viewed every dataflow node/path as a loop that just waits for a change in
 its inputs and computes a new value when one of them changes. However, in
 his system recursive calls are also parallelized and pipelined. I am not
 quite sure how this would be implemented, but it seems neat. Again though,
 probably not relevant to js.

 

Re: Good resources on dataflow based programming

2013-12-24 Thread Daniel Kersten
Here's some resources to get you started learning about dataflow as a
paradigm. From this you should be able to figure out how Pedestal's
dataflow system fits in.

A list of existing dataflow languages and systems:
http://stackoverflow.com/questions/461796/dataflow-programming-languages/949771#949771
I
would suggest looking into a few of these to learn the concepts. I'd also
suggest trying out one or more of the visual dataflow languages to get a
feel for how problems can be solved in this paradigm and how non-pure
functions fit in. I've personally used both Max/MSP and Synthmaker and
found the concepts really clicked after using them for a while.

A work in progress book on which you may also want to keep an eye:
http://dataflowbook.com/cms/

Also, if you can ignore the tone, this article has helped me better
understand how code fits together in a dataflow system (a flat hierarchy):
http://my.opera.com/Vorlath/blog/2008/07/25/hierarchies-and-equivalence and
this one talks about how dataflow differs from imperative programming:
http://my.opera.com/Vorlath/blog/2008/01/06/simple-example-of-the-difference-between-imperative-functional-and-data-flow
But
be warned that the author of those is very opinionated and feels that he is
writing about the one true way ;-)



On 23 December 2013 19:32, Stephen Cagle same...@gmail.com wrote:

  Cross posted from pedestal-users group, as many people who are not using
 pedestal may still know about dataflow, terms like effect are used in the
 context of pedestal 

 Pedestal seems strongly based on dataflow based programming. The gigantic
 tutorial just sort of jumps in on it.

 Based on my usage thus far, dataflow seems really good at modeling
 problems that are self contained. In their pure forms (no external inputs
 or internal effects), dataflow seems almost like a circuit diagram.

 However, I quickly get confused once we start dealing with effects. Seems
 that there is a large Here be Dragons area of code in that region
 (services.cljs).

 I feel that this may not be dataflow's fault; I just haven't got my head
 around it. When I look at dataflow, I feel like it is constraining me to a
 particular way of solving a problem. The upside of this is that I have made
 my logic declarative and potentially easier to reason about. This is a
 trade-offs that seems similar to the trade-offs one makes when moving from
 a mutable procedural programming model to a immutable functional model. I
 have yet to personally get substantial benefit from dataflow, but that does
 not mean I will not with more mastery.

 I am wondering if there are any any getting started guides for dataflow
 programming that you (the community) would recommend. I would be especially
 interested in recipe books for dataflow based programming. How do you
 really do asynchronous processing with dataflow? What if your asyncs may
 return in a random order but must be processed in a specified order? A few
 books/articles/whatever on how experts think through these problems could
 be quite beneficial.

 --
 --
 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: Entity component system

2011-03-16 Thread Daniel Kersten
Hi Michael,

Looks great! I love the video too. Very nice.
I have put a link to your blog post on the clojure games wiki. I'll update
the wiki properly when I get a chance. If you want to put details on your
game on the wiki (or want to edit my post about your component entity
system), please feel free to. I'll do it myself eventually if not, but it
may take some time before I do.

In any case, great work!!

Dan.

On 16 March 2011 15:09, msappler damnedmar...@web.de wrote:

 Finally I launched my little website: http://resatori.com

 You can see a short video of my game there ;)

 Fraps only allows 30 seconds so nothing more to see :(

 Entity Component Post will follow this week.

 On 6 Mrz., 16:24, Daniel Werner daniel.d.wer...@googlemail.com
 wrote:
  Himsappler,
 
  On Jan 12, 12:27 pm,msapplerdamnedmar...@web.de wrote:
 
   No i do not mind.
   A blog is being planned for promotion of my game and sharing.
   Only have to find a domain name which i like.
 
  Have you put anything in the meantime? I'd be very interested to read
  about your game's progress and learn more about the component system
  you built for it.
 
  Daniel

 --
 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 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: Entity component system

2011-01-11 Thread Daniel Kersten
Thanks for sharing!

Entity component systems are something I'm very interested in and
something I have tinkered with in the past. I hope to (eventually)
find some time to play around with them in Clojure too. I would be
very interested in hearing more about your solution and would be
delighted if you were to choose to open source your project.

As an aside, do you mind if I copy your sample code and possibly parts
of your email to the clojure-games.org wiki?

Thanks,
Dan.

On 10 January 2011 00:43, justinhj justi...@gmail.com wrote:
 Thanks for sharing.  I've also spent some time building a Common Lisp
 game engine that uses a component architecture for the game objects.

 For example in pong the player's paddle is made up of a visual,
 physical and logical components.

 (defun make-pong-player(side human sprite-def control-type name)
  (let ((phys (make-instance '2d-physics
                             :collide-type 'paddle :y *paddle-start-y* :width 
 *paddle-
 width* :height *paddle-height*))
 ;       (anim (make-instance 'animated-sprite :sprite-def sprite-def
 ;                            :current-frame 'frame-1 :speed 5.0))
        (visual (make-instance 'rectangle
                                  :w *paddle-width* :h *paddle-height*))
        (pong (make-instance 'player-paddle-logic
                             :control-type control-type :side side))
        (obj (make-instance 'composite-object :name name)))
    (add-component obj phys)
    (add-component obj visual)
 ;    (add-component obj anim)
    (add-component obj pong)
    obj))

 The objects implement message handlers in order to operate. For
 example the game engine sends update and draw messages. Users can
 write their own message types with custom argument lists.

 I've put the project on google code http://code.google.com/p/lisp-game-engine/

 Although the pong game works I wouldn't consider this a finished
 project by any means; it's more an experiment in game programming
 using CL and the REPL.

 It would require significant refactoring to make it work with Clojure
 since I use mutable state a lot, but would certainly be possible.

 Justin

 --
 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 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: ANN: Gloss, a byte-format DSL

2010-11-23 Thread Daniel Kersten
Looks really good. Thanks for another great library!

On 23 November 2010 21:12, Moritz Ulrich ulrich.mor...@googlemail.comwrote:

 I would go for the vector. It's easier than writing (ordered-map ...) all
 the time. If you want to generate structs dynamically, you would even simply
 create a vector of alternating pairs and do (apply ordered-map my-vec).

 Btw: Great library! I think I will rewrite my binary-parser from a project
 of mine to use this library!


 On Tue, Nov 23, 2010 at 9:24 PM, Zach Tellman ztell...@gmail.com wrote:

 Good question.  The solution didn't make the cut for my initial
 release, but will be added soon.  My plan is to have an (ordered-
 map ...) frame which encodes and decodes the keys in the given order.
 So for C interop, the frame would be

 (ordered-map :a :int16, :b :float32)

 An alternative would be to just turn any vector which is alternating
 keys and types into an ordered-map, but that seems a bit too magical.

 Zach

 On Nov 23, 12:12 pm, Chris Perkins chrisperkin...@gmail.com wrote:
  On Nov 23, 12:03 pm, Zach Tellman ztell...@gmail.com wrote:
 
 
 
 
 
 
 
 
 
   When writing Calx [1], I discovered it was a huge pain to deal with
   mixed C datatypes in Java.  When writing Aleph [2], I discovered the
   problem increases by a factor of ten when dealing with streams of
   bytes.  In an attempt to alleviate my own pain, and hopefully help a
   few other people out, I've written Gloss, which can transform a simple
   byte-format specification into an encoder and streaming decoder.
 
   A full writeup can be found athttps://github.com/ztellman/gloss/wiki.
 
   A few people have already asked me how this differs from protocol
   buffers, so I'll preemptively answer that protocol buffers are a fixed
   format that cannot be used to interface with external systems.  Gloss
   is less performant than protocol buffers, but is also much less picky
   about formats.
 
   If anyone has any questions, I'd be happy to answer them.
 
  Looks very useful, Zach. Thanks.
 
  I have a question.
 
  I have only taken a quick look, so maybe I'm misunderstanding the
  intent, but it's not clear to me how you would use this for sending
  and receiving structured data from, say, a C program.
 
  Taking your example from the wiki:
 
  (def fr (compile-frame {:a :int16, :b :float32}))
 
  Let's say I want to talk to a C program that speaks in structs, like
  this:
 
  struct Foo { short a; float b; }
 
  The problem is, the C program cares about order - the short comes
  before the float. How does the Clojure program know what order I need
  the fields in, since I have specified the format with a map; an
  unordered data structure? Is there another way to specify a structure
  where order of the fields matters? If so, why have two ways of doing
  it? Or am I just missing something?
 
  Thanks,
 
  - 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.comclojure%2bunsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en




 --
 Moritz Ulrich
 Programmer, Student, Almost normal Guy

 http://www.google.com/profiles/ulrich.moritz
 BB5F086F-C798-41D5-B742-494C1E9677E8

 --
 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.comclojure%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 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: ANN: Clojure Games

2010-11-22 Thread Daniel Kersten
Tim, if you want to take another shot at a logo, feel free!

Ken, yeah, I forgot to remove the favicon and the twitter avatar. I
guess I should do that.

On 22 November 2010 14:30, Tim Visher tim.vis...@gmail.com wrote:
 Hah.  There does seem to be some confusion about the logo. :)

 Oh well, it was still a neat little project to mess with.

 On Sun, Nov 21, 2010 at 10:08 PM, Ken Wesson kwess...@gmail.com wrote:
 When I bring up the site, the new logo appears in the top left corner
 but the tab still has the old favicon.

 --
 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 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 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: ANN: Clojure Games

2010-11-21 Thread Daniel Kersten
On 21 November 2010 19:01, Ken Wesson kwess...@gmail.com wrote:
 On Sun, Nov 21, 2010 at 1:39 PM, Tim Visher tim.vis...@gmail.com wrote:
 On Sat, Nov 20, 2010 at 4:16 PM, Glen Stampoultzis gst...@gmail.com wrote:
 Also, I think the Clojure logo is copyrighted so permission might need to 
 be obtained to reuse it.

 I think you're right.  Any thoughts from anyone who has the right to
 say so as to whether or not the logo would be ok to use?

 Are you sure it's not simply trademarked? It's not infringing to use a
 trademark as long as you're using it to refer to the real McCoy and
 not implying the trademark holder endorses your product. Third party
 addons often use trademarks in their advertising: This
 baldness-resistant tire works with all 1997-and-later GM car and light
 truck models, etc. As long as they don't claim (and the trademark
 isn't itself) some sort of seal of approval from GM, this is legal.
 (Of course it's also legal if they actually *have* GM's seal of
 approval.)

I asked Rich about this and he does NOT allow the use of the Clojure
logo or a logo derived from it for anything other than referring to
Clojure the language. While I'm a little disappointed by this, I can
understand and appreciate his wishes. Here is what he said:

The Clojure logo should only ever be used, intact, to refer to the
Clojure language. All other uses are prohibited.

You can't use the Clojure logo to promote something else (i.e. your
games site). I would stay away from trying to convey a relationship to
Clojure via any similarity to the Clojure logo. I can't comment on the
trademark implications of making a similar logo, but you are better
off creating something original.


 I would not think that using the Clojure logo to accurately identify
 that something is associated in some way, shape, or form with Clojure
 (while avoiding making any false claims of being officially endorsed
 by Rich Hickey) would be trademark infringement.

This was what I was thinking when I made the original logo. Its the
same way as Ruby related sites/libraries/products make use of the gem
logo, for example, and I believe it helps the community by making it
easy to distinguish between Clojure-related and non-related things
easily. Having said that, I also understand the flip side of the coin:
using the logo to profit in some way. I imagine making that
distinction could become pretty difficult and I imagine that's what
Rich wishes to avoid.


 If it's actually *copyrighted* you may want to look into the copyright
 license. One hopes it's a fairly liberal CC license or even an
 outright copyleft but you never know.

That's what I thought (hoped), but I guess not? I suggested to Rich
that this be clearly clarified on the clojure.org website so that in
the future people will know what they can and cannot do.

In any case, I will be removing the current Clojure Games logo shortly
and will be open to suggestions for a replacement. I have some ideas,
but would welcome the communities input.

That brings me to another issue - I would like to avoid other
licensing issues for the site, so I suggest that we put a disclaimer
on the ClojureGames.org homepage outlining what license everything is
released under. My suggestion would be as follows, though I'd like to
hear what others think:

All code and games posted (or linked in a Github Gist) is released
under the BSD license (unless otherwise stated on the specific wiki
page).

All linked libraries, code and games (eg, external blog posts or
Github repositories) are (obviously) licensed under the authors terms
(which are hopefully displayed on the linked to page)

All text (articles, tutorials etc) and images (logos, art for games,
screenshots) are released under the Creative Commons license (unless
otherwise stated on the specific wiki page).

Sound good to everyone?

Regards,
Dan.


 --
 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 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: ANN: Clojure Games

2010-11-21 Thread Daniel Kersten
On 21 November 2010 20:55, Ken Wesson kwess...@gmail.com wrote:
 On Sun, Nov 21, 2010 at 3:43 PM, Daniel Kersten dkers...@gmail.com wrote:
 On 21 November 2010 19:01, Ken Wesson kwess...@gmail.com wrote:
 On Sun, Nov 21, 2010 at 1:39 PM, Tim Visher tim.vis...@gmail.com wrote:
 On Sat, Nov 20, 2010 at 4:16 PM, Glen Stampoultzis gst...@gmail.com 
 wrote:
 Also, I think the Clojure logo is copyrighted so permission might need to 
 be obtained to reuse it.

 I think you're right.  Any thoughts from anyone who has the right to
 say so as to whether or not the logo would be ok to use?

 Are you sure it's not simply trademarked? It's not infringing to use a
 trademark as long as you're using it to refer to the real McCoy and
 not implying the trademark holder endorses your product. Third party
 addons often use trademarks in their advertising: This
 baldness-resistant tire works with all 1997-and-later GM car and light
 truck models, etc. As long as they don't claim (and the trademark
 isn't itself) some sort of seal of approval from GM, this is legal.
 (Of course it's also legal if they actually *have* GM's seal of
 approval.)

 I asked Rich about this and he does NOT allow the use of the Clojure
 logo or a logo derived from it for anything other than referring to
 Clojure the language. While I'm a little disappointed by this, I can
 understand and appreciate his wishes. Here is what he said:

 It looks to me like it is referring to Clojure the language;
 specifically, specifying what language the games are implemented in.

 Perhaps ask Rich for clarification here?

I don't think it counts as referring to the language.
1) he said that the logo should be used intact. The Clojure Games logo
is, however, a modified derived version.

2) The logo refers to the website - game development in Clojure - not
to Clojure the language itself.

3) He specifically stated that the Clojure logo cannot be used to
promote something else. While my intention is to use the Clojure Games
wiki (and therefore, by extension, logo) to promote Clojure the
language, as opposed to using Clojure to promote the site, I think the
distinction is too fuzzy to be worth arguing over.

But.. that leads me to another question. Rich stated that You can't
use the Clojure logo to promote something else. Does this mean one
cannot display the Clojure logo (unmodified) on a website? The use
case would be to show visitors that the site is about Clojure, but it
could also be seen as using the logo to promote the site. Perhaps
there should be separate logos especially for this purpose? Eg,
Powered by Clojure and so on?


 --
 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 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: ANN: Clojure Games

2010-11-21 Thread Daniel Kersten
Indeed.

I have emailed him again asking for further clarification (and asked
for what license it is released under, if any - though I think its
extremely important that it is released under some specific and
publicly disclosed terms).

The only other discussion on this issue that I could find was here:
http://groups.google.com/group/clojure/browse_thread/thread/7f179c79f0d0bb3e
but, while somebody asked about the license, a distinctive answer was
never given.

Hopefully he can solve this once and for all and prevent any future
confusion. I think it would be a good idea to put this information up
on http://clojure.org/license

On 21 November 2010 22:33, Ken Wesson kwess...@gmail.com wrote:
 I think the whole mess is in need of sorting out, and that Rich Hickey
 is going to have to be the one to do that. I think there should be *a*
 logo usable for any site that's primarily about Clojure or
 Clojure-developed software; whether this is the blue-and-green-lambda
 logo we've been discussing or some other logo would be up to Rich to
 decide.

 --
 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 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: ANN: Clojure Games

2010-11-21 Thread Daniel Kersten
By the way, I imagine using the logo in such a way (displaying it,
unmodified, on a website) would simply fall under fair use (according
to wikipedia: A nonowner may also use a trademark nominatively—to
refer to the actual trademarked product or its source.), but since I
doubt any of us are lawyers, I still think it would be best to have an
official decision on the matter.

On 21 November 2010 22:45, Daniel Kersten dkers...@gmail.com wrote:
 Indeed.

 I have emailed him again asking for further clarification (and asked
 for what license it is released under, if any - though I think its
 extremely important that it is released under some specific and
 publicly disclosed terms).

 The only other discussion on this issue that I could find was here:
 http://groups.google.com/group/clojure/browse_thread/thread/7f179c79f0d0bb3e
 but, while somebody asked about the license, a distinctive answer was
 never given.

 Hopefully he can solve this once and for all and prevent any future
 confusion. I think it would be a good idea to put this information up
 on http://clojure.org/license

 On 21 November 2010 22:33, Ken Wesson kwess...@gmail.com wrote:
 I think the whole mess is in need of sorting out, and that Rich Hickey
 is going to have to be the one to do that. I think there should be *a*
 logo usable for any site that's primarily about Clojure or
 Clojure-developed software; whether this is the blue-and-green-lambda
 logo we've been discussing or some other logo would be up to Rich to
 decide.

 --
 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 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: ANN: Clojure Games

2010-11-21 Thread Daniel Kersten
This is the logo I'm using for the time being. If anybody has any
ideas or art skills, I'll be more than happy to replace this with
something prettier.

On side note, any suggestions regarding content are welcome too. I am
working on some ideas for tutorials on programming games in a
functional style, but it will take me some time to get them into a
publishable form.

On 21 November 2010 22:48, Daniel Kersten dkers...@gmail.com wrote:
 By the way, I imagine using the logo in such a way (displaying it,
 unmodified, on a website) would simply fall under fair use (according
 to wikipedia: A nonowner may also use a trademark nominatively—to
 refer to the actual trademarked product or its source.), but since I
 doubt any of us are lawyers, I still think it would be best to have an
 official decision on the matter.

 On 21 November 2010 22:45, Daniel Kersten dkers...@gmail.com wrote:
 Indeed.

 I have emailed him again asking for further clarification (and asked
 for what license it is released under, if any - though I think its
 extremely important that it is released under some specific and
 publicly disclosed terms).

 The only other discussion on this issue that I could find was here:
 http://groups.google.com/group/clojure/browse_thread/thread/7f179c79f0d0bb3e
 but, while somebody asked about the license, a distinctive answer was
 never given.

 Hopefully he can solve this once and for all and prevent any future
 confusion. I think it would be a good idea to put this information up
 on http://clojure.org/license

 On 21 November 2010 22:33, Ken Wesson kwess...@gmail.com wrote:
 I think the whole mess is in need of sorting out, and that Rich Hickey
 is going to have to be the one to do that. I think there should be *a*
 logo usable for any site that's primarily about Clojure or
 Clojure-developed software; whether this is the blue-and-green-lambda
 logo we've been discussing or some other logo would be up to Rich to
 decide.

 --
 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 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=enattachment: clojuregames-logo2.png

ANN: Clojure Games

2010-11-18 Thread Daniel Kersten
Hi,

I've been playing with the idea of creating a game development site
for Clojure for a while now and finally got around to setting up a
wiki for that purpose: http://clojure-games.org/

So far, there isn't much content there yet. I've linked any popular
game-related libraries, blog posts and code snippets that I could find
on Google, but that's about it. I hope to expand it over the next few
weeks, but perhaps there are others interested in helping out. I've
already had a few people emailing me about the site, so perhaps there
is enough interest in Clojure-based game development.

In any case, please feel free to add to the site or suggest
changes/improvements.

Happy game devving,
Dan.

-- 
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: ANN: Clojure Games

2010-11-18 Thread Daniel Kersten
No problem! I'm glad theres other people interested in this :)

Theres still a lot I need to do with the site as theres very little
content there at the moment, but I'll get there eventually, especially
if other people are willing to contribute too.

Regards,
Dan.

On 18 November 2010 17:28, Raoul Duke rao...@gmail.com wrote:
 On Thu, Nov 18, 2010 at 6:14 AM, Daniel Kersten dkers...@gmail.com wrote:
 Happy game devving,

 a great idea, thank you for pushing this sort of thing along!
 sincerely.

 --
 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 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 things should be simple

2010-09-09 Thread Daniel Kersten
On 9 September 2010 19:16, Brenton bashw...@gmail.com wrote:

 Mike,

 While evaluating Clojure, just remember, you don't have use it for
 everything. When you need something simple, as in your examples, then
 use cgi. When you need to do something more complex then Clojure can
 help.

 You cannot deploy a .clj script on a running Tomcat (yet). When you
 install Tomcat, you have a ROOT context into which you can place .html
 and .jsp files and they will be dynamically loaded. This gives you
 about the same functionality as you would get from php and apache.

 Even though Clojure doesn't already have what you are looking for it
 would not be difficult to make it work. For example, you could create
 a generic web app that would have an embedded REPL as well as the
 ability to dynamically load code from external files. You would then
 just need to install Tomcat (which is easy) and drop this war into it.
 Form then on out you would just create simple .clj scripts and drop
 them into a directory.



 You could also connect to the REPL and
 dynamically add and remove code from the application.


Or use something like jnotify to notify your application that the directory
has been changed and have it automagically load/reload the code. I did this
once a few months back - if I changed my .clj file or added a new one, the
app detected it and loaded it.


 This hasn't been
 done yet because I don't think many people would find it useful.

 Clojure is new so when you see something missing, build it. That is
 why all of this other stuff is so simple, someone built it.

 Brenton


 On Sep 9, 10:40 am, Mike Meyer mwm-keyword-googlegroups.
 620...@mired.org wrote:
  On Thu, 9 Sep 2010 09:41:09 -0700 (PDT)
 
  Brenton bashw...@gmail.com wrote:
   Mike,
 
   Your point has been made, simple things are simple. When you need to
   print hello world you don't need to bring Clojure into the picture.
   You could have given a much simpler example of needing to print hello
   world on the command line. echo hello world is much simpler than
   what you would need to do in Clojure.
 
  The thing is, I'm evaluating clojure - that's what drags clojure into
  it. If I wasn't interested in using clojure, I'd never have asked the
  question. Printing hello world is just a simple, well-understood
  example application. There are *lots* of applications worth putting on
  the web that aren't much more complicated than that. I chose it to
  emphasis how much extra work the environment that clojure seems to be
  inextricably linked with adds.
 
   When faced with any problem to solve, you have to look at the tools
   you have available and then determine what the simplest solution will
   be. In your case, all of the software you need is already installed,
   configured and running. So it's simple. If you gave me a system with
   Tomcat installed, configured and running then I could do the exact
   same thing. It has nothing to do with Java, it has to do with what you
   are given to work with.
 
  I thought I *gave* you all those things to work with when I said not
  counting the web server and whatever else it needs to be ready to run
  applications. Could you show me (or point me to an web page showing)
  how I'd go from a simple .clj script to an application running on
  Tomcat that's been installed and is ready to run applications? If
  that's as simple as the apache/cgi example, I'll be very happy.
 
   mike
  --
  Mike Meyer m...@mired.org
 http://www.mired.org/consulting.html
  Independent Network/Unix/Perforce consultant, email for more information.
 
  O ascii ribbon campaign - stop html mail -www.asciiribbon.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.comclojure%2bunsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en




-- 
Daniel Kersten.
Leveraging dynamic paradigms since the synergies of 1985.

-- 
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: Why no tail call optimization

2010-08-03 Thread Daniel Kersten
Can one not detect that a recursive call is a tail call and then transform
the AST so that its iterative instead - ie, not use the stack besides for
initial setup of local variables (which then get reused in each recursive
tail-call). Isn't this how its done in native compiled languages with TCO?
How is this different from generating bytecode for iterative loops in
imperative languages, or from what recur does? Alternatively, why can't the
tail call be detected and converted into recur? I'm guessing that the
problem is detecting tal calls - but why; speed of dynamic compilation?
Something else?

Obviously I'm missing something fundamental here - can somebody explain to
me what it is?

Thanks!

On 3 August 2010 05:54, Wilson MacGyver wmacgy...@gmail.com wrote:

 as Rich Hickey stated

 question: Is it fundamentally impossible to do TCO on JVM due to
 current JVM lack of primitives to do so? Would TCO ever be possible on
 the JVM without a new JVM design?
 rhickey: TCO is easy if you are an interpreter - see SISC Scheme.
 Using Java's call stack, the JVM would have to provide it. There are
 no fundamental technical difficulties, but potential issues for the
 security model, which uses the call stack to ensure privileges.

 On Mon, Aug 2, 2010 at 10:16 PM, Dan Kersten dkers...@gmail.com wrote:
  Why can't the clojure bytecode compiler hand-perform this like
  functional languages do when compiling to native code? Is it to keep
  the clojure compiler fast (for dynamic runtime compilation), since
  performing tail call optimisation presumably requires a bunch of extra
  checks and more complex code generation? Perhaps this could be done on
  AOT compilation?
 
  On Aug 3, 2:58 am, Frederick Polgardy f...@polgardy.com wrote:
  It means that the JVM doesn't look at method calls and figure out that
 they're in tail call position and optimize them. You can hand-write code
 that performs a goto in a tight loop (like recur does), but means you can't
 assume that method calls in general will be tail call optimized.
 
  -Fred
 
  --
  Science answers questions; philosophy questions answers.
 
  On Aug 2, 2010, at 4:09 PM, Dale wrote:
 
   The JVM has an unconditional goto opcode and the ability to re-bind
   function parameters, so why no tail-call optimization? Thanks.
 
   Dale
 
   --
   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.comclojure%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 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.comclojure%2bunsubscr...@googlegroups.com
  For more options, visit this group at
  http://groups.google.com/group/clojure?hl=en



 --
 Omnem crede diem tibi diluxisse supremum.

 --
 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.comclojure%2bunsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en




-- 
Daniel Kersten.
Leveraging dynamic paradigms since the synergies of 1985.

-- 
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: Why no tail call optimization

2010-08-03 Thread Daniel Kersten
Thanks for the replies, that certainly clarified things!

On 3 August 2010 13:39, Rich Hickey richhic...@gmail.com wrote:



 On Aug 3, 2:19 am, Daniel Kersten dkers...@gmail.com wrote:
  Can one not detect that a recursive call is a tail call and then
 transform
  the AST so that its iterative instead - ie, not use the stack besides for
  initial setup of local variables (which then get reused in each recursive
  tail-call). Isn't this how its done in native compiled languages with
 TCO?
  How is this different from generating bytecode for iterative loops in
  imperative languages, or from what recur does? Alternatively, why can't
 the
  tail call be detected and converted into recur? I'm guessing that the
  problem is detecting tal calls - but why; speed of dynamic compilation?
  Something else?
 
  Obviously I'm missing something fundamental here - can somebody explain
 to
  me what it is?
 

 When speaking about general TCO, we are not just talking about
 recursive self-calls, but also tail calls to other functions. Full TCO
 in the latter case is not possible on the JVM at present whilst
 preserving Java calling conventions (i.e without interpreting or
 inserting a trampoline etc).


Ah, this where my confusion was then.
Self-calls aren't the problem at all, since they can be compiled how recur
is, but tail-calls to other functions cannot be due to the JVM's calling
conventions. I understand now, thanks for the explanation.



 While making self tail-calls into jumps would be easy (after all,
 that's what recur does), doing so implicitly would create the wrong
 expectations for those coming from, e.g. Scheme, which has full TCO.
 So, instead we have an explicit recur construct.


 Essentially it boils down to the difference between a mere
 optimization and a semantic promise. Until I can make it a promise, I'd
 rather not have partial TCO.


To me, it is really only an optimization and I'm very much in the group who
likes the explicit recur statement, since it conveys intent. Therefore I'd
be happy with the partial optimization, though, honestly, not having it
doesn't bother me at all.


 Some people even prefer 'recur' to the redundant restatement of the
 function name. In addition, recur can enforce tail-call position.

 Rich

 --
 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.comclojure%2bunsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en




-- 
Daniel Kersten.

-- 
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: ANN: Aleph, an asynchronous web server

2010-07-09 Thread Daniel Kersten
, is very easy to
 under-estimate in my opinion. It also makes every single call you ever
 make have part of it's public interface whether or not it *might* do
 I/O, which is one particular aspect I really dislike other than the
 callback orientation.

 You also need to consider latency. While some flawed benchmarks where
 people throw some fixed concurrency at a problem will show that
 latency is poor with a threaded model in comparison to an asynch
 model; under an actual reasonable load where the rate of incoming
 requests is not infinitely high, the fact that you're doing
 pre-emption and scheduling across multiple CPU:s will mean that
 individual expensive requests don't cause multiple other smaller
 requests to have to wait for it to complete it's bit of work. So
 again, for CPU-heavy tasks, this is another way in which a threaded
 model can be better unless you very carefully control the amount of
 work done in each reactor loop (presuming reactor pattern) in the
 asynchronous case.

 As far as I can tell, the advantages from an asynchronous model mostly
 come in cases where you either (1) have very high concurrency or (2)
 are doing very very little work for each unit of I/O done, such that
 the cost of context switching is at it's most significant.

 My wet dream is to be able to utilize something like Clojure (or
 anything other than callback/state machine based models) on top of an
 implementation where the underlying concurrency abstraction is in fact
 really efficient (in terms of stack sizes and in terms of switching
 overhead). In other words, the day where having a few hundred thousand
 concurrents connections does *not* imply that you must write your
 entire application to be event based, is when I am extremely happy ;)

 --
 / Peter Schuller

 --
 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.comclojure%2bunsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/clojure?hl=en




-- 
Daniel Kersten.

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