defmethod inside of a (stuart sierra) component?

2015-02-25 Thread Colin Yates
Hi, I have a number of commands flying around which need to be handled. defmulti/defmethod seem a nice answer. The problem is that each command handler will need different collaborators (those with long memories will realise this isn't new ground here ;)). I want to do something like: (ns

should edn recognise defrecord?

2015-02-24 Thread Colin Yates
I am sending instances of defrecords from clojurescript via transmit/edn and getting: 2015-Feb-24 19:23:52 + dev-os-mbp.local DEBUG [taoensso.sente] - Bad package: [[:client/message #health.shared.domain.PingCommand{}]] (clojure.lang.ExceptionInfo: No reader function for tag

Re: Advice on core.async and (JDBC) transactions

2015-02-24 Thread Colin Yates
threads but ensuring that only one thread can use it at same time (as I said previously) using serialization semantics of clojure agents. I hope it has been helpful. Cheers Andrey 2015-02-23 22:26 GMT+01:00 Colin Yates colin.ya...@gmail.com: Thanks Christian, that looks interesting

Re: Advice on core.async and (JDBC) transactions

2015-02-24 Thread Colin Yates
It seems like it is worthwhile to brush up my knowledge then, this looks quite hopeful - thanks! On 24 February 2015 at 10:39, Andrey Antukh n...@niwi.be wrote: 2015-02-24 10:15 GMT+01:00 Colin Yates colin.ya...@gmail.com: Hi Andrey - thanks for responding. Asciidoctor looks great! I think

Re: Current best-of-breed JDBC libraries?

2015-02-24 Thread Colin Yates
PM UTC+1, Colin Yates wrote: Hi all, What are you all using for interacting with an RDBMS? In the past I looked at clojure.java.jdbc, honeysql and korma (and for querying, honeysql just rocks). I have lost touch a bit - any recommendations? Thanks. -- You received this message because you

Current best-of-breed JDBC libraries?

2015-02-24 Thread Colin Yates
Hi all, What are you all using for interacting with an RDBMS? In the past I looked at clojure.java.jdbc, honeysql and korma (and for querying, honeysql just rocks). I have lost touch a bit - any recommendations? Thanks. -- You received this message because you are subscribed to the Google

Re: Current best-of-breed JDBC libraries?

2015-02-24 Thread Colin Yates
Actually, https://github.com/krisajenkins/yesql, now that it supports named parameters is probably just the ticket... On Tuesday, 24 February 2015 14:04:36 UTC, Colin Yates wrote: Hi all, What are you all using for interacting with an RDBMS? In the past I looked at clojure.java.jdbc

Re: Current best-of-breed JDBC libraries?

2015-02-24 Thread Colin Yates
I haven't used it but I remember building up pages of SQL in Clojure wasn't fun. The idea of putting that SQL into a .sql file, accessible by non-Clojure DB developer is very appealing. On 24 February 2015 at 18:24, Niels van Klaveren niels.vanklave...@gmail.com wrote: Perhaps I'm missing

Re: Current best-of-breed JDBC libraries?

2015-02-24 Thread Colin Yates
OK - thanks all. I am surprised that yesql isn't more adopted, particularly now named parameters is there - has anyone run into roadblocks with it? On 24 February 2015 at 16:50, Sean Corfield s...@corfield.org wrote: On Feb 24, 2015, at 6:04 AM, Colin Yates colin.ya...@gmail.com wrote: What

Re: Current best-of-breed JDBC libraries?

2015-02-24 Thread Colin Yates
, if SQL is known up front then it seems very nice. On 24 February 2015 at 18:10, Sean Corfield s...@corfield.org wrote: On Feb 24, 2015, at 9:16 AM, Colin Yates colin.ya...@gmail.com wrote: I am surprised that yesql isn't more adopted, particularly now named parameters is there - has anyone run

Advice on core.async and (JDBC) transactions

2015-02-23 Thread Colin Yates
Currently each request gets serviced in its own thread (web container) and I am thinking of integrating core.async and I wonder how core.async and a JDBC transactional unit of work get on. Conceptually, this model (thread-per-request) is trivial however the problems are well known. Replacing

Re: Advice on core.async and (JDBC) transactions

2015-02-23 Thread Colin Yates
Thanks Christian, that looks interesting. By the way, any idea what tool was used to generate the documentation? On 23 February 2015 at 21:22, Christian Weilbach whitesp...@polyc0l0r.net wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 23.02.2015 18:20, Colin Yates wrote: Currently

Re: Can someone offer refactoring suggestions for my protocol example?

2015-02-23 Thread Colin Yates
A minor point (get col n) is the same as (col n). It's more of a stylistic thing, but your use of protocols and implementation is quite 'stateful'. I would have done the same with vanilla maps: (def employee [first-name last-name level] {:first-name .}) (defn promote [{:keys [level] :as

Re: Can someone offer refactoring suggestions for my protocol example?

2015-02-23 Thread Colin Yates
Unless of course your whole example was to work with Protocols (he says as he notices the file is called protocols.clj in a protocols namespace) in which case - yep, that is fine :). On Monday, 23 February 2015 19:51:00 UTC, Colin Yates wrote: A minor point (get col n) is the same as (col n

Re: ANN: Onyx Dashboard 0.5.2.1

2015-02-19 Thread Colin Yates
://github.com/MichaelDrogalis/onyx-examples). We hang out in Gitter if you have any questions: https://gitter.im/MichaelDrogalis/onyx -- Mike On Wednesday, February 18, 2015 at 10:22:07 AM UTC-8, Colin Yates wrote: Hi Lucas, This looks great - thanks. [off topic] I don't know much about

Re: ANN: Onyx Dashboard 0.5.2.1

2015-02-18 Thread Colin Yates
Hi Lucas, This looks great - thanks. [off topic] I don't know much about Onyx but I am just about to start committing code for server app which is going to use a CQRS design. It doesn't need to be internet scale at all, will be a single machine, and spend all of its time taking a command,

Re: Removing the 5th, 10th, 15th ... element of a list

2015-02-17 Thread Colin Yates
Style police would point out zero? and when-not :). On 17 Feb 2015 20:40, Cecil Westerhof cldwester...@gmail.com wrote: 2015-02-17 20:26 GMT+01:00 Timothy Baldridge tbaldri...@gmail.com: Tweak as needed: (keep-indexed (fn [i v] (if (= 0 (mod i 5))

Re: Removing the 5th, 10th, 15th ... element of a list

2015-02-17 Thread Colin Yates
that runs every snippet posted to this mailing list through kibit (https://github.com/jonase/kibit). On Tue, Feb 17, 2015 at 1:49 PM, Colin Yates colin.ya...@gmail.com wrote: Style police would point out zero? and when-not :). On 17 Feb 2015 20:40, Cecil Westerhof cldwester...@gmail.com wrote

Re: OO Programmer trying to move to Clojure: Namespace Organization

2015-02-11 Thread Colin Yates
I wouldn't get too hung up on imitation as whilst there are style guides [1] I you will find a lot of diversity in published Clojure code. I would suggest you internalise the style guide, lean on lein kibit and lein eastwood and then do some navel gazing and ask yourself what problem you are

Re: OO Programmer trying to move to Clojure: Encapsulation

2015-02-08 Thread Colin Yates
of maps [{..} {..} ...] and can be sufficiently transformed with the 'map' function (with assoc/assoc-in). On Sunday, 8 February 2015 17:16:40 UTC, Colin Yates wrote: +1 This separation of behaviour and state is a key part of Clojure's philosophy. That isn't to say that stateful components

Re: OO Programmer trying to move to Clojure: Encapsulation

2015-02-08 Thread Colin Yates
+1 This separation of behaviour and state is a key part of Clojure's philosophy. That isn't to say that stateful components are bad as such (Stuart Sierra's https://github.com/stuartsierra/component is an obvious analog here) only that they aren't a given as they are in OO languages. As Jony

Re: which are the pros and cons between stuartsierra/component and prismatic/graph?

2015-02-04 Thread Colin Yates
You might also want to consider prismatic schema if you are evaluating your tool stack. I too would condone component, and the various component compatible libs that have sprung up. -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this

Re: Clojure for Desktop UI Design Application

2015-01-13 Thread Colin Yates
IntelliJ is swing! Well, knock me other with a feather :). Still wouldn't want to go anywhere near building a Swing app though :). On 14 Jan 2015 01:36, Colin Fleming colin.mailingl...@gmail.com wrote: On 14 January 2015 at 05:50, Colin Yates colin.ya...@gmail.com wrote: My evolution of Java

Re: Clojure for Desktop UI Design Application

2015-01-13 Thread Colin Yates
Wow, there is a lot to deal with :), so let me throw out some ideas: - have you considered building a web-app instead of a desktop app? If so, have a look at one of the react based languages (om or reagent would be my choice). Alternatively take a look at other

Re: Clojure for Desktop UI Design Application

2015-01-13 Thread Colin Yates
you're into the fun land of writing a library in order to write your app. On Tue, Jan 13, 2015 at 8:15 AM, Colin Yates colin.ya...@gmail.com wrote: Wow, there is a lot to deal with :), so let me throw out some ideas: - have you considered building a web-app instead of a desktop app? If so, have

Re: Clojure for Desktop UI Design Application

2015-01-13 Thread Colin Yates
you're into the fun land of writing a library in order to write your app. On Tue, Jan 13, 2015 at 8:15 AM, Colin Yates colin...@gmail.com wrote: Wow, there is a lot to deal with :), so let me throw out some ideas: - have you considered building a web-app instead of a desktop app? If so, have

Re: TDD and lein

2015-01-09 Thread Colin Yates
Hi Andrea, have you checked the doc at https://github.com/clojure-emacs/cider? It as a bunch of very useful shortcuts, including the ability to send either eval current buffer, the current form or the outer most form. On 9 January 2015 at 12:15, andrea crotti andrea.crott...@gmail.com wrote:

Re: TDD and lein

2015-01-08 Thread Colin Yates
If you want to automate any lein X process then lein auto is the thing to use. However, there are a few runners which will monitor changes and then run the tests whilst maintaining a lein process so they are really quick. I personally use https://github.com/jakepearson/quickie, just start lein

Re: TDD and lein

2015-01-08 Thread Colin Yates
Not sure if you know about them but the following are great resources for finding libraries: - http://www.clojure-toolbox.com/ - https://github.com/technomancy/leiningen/wiki/Plugins - http://clojure-libraries.appspot.com/ - https://github.com/trending?l=clojure (to keep up with the cool

Re: How to handle refactoring with TDD and mocking/stubbing

2015-01-06 Thread Colin Yates
I don't think there is an easy answer here, and note that this is a problem generic to mocking (i.e. not clojure or midje specific). The usual advice applies though: - do you really need to mock? Unit testing is about the coarseness of granularity which is defined more by cohesion and

Re: How to handle refactoring with TDD and mocking/stubbing

2015-01-06 Thread Colin Yates
, write more specific tests. In short: System (integration) tests: so I feel good about my codebase Unit (smaller) tests: so I can figure out what went wrong when the larger tests fail. Timothy On Tue, Jan 6, 2015 at 6:26 AM, Colin Yates colin.ya...@gmail.com wrote: I don't think

Re: How to handle refactoring with TDD and mocking/stubbing

2015-01-05 Thread Colin Yates
(Happy new year all!) I have thousands of lines of tests written using Midje and it was the second one I turned to when I started using Clojure full-time a couple of years ago. I think it would be fairer to say that Midje is powerful enough to hang yourself, but that doesn't make that power

Re: what do you think about this code?

2014-12-14 Thread Colin Yates
From my own experience I think the following is relevant: - functions are either specific to a context or abstract. Specific functions need to be understood in the context of their call site and the domain. Trying to make the name of the specific functions capture the entire context leads to

Re: what do you think about this code?

2014-12-14 Thread Colin Yates
and write these responses whilst entertaining 4 under 10s :). On 14 Dec 2014 10:32, Colin Yates colin.ya...@gmail.com wrote: From my own experience I think the following is relevant: - functions are either specific to a context or abstract. Specific functions need to be understood

Re: what do you think about this code?

2014-12-13 Thread Colin Yates
programming? Philip On Saturday, 6 December 2014 18:40:16 UTC, Colin Yates wrote: Excellent question and I will be watching this thread with interest. Similar to David Della Costa, I find a bit difference between Clojure and Java for example is that there is much less naming-of-concepts

Re: what do you think about this code?

2014-12-09 Thread Colin Yates
I forgot to mention but https://github.com/bbatsov/clojure-style-guide is a pretty good resource. On 9 Dec 2014 00:24, Philip Schwarz philip.johann.schw...@googlemail.com wrote: Hello David, I had set myself the constraint that I wanted the solution to exploit two symmetries: (1) The top

Re: what do you think about this code?

2014-12-09 Thread Colin Yates
Identifying the requirements for maintainable is the key and as far as I know we as a software industry aren't close to solving it. Whilst programs are written by those bags opinionated, subjective and finicky bags of water known as people it will also be elusive as maintenance has to be at least

Re: what do you think about this code?

2014-12-09 Thread Colin Yates
Nice presentation (although I didn't see anything about comments. ?.). As I mentioned before, there seem to be significantly less examples of capturing semantic knowledge in names. I think a significant reason is the higher level abstractions you get to play with in FP and Clojure. This leads to

Re: what do you think about this code?

2014-12-06 Thread Colin Yates
Excellent question and I will be watching this thread with interest. Similar to David Della Costa, I find a bit difference between Clojure and Java for example is that there is much less naming-of-concepts. Clojure code tends to be much more about the shape of transformations than the

Re: Server Sent Events under Http-Kit

2014-12-06 Thread Colin Yates
Have you looked at sente? On Saturday, 6 December 2014 17:03:41 UTC, Lars Ole Avery Simonsen wrote: Hi guys I am trying to implement Server Sent Event support in a small hobby project based on the http-kit server framework and compojure. I am still quite new to clojure in general, so it

Re: Clarity on Stuart Sierra's component system

2014-12-05 Thread Colin Yates
/system On Friday, November 28, 2014 12:28:45 PM UTC+2, Colin Yates wrote: Hi all, Am I right in thinking that in order to use https://github.com/ stuartsierra/component every consumer of a component must also be a component? For example, if I have a component DB and I want to use that DB

Clarity on Stuart Sierra's component system

2014-11-28 Thread Colin Yates
Hi all, Am I right in thinking that in order to use https://github.com/stuartsierra/component every consumer of a component must also be a component? For example, if I have a component DB and I want to use that DB in (defn blob-query [db criteria]...), do I pull the DB out of the system map

Re: Clarity on Stuart Sierra's component system

2014-11-28 Thread Colin Yates
at 15:00, James Reeves ja...@booleanknot.com wrote: On 28 November 2014 at 10:28, Colin Yates colin.ya...@gmail.com wrote: Am I right in thinking that in order to use https://github.com/stuartsierra/component every consumer of a component must also be a component? Nope. For example, if I

Re: Clarity on Stuart Sierra's component system

2014-11-28 Thread Colin Yates
that changes over time), but it does have a notion of start/stopping. This would be a good candidate because it has a lifecycle. Thanks again. On 28 November 2014 at 15:54, James Reeves ja...@booleanknot.com wrote: On 28 November 2014 at 15:20, Colin Yates colin.ya...@gmail.com wrote: I guess I

How to supress warning when including cljx?

2014-11-27 Thread Colin Yates
I have included cljx and everytime lein starts it gives the following: [code] WARNING!!! version ranges found for: [com.keminglabs/cljx 0.4.0] - [org.clojars.trptcolin/sjacket 0.1.0.6] - [org.clojure/clojure [1.3.0,)] Consider using [com.keminglabs/cljx 0.4.0 :exclusions [org.clojure/clojure]].

Re: Thnx for clojureconj videos !!

2014-11-24 Thread Colin Yates
+1. I couldn't make it either (coming from the UK just wasn't feasible) and it is just fantastic to be able to catch up. Clojure Gazette (http://us4.campaign-archive2.com/?u=a33b5228d1b5bf2e0c68a83f4id=a358c38217e=0ebb9aee00) is also really useful as a guide. On Saturday, 22 November 2014

Re: testing platform , midje or specjl ?

2014-11-15 Thread Colin Yates
Hi Steve, https://github.com/technomancy/leiningen/wiki/Plugins has a few listed. There is also the non-specific https://github.com/weavejester/lein-auto as well. Hope this helps, and good luck testing! Colin On 15 Nov 2014 20:19, Steve Ford fordsfo...@gmail.com wrote: Hi Colin I'm a

Re: testing platform , midje or specjl ?

2014-11-15 Thread Colin Yates
As a P.S. I did say it was more opinionated, but on hindsight I am not sure that is the right phrase. I meant that it was intentionally simple so there was less room to hang yourself as oppose to midje which is excellent but can more easily accommodate poor behaviour. For example, in the early

Re: ClojureScript and development workflow

2014-11-08 Thread Colin Yates
Figwheel plus om plus immutable data is just great. Throw in lein garden auto and the world is a better place. Highly recommend it. On Friday, 7 November 2014 02:17:08 UTC, Daniel Szmulewicz wrote: My experience has been that the promise of hot reloadable code in the browser was fulfilled

Re: CCW bug [SEVERE]

2014-10-31 Thread Colin Yates
+1. When I first read that post I thought he was joking! On Tuesday, 28 October 2014 16:19:29 UTC, Marcus Blankenship wrote: Agreed. I've been amazed at how kind this group has been, despite your attitude of disrespect toward them. On Tue, Oct 28, 2014 at 9:09 AM, Dylan Butman

Re: Testing and infrastructure management for large Clojure app - how are you doing it?

2014-10-29 Thread Colin Yates
, Colin Yates wrote: Hi David, Your post is very technology orientated (which is fine!). Have you looked into BDD type specifications? I am talking specifically the process described in http://specificationbyexample.com/. If you haven't, I strongly recommend you do as the win

Re: Testing and infrastructure management for large Clojure app - how are you doing it?

2014-10-29 Thread Colin Yates
, but maybe that's just something we need to live with. If anyone else has any thoughts, I'd REALLY appreciate hearing about them. Thanks again to Colin and Craig On Tuesday, 28 October 2014 20:04:39 UTC+11, Colin Yates wrote: Hi David, Your post is very technology orientated (which is fine

Re: Testing and infrastructure management for large Clojure app - how are you doing it?

2014-10-28 Thread Colin Yates
Hi David, Your post is very technology orientated (which is fine!). Have you looked into BDD type specifications? I am talking specifically the process described in http://specificationbyexample.com/. If you haven't, I strongly recommend you do as the win in this situation is they separate the

Re: testing platform , midje or specjl ?

2014-10-28 Thread Colin Yates
Hi Roelof, I have used midje for a few years now and it is excellent. It was the first one I picked up. However, I would recommend clojure.test *whilst learning* for a few reasons: - it is sufficient - it is opinionated and therefore keeps you on the straight and narrow - it is (probably) the

Deployment choices WAR or lein or java -jar for web apps?

2014-10-28 Thread Colin Yates
Hi all, How do you delight the world with your beautiful works of art once you have finished lovingly crafting them from the joy that is Clojure? I have a legacy in J2EE so I use ring uberwar and deploy to a servlet container (Tomcat as it is the most seamless on Windows), but I notice more

Re: Deployment choices WAR or lein or java -jar for web apps?

2014-10-28 Thread Colin Yates
provides. On Tuesday, 28 October 2014 17:21:34 UTC+8, Colin Yates wrote: Hi all, How do you delight the world with your beautiful works of art once you have finished lovingly crafting them from the joy that is Clojure? I have a legacy in J2EE so I use ring uberwar and deploy to a servlet

Re: Deployment choices WAR or lein or java -jar for web apps?

2014-10-28 Thread Colin Yates
October 2014 17:21:34 UTC+8, Colin Yates wrote: Hi all, How do you delight the world with your beautiful works of art once you have finished lovingly crafting them from the joy that is Clojure? I have a legacy in J2EE so I use ring uberwar and deploy to a servlet container (Tomcat

Re: testing platform , midje or specjl ?

2014-10-28 Thread Colin Yates
October 2014 18:33, Roelof Wobben rwob...@hotmail.com wrote: Hello Colin, Do you know any good tutorials about learning clojure.test. ? Roelof Op dinsdag 28 oktober 2014 10:16:19 UTC+1 schreef Colin Yates: Hi Roelof, I have used midje for a few years now and it is excellent

Re: CCW bug [SEVERE]

2014-10-28 Thread Colin Yates
I think you are missing the point of the backlash (my word). Nobody is arguing that the functionality (e.g. crash) you are seeing isn't troublesome. A few people tried to mitigate that by suggesting workarounds *whilst still accepting the functionality isn't sufficient*. I haven't read a

Re: Starting a project the right way - tips?

2014-10-27 Thread Colin Yates
application. There's also Ring-Defaults https://github.com/ring-clojure/ring-defaults, which provides sensible and customisable default middleware settings. - James On 27 October 2014 11:07, Colin Yates colin...@gmail.com javascript: wrote: About to embark on a new project and interested

Re: Cannot understand why I get this output.

2014-10-27 Thread Colin Yates
Wild Seed, :authors [octavia]}) See exercise 22 on this page : http://iloveponies.github.io/120-hour-epic-sax-marathon/structured-data.html#exercise-22 Roelof Op maandag 27 oktober 2014 14:52:23 UTC+1 schreef Colin Yates: (get book :authors) is saying return the value of the :authors key

Re: [ClojureScript] Re: [ANN] Silk, an isomorphic routing library for Clojure and ClojureScript

2014-10-14 Thread Colin Yates
Thanks both. On 13 October 2014 04:27, Dom Kiva-Meyer li...@domkm.com wrote: Thanks for the experience reports, Dylan! Colin, Silk is Ring-compatible and meant to be used as a single replacement for both Compojure and Secretary (or any other server/browser routing combination with

Re: [ANN] Silk, an isomorphic routing library for Clojure and ClojureScript

2014-10-10 Thread Colin Yates
For clarity, can you confirm the relationship between this and ring and compojure? Am I right in saying the defined routes are ring compatible (using domkm.silk.serve) and therefore silk is a replacement for compojure (albeit compojure has some more middleware utilities)? I understand I can

Re: Seeking Large Companies That Employ Clojure

2014-10-10 Thread Colin Yates
+1. Or even worse, this is an opportunity to be put on yet another recruiter’s automated job listing email :). If this is some initiative for knowledge reaping/sharing in terms of Clojure best practices/engineering practices then why not use one of the many transparent mechanism (like this

Re: Advice for building backend REST services from scratch using clojure

2014-10-06 Thread Colin Yates
there. I personally wouldn't work for you if you forced me to use it, but that's just me :-) On 11 April 2014 22:04, Colin Yates colin...@gmail.com javascript: wrote: Colin - you are right - I shouldn't throw out such inflammatory marks, particularly when they do a disservice

Re: tomcat 6/7 stream closed error in ring json - works in lein ring server

2014-09-03 Thread Colin Yates
: ring.middleware.json$wrap_json_body$fn__1031.invoke(json.clj:19) ring.middleware.json$wrap_json_params$fn__1035.invoke(json.clj:31) Both middleware read from the body InputStream, so one of them is going to fail when you try and read the body twice. - James On 4 November 2013 00:20, Colin Yates

Create an instance of a record using a string to define the record's symbol

2014-08-06 Thread Colin Yates
Hi, tldr; if I have a (defrecord MyRecord) in ns a.b.c and I have a string a.b.c.MyRecord how I can invoke (a.b.c.MyRecord.) (or (new a.b.c.MyRecord)? I thought this was going to be as simple as (defn cfn a.b.c.MyRecord) ((symbol cfn).) but that throws an ArityException: wrong number of args

Re: Create an instance of a record using a string to define the record's symbol

2014-08-06 Thread Colin Yates
constructor, you need reflection. user= (defrecord B [c]) user.B user= (def s user.B) #'user/s user= (.newInstance (first (.getDeclaredConstructors (Class/forName s))) (object-array [1])) #user.B{:c 1} Thanks, Ambrose On Wed, Aug 6, 2014 at 6:37 PM, Colin Yates colin.ya...@gmail.com wrote

Re: Create an instance of a record using a string to define the record's symbol

2014-08-06 Thread Colin Yates
Thanks both. On Wednesday, 6 August 2014 12:02:59 UTC+1, Ambrose Bonnaire-Sergeant wrote: The `new` reader macro must resolve its first argument at compile time. That's why (new (symbol s)) doesn't work. Thanks, Ambrose On Wed, Aug 6, 2014 at 6:55 PM, Colin Yates colin...@gmail.com

Re: Is Korma still a good current choice for DB backend?

2014-07-23 Thread Colin Yates
Another very satisfied honeysql user here. It matches this use case perfectly. On Wednesday, 23 July 2014 10:15:09 UTC+1, David Powell wrote: I'm using honeysql for constructing dynamic queries (eg conditionally adding complex clauses). It feels a bit more composable to me, and seemed

Idiomatic clojure on building a sequence

2014-05-21 Thread Colin Yates
I often find myself doing the following: (let [some-seq [] some_seq (if some-condition? (conj some-seq some-element) some-seq) some_seq (if some-other-condition? (conj some-seq some-other-element) some-seq) some_seq etc.]) In other words building up a sequence which contains

Re: Idiomatic clojure on building a sequence

2014-05-21 Thread Colin Yates
cond2 [end elements])) This also composes nicely with function calls. Another option for a subset of cases: (cond- start-vec condition1 (conj end-element1) condition2 (conj end-element2)) kind regards 2014-05-21 18:23 GMT+02:00 Colin Yates colin...@gmail.com javascript:: I often

Style - Keyword access or accessors?

2014-04-22 Thread Colin Yates
(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

Re: Style - Keyword access or accessors?

2014-04-22 Thread Colin Yates
: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...@gmail.com javascript:wrote: (This has been discussed before but as this is fairly subjective I am interested in whether people's

Re: Style - Keyword access or accessors?

2014-04-22 Thread Colin Yates
Nice. On Tuesday, April 22, 2014 11:36:06 AM UTC+1, Jim foo.bar wrote: there is really no reason to use `get-in` with keywords/symbols as they know how to look themselves up...in other words, you don't need to pay for any polymorphic calls : (get-in [:a :b :c :d] someMap) = (- someMap :a

Re: where as clojure-fill-docstring gone?

2014-04-22 Thread Colin Yates
Thanks Bastien - I will wait until it lands in ELPA and try it then. On Tuesday, April 22, 2014 3:11:15 PM UTC+1, Bastien Guerry wrote: Hi Colin, Bastien bastie...@gmail.com javascript: writes: That said, there are some quirks. I'm sick now and cannot fix those problems, but please

Re: Style - Keyword access or accessors?

2014-04-22 Thread Colin Yates
this is the exception rather than the rule. defrecord (or add-ons like Prismatic's schema library) can formalize the contents of your entities and provide documentation and validation where and how you need it. On Tuesday, April 22, 2014 4:43:53 AM UTC-5, Colin Yates wrote: (This has been

Re: Style question (predicates)

2014-04-17 Thread Colin Yates
My 2p - I interpret the contract as being boolean. Truthy values are 'polymorphically' equivalent*1 so sure. The concern would be people relying on the implementation and treating the values as none-truthy (i.e. in your example relying on the fact it is a string being returned, so (=

Re: Extending a data model

2014-04-15 Thread Colin Yates
Multimethods are fantastic and do indeed work across namespaces if by across namespaces you mean you can defmethod in ns2 a defmulti in ns1. On Tuesday, April 15, 2014 2:56:30 AM UTC+1, Andrew Chambers wrote: An update, I read about protocols and multimethods. I think multimethods are a

Re: Advice for building backend REST services from scratch using clojure

2014-04-11 Thread Colin Yates
As others have said - a more focused question would help. Our back end runs on ring + compojure using https://github.com/jkk/honeysql for querying and straight https://github.com/clojure/java.jdbc for writes. We use https://github.com/marick/Midje/wiki rather than clojure.test and

Re: Advice for building backend REST services from scratch using clojure

2014-04-11 Thread Colin Yates
you hives. On 11 April 2014 20:17, Colin Yates colin...@gmail.com javascript:wrote: As others have said - a more focused question would help. Our back end runs on ring + compojure using https://github.com/jkk/honeysql for querying and straight https://github.com/clojure/java.jdbc

Re: Real World Example

2014-04-09 Thread Colin Yates
Hello back! We are using Clojure on the JVM as the implementation language for a platform that will underpin our applications for the next decade. It is relatively new and so far we have implemented the analysis module which is essentially a generic charting engine. So far we have 5547

Re: Real World Example

2014-04-09 Thread Colin Yates
09:14:38 UTC+1, Colin Yates wrote: Hello back! We are using Clojure on the JVM as the implementation language for a platform that will underpin our applications for the next decade. It is relatively new and so far we have implemented the analysis module which is essentially a generic

Re: Real World Example

2014-04-09 Thread Colin Yates
Hi Fergal, Thanks for those links. I started using protocols and defrecords but I (maybe mistakenly) got the impression that they were frowned upon. As it turns out, maps (typically with a :type key) and multi methods go a long long way, but I still end up with fairly deep nesting of maps.

Re: Real World Example

2014-04-09 Thread Colin Yates
) at the moment, it's just wonderful. [1] https://github.com/zcaudate/adi Regards, Fergal Byrne On Wed, Apr 9, 2014 at 12:22 PM, Colin Yates colin...@gmail.comjavascript: wrote: Hi Fergal, Thanks for those links. I started using protocols and defrecords but I (maybe mistakenly

Re: every? expected behavior

2014-04-08 Thread Colin Yates
Depends who is doing the expecting as to whether that behaviour is correct. Formal logicians, mathematicians, computer scientists etc. would respond sure, it is vacously true. For almost everybody else it feels wrong but is then true when you think about it a bit. I would suggest the

where as clojure-fill-docstring gone?

2014-04-08 Thread Colin Yates
I upgraded my emacs and clojure-fill-docstring seems to have disappeared. clojure-mode is still there and activated but no clojure-fill-docstring. Before I spend time hunting through changelogs has anybody else noticed? Is this expected? -- You received this message because you are

Re: where as clojure-fill-docstring gone?

2014-04-08 Thread Colin Yates
Hi Bastian, sucks being sick. You mention it was unnecessary - can you let me know the thing that made it redundant? I tried fill-paragraph but that doesn't quite work... On Tuesday, 8 April 2014 20:28:52 UTC+1, Bastien Guerry wrote: Hi Colin, Colin Yates colin...@gmail.com javascript

RE: where as clojure-fill-docstring gone?

2014-04-08 Thread Colin Yates
:33 +0200 Colin Yates colin.ya...@gmail.com writes: Hi Bastian, sucks being sick. You mention it was unnecessary - can you let me know the thing that made it redundant? It was less redundant than weird. I tried fill-paragraph but that doesn't quite work... Can you explicit what

Re: Alternative - macro for threading sequences?

2014-02-06 Thread Colin Yates
To be honest I prefer the first although I get your point about the over simplification. If I were going anywhere with this it would be to generalise it into a provided processor, something like: (- :processor map things wrangle ... ) but I am not sure the cognitive load of the extra

Re: Lessons Learned from Adopting Clojure

2014-02-05 Thread Colin Yates
Interesting - thanks all. My experience of Light Table is quite close to Norman's, although I discounted that *in my case* to not spending enough time with it. Knowing a little about who Sean is (from following your blog/comments/clojure.jdbc, not stalking! :)) I put a lot of weight behind

Re: Confused by Clojure floating-point differences (compared to other languages)

2014-02-05 Thread Colin Yates
Did I see a thread a while ago where doing this caught some people out because it wiped out some other performance switches? I can't find the thread. Apologies if I am spreading FUD On Wednesday, 5 February 2014 23:05:18 UTC, Alex Miller wrote: To override the default tiered

Re: How to organize clojure functions? A clojure newbie here...

2014-02-04 Thread Colin Yates
I think the right (or maybe idiomatic is a better word) organisation is an effect of a very important cause - changing the way you think about a software system. Simplistically, OO promises to be a world full of chunks of knowledge and behaviour that politely ask other chunks to behave in a

Re: Coverage tools in Clojure

2014-02-04 Thread Colin Yates
I don't know. But maybe the lack of coverage tools is itself interesting? My (not quite formed/making this up as I go) view is that maybe coverage tools are there to address the implicit complexity in other mainstream languages and/or to help mitigate the risk of the potentially large and

Re: Coverage tools in Clojure

2014-02-04 Thread Colin Yates
On Tue, Feb 04, 2014 at 03:19:05AM -0800, Colin Yates wrote: I don't know. But maybe the lack of coverage tools is itself interesting? My (not quite formed/making this up as I go) view is that maybe coverage tools are there to address the implicit complexity in other mainstream

Re: Lessons Learned from Adopting Clojure

2014-02-04 Thread Colin Yates
Is there going to be online access during/after the event? I would greatly value seeing this, but probably not enough to travel from the UK to Chicago :). On Tuesday, 4 February 2014 12:06:06 UTC, Jay Fields wrote: tl; dr: I'm presenting Lessons Learned from Adopting Clojure in Chicago on

Re: Coverage tools in Clojure

2014-02-04 Thread Colin Yates
if there are any logical errors in your code which cause the branches to not be hit. Aaron On Tue, Feb 04, 2014 at 03:19:05AM -0800, Colin Yates wrote: I don't know. But maybe the lack of coverage tools is itself interesting? My (not quite formed/making this up as I go) view is that maybe

Re: Coverage tools in Clojure

2014-02-04 Thread Colin Yates
04, 2014 at 04:18:30AM -0800, Colin Yates wrote: Comments in line. On Tuesday, 4 February 2014 11:23:36 UTC, Aaron France wrote: I don't want to seem rude but I think you've drank a bit too much kool-aid. You know the phrase I don't want to seem rude doesn't actually do

Re: Coverage tools in Clojure

2014-02-04 Thread Colin Yates
programming's panacea? Aaron On Tue, Feb 04, 2014 at 06:12:18AM -0800, Colin Yates wrote: This has turned into an unconstructive argument and for whatever reason we don't seem to be communicating clearly. Shame as I (and probably most people on here) only want to help. You seem

Re: Coverage tools in Clojure

2014-02-04 Thread Colin Yates
automatically somehow gives you insight into the coverage of your tests. Which it does not. You still maintain this. On Tue, Feb 04, 2014 at 06:28:51AM -0800, Colin Yates wrote: I have no idea why you aren't gushing. I'm not gushing, and haven't gushed about anything technical for years

<    1   2   3   4   5   6   >