Re: too circular?

2013-08-26 Thread Sean Corfield
If you want the sequence itself, so you can take various prefixes of it: (def fib (cons 1 (cons 1 (map + fib (rest fib) (take 5 fib) (take 10 fib) Has the advantage of not recalculating any part of it - and the disadvantage of holding onto the head - so it depends what you want to do with

Re: How to send GET http request with range header, using clj-http or http-kit?

2013-08-24 Thread Sean Corfield
Can't you just do (get ... {:headers {..}}) and pass the range header that way? On Sat, Aug 24, 2013 at 8:12 PM, Seven Hong sir.seven.h...@gmail.com wrote: Hi all: I am trying to grab down a segment of a file on a http server, so technically I should send a GET message with a range header

Re: Two Way DOM binding in clojurescript

2013-08-22 Thread Sean Corfield
flapjax seems to be abandonware? Last source update a year ago, last website update two years ago. Or is it just one of those rare completely stable, needs no enhancements libraries? On Thu, Aug 22, 2013 at 1:09 AM, ewen.grosj...@free.fr wrote: Hi, you might be interested in flapjax-cljs, a

Re: Two Way DOM binding in clojurescript

2013-08-22 Thread Sean Corfield
On Thu, Aug 22, 2013 at 2:41 PM, ewen.grosj...@free.fr wrote: I don't know. My guess would be that it is some kind of an academic project that evolve mostly when a student decides to work on it during a project (thus not often). The mailing list is still active though. Good to know, thanx.

Re: [ANN] Leiningen 2.3.2 released

2013-08-21 Thread Sean Corfield
#1150 and #1292 on Windows, tested on Windows 7 and Windows XP. Is there any particular issue# your use case relates to? Please mention/file the issues -- I will see if I can find a fix. Shantanu On Wednesday, 21 August 2013 10:43:36 UTC+5:30, Sean Corfield wrote: Upgrading on Mac/Linux

Re: [ANN] Leiningen 2.3.2 released

2013-08-21 Thread Sean Corfield
Does that work to upgrade an already installed version of Leiningen? On Wed, Aug 21, 2013 at 9:50 AM, David Powell djpow...@djpowell.net wrote: Have you tried http://leiningen-win-installer.djpowell.net/ - it should work... -- Dave On Wed, Aug 21, 2013 at 6:13 AM, Sean Corfield seancorfi

Re: [ANN] Leiningen 2.3.2 released

2013-08-21 Thread Sean Corfield
, 2013 at 5:57 PM, Sean Corfield seancorfi...@gmail.com wrote: Does that work to upgrade an already installed version of Leiningen? Not really. But if you took your existing leiningen off the path, and ran the installer it might get things up and running: It bundles a wget with an appropriate

Re: [ANN] Leiningen 2.3.2 released

2013-08-21 Thread Sean Corfield
be interested to see what lein upgrade does next time on Windows, now that I'm running the latest .bat file. If it suggests editing the file, I'll open an issue :) Sean On Wed, Aug 21, 2013 at 10:46 AM, Sean Corfield seancorfi...@gmail.com wrote: I have a working Leiningen. I have wget

Re: [ANN] Leiningen 2.3.2 released

2013-08-21 Thread Sean Corfield
I went back to my Windows 8 laptop and updated lein.bat to the version on leiningen.org and then tested the up/down-grades and they worked perfectly - great to see the latest Windows batch file working so well! Sean On Wed, Aug 21, 2013 at 3:21 PM, Sean Corfield seancorfi...@gmail.com wrote

Re: [ANN] Immutant 1.0.0 released

2013-08-20 Thread Sean Corfield
1:22:05 PM UTC-4, Sean Corfield wrote: Great news! Every conference I've been to lately, I've been bugging the OpenShift guys - I know they have been rewriting the cartridge spec so I'm glad to hear an Immutant cartridge is coming. Once that cartridge is available, I'll have a play with it (I

Re: Multiple Clojure contexts in the same JVM

2013-08-20 Thread Sean Corfield
Just FYI (and you probably already know this David), most of the clojure.lang.RT class is considered an implementation detail and is subject to change without notice. I believe 1.6 will bring a new API that is intended to provide a supported way to embed Clojure into JVM-based applications. Based

Re: send agent inside doseq

2013-08-20 Thread Sean Corfield
Very likely Juan, as seen here: (let [agents (map agent (range 30 35))] (doseq [a agents] (send a + 100) (println @a)) (doseq [a agents] (println @a))) For me that prints: 30 31 32 33 34 130 131 132 133 134 but I suspect that's more luck that anything since there's no reason

Re: as- macro enhancement request?

2013-08-20 Thread Sean Corfield
Your example could be written: (- foo bar (baz quuz) blah) But I suspect you meant something like this: (- foo bar (as- (baz whiz quuz)) blah) In other words, you use as- with - for just those cases where you need something that isn't in the first or last argument

Re: [ANN] Leiningen 2.3.2 released

2013-08-20 Thread Sean Corfield
Upgrading on Mac/Linux was painless as usual - and everything here seems to run fine with 2.3.2 - but Windows continues to be a pain in the rear... You can't lein upgrade so I updated the version string in lein.bat and tried lein self-install: C:\Users\Seanlein self-install Downloading Leiningen

Re: send agent inside doseq

2013-08-20 Thread Sean Corfield
On Tue, Aug 20, 2013 at 9:31 PM, Kuba Roth kuba.r...@gmail.com wrote: The reason I looked into 'intern' can only be explained by totally lack of experience in Clojure and more general functional programming. Ah, is your background OOP? You'll find the functional world is pretty different. No

[ANN] FW/1 0.2.1 for Clojure released

2013-08-19 Thread Sean Corfield
What: Framework One - a lightweight MVC framework for convention-based Clojure web application development. Where: https://github.com/framework-one/fw1-clj Usage: Easiest way to get started: lein new fw1 myapp cd myapp PORT= lein run Now you have a minimal web

Re: Current state of the art in Web deployment?

2013-08-18 Thread Sean Corfield
On Sun, Aug 18, 2013 at 9:21 AM, John Jacobsen eigenhom...@gmail.com wrote: My main concern was just the need to ssh into the server and run leiningen in the background, as opposed to setting up a real server which starts at boot time. I'm OK w/ wrapping 'lein ring server-headless' with

[ANN] clj-time 0.6.0 released - some API deprecations

2013-08-18 Thread Sean Corfield
What: A Clojure wrapper for Joda Time Where: https://github.com/clj-time/clj-time Details: An API cleanup that deprecates several inconsistent / abbreviated names and introduces preferred replacements. Deprecated API will remain under 0.7.0 so you will have plenty of time to update

Re: What's your preference, partial or closures?

2013-08-18 Thread Sean Corfield
You're crazy :) On Sun, Aug 18, 2013 at 9:04 PM, Chris Allen callen.2...@gmail.com wrote: Am I crazy or does this scream macro? On Saturday, August 17, 2013 6:02:03 PM UTC-7, Sean Corfield wrote: On Sat, Aug 17, 2013 at 5:43 PM, yair yair...@gmail.com wrote: What do you mean by currying

Re: vec to map with consolidated vals

2013-08-17 Thread Sean Corfield
merge-with + (map (partial apply hash-map) parts))) I like this one because it describes the solution the way I thought about it - I just didn't know about merge-with. It also has the benefit of using core fns rather than anonymous fns. WDYT? On Sat, Aug 17, 2013 at 7:23 AM, Sean Corfield

Re: function creation, partial or #()

2013-08-17 Thread Sean Corfield
limited context. On Friday, August 16, 2013, Sean Corfield wrote: On Fri, Aug 16, 2013 at 4:32 PM, Timothy Baldridge tbaldri...@gmail.com wrote: I'm just going to throw this out there, but I almost always consider using #() instead of (fn []) to be bad practice. I still use

Re: What's your preference, partial or closures?

2013-08-17 Thread Sean Corfield
On Sat, Aug 17, 2013 at 5:43 PM, yair yair@gmail.com wrote: What do you mean by currying in this context? Is there a way to do this in clojure apart from using partial? (defn some-func ([a b c] (process a b c)) ([a b] (fn [c] (some-func a b c))) ([a] (fn ([b] (fn [c] (some-func

Generating a Java bean via Clojure?

2013-08-16 Thread Sean Corfield
I was working with a Java library recently and needed to create a Java bean to pass into it. It can be done via `gen-class` but it seems kind of verbose having to explicitly write out all of the getters and setters, and it seems you could also do it via `deftype` but that's also rather painful (I

Re: What's your preference, partial or closures?

2013-08-16 Thread Sean Corfield
I went down the partial path for a long time but have moved more and more toward currying and closures lately as it seems to produce cleaner code - and this also seems to be the way Clojure/core have moved with the reducers library and other places...? Sean On Fri, Aug 16, 2013 at 3:00 PM, Alan

Re: function creation, partial or #()

2013-08-16 Thread Sean Corfield
On Fri, Aug 16, 2013 at 4:32 PM, Timothy Baldridge tbaldri...@gmail.com wrote: I'm just going to throw this out there, but I almost always consider using #() instead of (fn []) to be bad practice. I still use #() for anonymous single argument functions that are small, single forms, but I've

Re: vec to map with consolidated vals

2013-08-16 Thread Sean Corfield
How about this: (defn to-consolidated-map [parts] (apply merge-with concat (map (fn [[k v]] {k (list v)}) parts))) On Fri, Aug 16, 2013 at 9:57 PM, David Chelimsky dchelim...@gmail.com wrote: I've got a vector of 2-element vectors e.g. [[:a 1] [:b 2]] where the first val of any vec might

Re: clojure.java.jdbc, idiomatic way to use a connection

2013-08-14 Thread Sean Corfield
The `db-spec` can have a `:connection` member and all operations will use that. You are responsible for closing it when you're done. Something like (untested, off the top of my head): (with-open [conn (get-connection db-spec)] (let [db (assoc db-spec :connection conn)] ... (query db

Re: [ANN] Leiningen 2.3.1 released

2013-08-13 Thread Sean Corfield
Thank you! I've upgraded our team to 2.3.1, as well as our QA system. So far, no problems. Sean On Tue, Aug 13, 2013 at 10:37 AM, Phil Hagelberg p...@hagelb.org wrote: Hello folks. With some help from Nelson Morris I've pushed out the 2.3.1 release of Leiningen. This fixes the self-install

Re: calling java static member using string?

2013-08-13 Thread Sean Corfield
Perhaps clj-time might help you? https://github.com/clj-time/clj-time (ns time.core (:require [clj-time.core :as time] [clj-time.local :as local] [clj-time.predicates :as p])) (p/monday? (time/now)) ;; false (p/tuesday? (time/now)) ;; false (p/wednesday? (time/now)) ;;

Re: [ANN] Leiningen 2.3.0 released

2013-08-12 Thread Sean Corfield
On Sat, Aug 10, 2013 at 8:26 AM, Phil Hagelberg p...@hagelb.org wrote: None of these problems have had anything to do with SSL. On Windows it definitely has been a problem in the past. I'm pretty sure some users have run into problems with the S3 Amazon SSL certificate in the past on non-Windows

Re: Leiningen 2.3.0 and uberjar

2013-08-12 Thread Sean Corfield
Or just: lein do clean, compile, uberjar On Sun, Aug 11, 2013 at 11:07 AM, Christian Sperandio christian.speran...@gmail.com wrote: The workaround works fine, thanks for your help :) I give below the workaround, thus everybody can get it: $ lein clean lein compile lein uberjar -- --

Re: [ANN] Leiningen 2.3.0 released

2013-08-12 Thread Sean Corfield
On Mon, Aug 12, 2013 at 9:39 AM, Phil Hagelberg p...@hagelb.org wrote: I recall issues around the certificate GitHub used, but I'm not aware of any troubles that have been reported with the Amazon certificates. We switched to Amazon when GitHub turned off its upload functionality at the end of

Re: IDE feature

2013-08-09 Thread Sean Corfield
On Fri, Aug 9, 2013 at 6:58 AM, Laurent PETIT laurent.pe...@gmail.com wrote: What does it do? (first time I encounter it) DrRacket? It's the standard IDE for the Racket language (and all of its teaching subsets etc). -- Sean A Corfield -- (904) 302-SEAN An Architect's View --

Re: [ANN] Leiningen 2.3.0 released

2013-08-09 Thread Sean Corfield
On Fri, Aug 9, 2013 at 12:14 AM, Phillip Lord phillip.l...@newcastle.ac.uk wrote: Unfortunately, after upgrading the bash script, so it leaves a broken install. I keep my lein script under Git so it was easy to revert, but we're still on 2.1.3 because I ran into a number of problems with 2.2.0

Re: [ANN] Leiningen 2.3.0 released

2013-08-09 Thread Sean Corfield
Gmail search is defeating my efforts to locate what my problems with 2.2.0 were so I'll just wait until I can download 2.3.0 and re-run all our tests anyway. Sigh. On Fri, Aug 9, 2013 at 8:12 AM, Sean Corfield seancorfi...@gmail.com wrote: On Fri, Aug 9, 2013 at 12:14 AM, Phillip Lord phillip.l

Re: IDE feature

2013-08-09 Thread Sean Corfield
...@gmail.com wrote: I'll bet Laurent means paredit-convolute-sexpr :-) Ambrose On Fri, Aug 9, 2013 at 11:09 PM, Sean Corfield seancorfi...@gmail.com wrote: On Fri, Aug 9, 2013 at 6:58 AM, Laurent PETIT laurent.pe...@gmail.com wrote: What does it do? (first time I encounter it) DrRacket

Re: IDE feature

2013-08-09 Thread Sean Corfield
by a forward barf C-} after moving the cursor down two lines - convolute leaves it in front of (if ...). Sean On Fri, Aug 9, 2013 at 8:49 AM, Laurent PETIT laurent.pe...@gmail.com wrote: Le vendredi 9 août 2013, Sean Corfield a écrit : Ah, yes... it turns this ( | represents the cursor ): (f a b (g c

Re: [ANN] Leiningen 2.3.0 released

2013-08-09 Thread Sean Corfield
Yup, this killed my whole team for half a day today since I'd pushed the 2.3.0 script to our repo after the upgrade worked for me, and then hit the road for So. Cal. and everyone else then had a broken build for the rest of the day because the upgrade process broke due to this 403 forbidden issue

Re: IDE feature

2013-08-08 Thread Sean Corfield
On Thu, Aug 8, 2013 at 5:00 PM, Mark Engelberg mark.engelb...@gmail.com wrote: Getting back to the point of the original post, one of the nice features of DrRacket is that when you type `]`, it automatically puts either ']' or ')' Having used DrRacket quite a bit lately, I do not find its

Re: [ANN] Leiningen 2.3.0 released

2013-08-08 Thread Sean Corfield
It failed for me on Mac OS X 10.8.4 - this has also been a problem on Windows for me (which doesn't have curl / wget anyway). Can we please get the Leiningen JAR posted somewhere that is not prone to this sort of SSL problem? (! 536)- lein upgrade The script at

Re: [ANN] Leiningen 2.3.0 released

2013-08-08 Thread Sean Corfield
I'm still getting the 403 forbidden error. Mac and Windows. On Thu, Aug 8, 2013 at 10:06 PM, Phil Hagelberg p...@hagelb.org wrote: On Thursday, August 8, 2013 8:52:47 PM UTC-7, Frank Hale wrote: Looks like I was way too fast. Upgrading just worked for me. Thank you! I got the ACL wrong on

Re: [Proposal] Simplified 'ns' declaration

2013-08-06 Thread Sean Corfield
On Tue, Aug 6, 2013 at 7:51 AM, Greg g...@kinostudios.com wrote: (ns one.fresh-server (:refer-clojure :exclude [ancestors printf]) (:use core.matrix [ring.adapter.jetty :only (run-jetty)] Except most code I've seen uses (nested) vectors not lists. [ring.middleware.file

Re: core.async: throwing an exception into the channel

2013-08-01 Thread Sean Corfield
My first thought was: Since channels can have arbitrary values, how would you distinguish your magical thrown exception value from an exception value put into a channel for normal delivery? And no matter how you annotate that, it'll still just be a regular value. So the only way you could have

Re: [ANN] Immutant 1.0.0 released

2013-08-01 Thread Sean Corfield
Excellent! I look forward to trying this! Any plans for a Clojure / Immutant cartridge for OpenShift? Sean On Wed, Jul 31, 2013 at 1:49 PM, Jim Crossley jcrossl...@gmail.com wrote: Today we finally released Immutant 1.0.0! Read about it here: http://bit.ly/imm100 For those unfamiliar,

Re: [ANN] Immutant 1.0.0 released

2013-08-01 Thread Sean Corfield
. I'll blog about it soon. Jim On Thu, Aug 1, 2013 at 12:32 PM, Sean Corfield seancorfi...@gmail.com wrote: Excellent! I look forward to trying this! Any plans for a Clojure / Immutant cartridge for OpenShift? Sean On Wed, Jul 31, 2013 at 1:49 PM, Jim Crossley jcrossl...@gmail.com

Re: core.async: async java.jdbc

2013-07-31 Thread Sean Corfield
On Wed, Jul 31, 2013 at 10:29 AM, Alice dofflt...@gmail.com wrote: (go (jdbc/db-transaction [t-con db-spec] (! (insert-async! t-con :fruit {:name apple} Does this work: (jdbc/db-transaction [t-con db-spec] (go (! (insert-async! t-con :fruit {:name apple} -- Sean A

Re: core.async: async java.jdbc

2013-07-31 Thread Sean Corfield
On Wed, Jul 31, 2013 at 10:58 AM, Alice dofflt...@gmail.com wrote: It doesn't produce a compile time error but I think it's not the correct code because the transaction can be committed while insert-async! is still executing. Right. I was just showing how to avoid the compile error (because

Re: how to get use clojure.contrib.import-static

2013-07-31 Thread Sean Corfield
Sounds like you're looking at a very old example - monolithic clojure.contrib was deprecated when Clojure 1.3 came out. Some modules had active maintainers and migrated to new modular contrib libraries. Looking at: http://dev.clojure.org/display/community/Where+Did+Clojure.Contrib+Go I don't

Idiomatic use of records?

2013-07-25 Thread Sean Corfield
I tend to use plain ol' maps for data structures but was showing someone defrecord the other day and had some questions about idiomatic usage: Given: (defrecord Point [x y]) Which constructor form is considered more idiomatic: (Point. 10 10) or (-Point 10 10) Which accessor form is considered

Re: is intellij idea a good ide for clojure development?

2013-07-25 Thread Sean Corfield
On Thu, Jul 25, 2013 at 12:05 PM, Greg g...@kinostudios.com wrote: 1. On IntelliJ 2. On Emacs and Emacs Live 3. On Light Table 4. On Sublime Text (ST) 5. Conclusion I've tried IntelliJ several times and just can't on with the way it operates. Clearly a very personal thing. I used to use

Re: clojure.java.jdbc - jdbc metadata support?

2013-07-24 Thread Sean Corfield
That's great and would be a worthwhile addition but don't forget to get your CA signed and sent in, otherwise your contributions cannot be accepted. See http://clojure.org/contributing for more details. Sean On Wed, Jul 24, 2013 at 4:03 PM, Mark markaddle...@gmail.com wrote: I'm pretty

Re: clojure.java.jdbc - jdbc metadata support?

2013-07-24 Thread Sean Corfield
a Clojure noob so I'm not sure if the approach is correct. All feedback welcome. On Wednesday, July 24, 2013 4:21:56 PM UTC-7, Sean Corfield wrote: That's great and would be a worthwhile addition but don't forget to get your CA signed and sent in, otherwise your contributions cannot be accepted

Re: clojure.java.jdbc - jdbc metadata support?

2013-07-24 Thread Sean Corfield
the code: Use reg ex as you suggest Eliminated reflection warnings Learned me a zipmap for great success On Wednesday, July 24, 2013 7:09:27 PM UTC-7, Sean Corfield wrote: I'll reply off-list. There's a lot of stuff in that code to digest. I'll say straight off that I think a regex replace

Re: Can we please deprecate the :use directive ?

2013-07-23 Thread Sean Corfield
We only have :use in a couple of legacy tests and two scratch projects. We've switched from :use to :require .. :refer :all for situations where :use used to make sense (primarily in a test ns where we want to just refer in all of the ns being tested). We have a handful of places where we :refer

Re: Can we please deprecate the :use directive ?

2013-07-23 Thread Sean Corfield
On Tue, Jul 23, 2013 at 12:57 PM, Lee Spector lspec...@hampshire.edu wrote: I'm sure I'm coming from a minority perspective on this, but for the kind of work I do it's often more important to be able to quickly sketch out and test ideas, without any ceremony about which functions come from

Re: Can we please deprecate the :use directive ?

2013-07-23 Thread Sean Corfield
On Tue, Jul 23, 2013 at 1:53 PM, Ben Wolfson wolf...@gmail.com wrote: On Tue, Jul 23, 2013 at 1:50 PM, Stefan Kamphausen ska2...@gmail.com wrote: It complects require and refer ;-) How so? Because use = require + refer (essentially). -- Sean A Corfield -- (904) 302-SEAN An Architect's View --

Re: Can we please deprecate the :use directive ?

2013-07-23 Thread Sean Corfield
On Tue, Jul 23, 2013 at 2:13 PM, Ben Wolfson wolf...@gmail.com wrote: If that's all that's required for one thing to complect two others, clojure's rife with the stuff. if-let complects if and let. Destructuring assignment complects assignment and getting values from a data structure (as the

Re: Socket.IO and Clojure?

2013-07-17 Thread Sean Corfield
solution. Hope this helps. Thanks Anand On Tuesday, July 16, 2013 10:07:34 PM UTC-7, Sean Corfield wrote: At work we're starting down the path of building a new piece of functionality based on WebSockets and the external team we're working with is a Node.js shop so their go to solution

Re: Request for clojure help

2013-07-16 Thread Sean Corfield
On Tue, Jul 16, 2013 at 2:16 PM, Keith Maynard kpmayn...@gmail.com wrote: (defn perms ( [] [[]]) This is not pattern matching in Clojure. It defines an alternative arity version of the function so that (perms) would return [[]]. ([xs] (for [x xs p (perms (removeFirst x xs))] (cons x

Re: Request for clojure help

2013-07-16 Thread Sean Corfield
the various idioms in all these amazing languages. Thanks for clearing up my attempt at a multimethod :) Regards, Keith On Tuesday, July 16, 2013 6:03:14 PM UTC-4, Sean Corfield wrote: On Tue, Jul 16, 2013 at 2:16 PM, Keith Maynard kpma...@gmail.com wrote: (defn perms

Socket.IO and Clojure?

2013-07-16 Thread Sean Corfield
At work we're starting down the path of building a new piece of functionality based on WebSockets and the external team we're working with is a Node.js shop so their go to solution is Socket.IO and they've produced a very nice front end in CoffeeScript and a prototype back end on Node.js. I'd

Re: An example app using core.async and tools.namespace

2013-07-15 Thread Sean Corfield
This is a great example of both Stuart Sierra's suggested workflow (from his talk at Clojure/West) and of using core.async to simplify concurrent, collaborating processes! Thanks for sharing! Sean On Mon, Jul 15, 2013 at 11:10 AM, mybuddymichael michael.b.han...@gmail.com wrote: I recently

Re: [ANN]: Introducing lein-try

2013-07-14 Thread Sean Corfield
that problem. On Jul 13, 2013 11:30 PM, Sean Corfield seancorfi...@gmail.com wrote: It doesn't work when I spell it correctly either (and I had done several tests - but of course the results of misspelling it look the same as it not working - and it's indicative of my day that I pasted

Re: [ANN]: Introducing lein-try

2013-07-13 Thread Sean Corfield
This seems to work beautifully outside a project - and it's very useful! I will no longer need to create a million scratch projects to try stuff out - thank you! However, inside a project, I can't get it to work. (! 501)- cd clojure (! 502)- lein try hiccup 1.0.2 nREPL server started on port

Re: [ANN]: Introducing lein-try

2013-07-13 Thread Sean Corfield
It doesn't work when I spell it correctly either (and I had done several tests - but of course the results of misspelling it look the same as it not working - and it's indicative of my day that I pasted the result of a bad test! :) C:\Users\Sean\clojurelein new five ... C:\Users\Sean\clojurecd

Multiple REPLs in Emacs? (was: test run startup time

2013-07-11 Thread Sean Corfield
On Wed, Jul 10, 2013 at 10:53 AM, Jay Fields j...@jayfields.com wrote: I work in emacs with 2 repls running - 1 for running my app and 1 for running my tests. What is the magic to get this working and how does Emacs / nrepl.el know which REPL to send commands to? I've often wanted multiple

Re: ClassCastException in APersistentVector.doEquiv with custom implementation of IPersistentVector

2013-07-11 Thread Sean Corfield
On Wed, Jul 10, 2013 at 11:00 AM, Vincent vhenneb...@gmail.com wrote: I guess I can proxy APersistentVector, but the Clojure docs [1] advise to use reify in favour to proxy whenever possible. My goal is to have my byte stream behave like a standard Clojure vector. Given the definition of

Re: Multiple REPLs in Emacs? (was: test run startup time

2013-07-11 Thread Sean Corfield
11, 2013 at 5:53 PM, Sean Corfield seancorfi...@gmail.com wrote: On Wed, Jul 10, 2013 at 10:53 AM, Jay Fields j...@jayfields.com wrote: I work in emacs with 2 repls running - 1 for running my app and 1 for running my tests. What is the magic to get this working and how does Emacs / nrepl.el

[ANN] java.jdbc documentation has moved!

2013-07-09 Thread Sean Corfield
Extended documentation on java.jdbc is now available on clojure-doc.org: http://clojure-doc.org/articles/ecosystem/java_jdbc/home.html This opens up contributions to the community at large so I hope to see plenty of activity as folks send PRs for their favorite hints, tips, and tricks with this

Re: how to create in-memory hsqldb database via java.jdbc

2013-07-09 Thread Sean Corfield
Feel free to submit PRs to improve the documentation at: http://clojure-doc.org/articles/ecosystem/java_jdbc/home.html On Mon, Jul 8, 2013 at 9:22 AM, Colin Yates colin.ya...@gmail.com wrote: Found it - typically - messed around for hours, then post, the find it. The answer is to use

Re: java.jdbc - (sql/where ...) with multiple values (i.e. 'x in (1,2,3')

2013-07-09 Thread Sean Corfield
clojure.java.jdbc.sql is a deliberately minimal DSL - Justin Kramer's HoneySQL is what I recommend for more expressive SQL construction (that's the official recommendation based on discussions Justin and I had about java.jdbc and HoneySQL at Clojure/conj 2012). Sean On Mon, Jul 8, 2013 at 5:47

Re: [ANN] clojure-sql 0.1.0: relational algebra in clojure

2013-07-06 Thread Sean Corfield
On Fri, Jul 5, 2013 at 8:53 PM, Carlo Zancanaro carlozancan...@gmail.com wrote: Is there a reason you don't use the database's table/column name quoting? It means that keywords like :first-name cannot be used as table names without a fair bit of trouble. The DSL in java.jdbc supports

Re: [ANN] clojure-sql 0.1.0: relational algebra in clojure

2013-07-05 Thread Sean Corfield
And there's HoneySQL: https://github.com/jkk/honeysql (that's the one java.jdbc will recommend going forward since I worked with the author, Justin Kramer, on compatibility and direction for java.jdbc and HoneySQL at Clojure/conj last year) On Fri, Jul 5, 2013 at 3:59 AM, r0man

Re: core.async

2013-06-30 Thread Sean Corfield
On Sun, Jun 30, 2013 at 4:42 PM, David Pollak dpollak...@gmail.com wrote: Looking forward to it being published (even as SNAPSHOT) in a Maven repo. It's accessible like this: (defproject async 0.1.0-SNAPSHOT :description FIXME: write description :url http://example.com/FIXME; :license

Re: Offline Clojure docs

2013-06-30 Thread Sean Corfield
There are a couple of iPhone apps with Clojure docs: https://itunes.apple.com/us/app/clojuredoc/id401479442?mt=8 -- free, hasn't been updated for ages, but this is what I use anyway https://itunes.apple.com/us/app/clojure-bee-api-documentation/id524862532?mt=8 -- $0.99, hasn't been updated in a

Re: putting 2-element colls into a map: works with vectors, but not with lists?

2013-06-24 Thread Sean Corfield
On Mon, Jun 24, 2013 at 8:49 AM, John Gabriele jmg3...@gmail.com wrote: Why does `into` fail when the 2-element collections are lists and not vectors? : Because the implementation special cases vectors :) It's the one place where a two element vector is treated like a Map$Entry so that you are

Re: database wrapper lib

2013-06-21 Thread Sean Corfield
On Fri, Jun 21, 2013 at 8:56 AM, Michael Klishin michael.s.klis...@gmail.com wrote: Relational databases: https://github.com/clojure/java.jdbc (this one is not very extensively documented but is also small compared to Korma) FYI, Korma is built on top of java.jdbc and if you want a different

Re: Multiple args: opts map vs inline arguments

2013-06-18 Thread Sean Corfield
What I tend to do when I run into this situation is to split my function in two and provide: 1. an API function that accepts the key/value pairs as named arguments - per the library coding guidelines 2. an implementation function that accepts a map of args as its last argument (and destructures

Re: Clojure in production

2013-06-18 Thread Sean Corfield
It's the dog's b*ll*cks! :) (since we're doing cultural slang, let's get some Britishness in there!) Sean On Tue, Jun 18, 2013 at 9:04 PM, Russell Whitaker russell.whita...@gmail.com wrote: But... is it also the bee's knees? Russell Whitaker Sent from my iPhone On Jun 13, 2013, at 5:38

Re: Newbie dependency loading issue

2013-06-17 Thread Sean Corfield
What did you put in your project.clj file? On Mon, Jun 17, 2013 at 6:30 PM, P Martin prof.pmarti...@gmail.com wrote: Hi, I want to get the clojure.math.numeric-tower namespace into my code using: (require '[clojure.math.numeric-tower :as math]) I also follow the directions on the github

Re: Clojure in production

2013-06-11 Thread Sean Corfield
The latest data from World Singles llc (which is listed on that Success Stories page): Clojure source 76 files 13178 total loc, 1064 fns, 554 of which are private, 152 vars, 2 macros, 17 atoms Clojure tests 37 files 3016 total loc Clojure WebDriver tests 11 files 371 total loc We're on Clojure

Re: expectations documentation

2013-06-11 Thread Sean Corfield
This is very helpful Jay, thank you! We switched from clojure.test to Expectations after Clojure/West 2012 and we've been very happy with the framework. Centralized documentation will certainly make life easier for my team! Sean On Tue, Jun 11, 2013 at 11:39 AM, Jay Fields j...@jayfields.com

Re: [pre-ANN] test2, the last Clojure testing framework

2013-06-11 Thread Sean Corfield
That was what I was suggesting the other day... I see more value in providing a standardizing test result format and better reporting tools / integration with IDEs etc than in YATF (Yet Another testing Framework). On Tue, Jun 11, 2013 at 1:18 PM, Brandon Bloom brandon.d.bl...@gmail.com wrote:

Re: Best IDE

2013-06-10 Thread Sean Corfield
We have an admin option to start ( stop) a repl server inside our application so we can nrepl from Emacs into any live running instance and evaluate code in that live context - great for debugging only happens on production issues as well as making interactive development and debugging locally

Re: [pre-ANN] test2, the last Clojure testing framework

2013-06-09 Thread Sean Corfield
On Sun, Jun 9, 2013 at 11:07 AM, Steven Degutis sbdegu...@gmail.com wrote: We realized we can't change clojure.test because (1) this would break backwards compatibility, and (2) clojure.test is really slow-moving since it lives inside Clojure. Are there any JIRA tickets open against

Re: [pre-ANN] test2, the last Clojure testing framework

2013-06-09 Thread Sean Corfield
FWIW, about the only thing about clojure.test that I miss occasionally when using Expectations is 'each' fixtures for a subset of tests but the work involved in wrapping an expression in a try/finally with the resource setup and tear down I need is usually so minimal that's it's not even worth

Re: [pre-ANN] test2, the last Clojure testing framework

2013-06-09 Thread Sean Corfield
On Sun, Jun 9, 2013 at 5:50 PM, Steven Degutis sbdegu...@gmail.com wrote: Changing clojure.test seems like the wrong way to go. Being attached to a CA makes it hard to contribute to. It's a one-off action. Sign it, send it in. Then you can contribute to Clojure or any of its contrib libraries

Re: [pre-ANN] test2, the last Clojure testing framework

2013-06-09 Thread Sean Corfield
No. Read http://dev.clojure.org/display/design/Where+Did+Clojure.Contrib+Go On Sun, Jun 9, 2013 at 6:41 PM, Steven Degutis sbdegu...@gmail.com wrote: Is this still current? http://clojure.github.io/clojure-contrib/ On Sunday, June 9, 2013 8:19:15 PM UTC-5, Sean Corfield wrote: On Sun, Jun 9

Re: [ANN] core.rrb-vector -- RRB-Tree-based confluently persistent vectors

2013-06-02 Thread Sean Corfield
Guidelines for contrib READMEs can be found here: http://dev.clojure.org/display/design/Contrib+Library+READMEs On Sat, Jun 1, 2013 at 10:58 PM, Michael Klishin michael.s.klis...@gmail.com wrote: 2013/6/2 Michał Marczyk michal.marc...@gmail.com For anybody interested in even more background,

Re: Use of io!

2013-05-30 Thread Sean Corfield
On Thu, May 30, 2013 at 1:10 AM, Alex Baranosky alexander.barano...@gmail.com wrote: Do any of you ever use io! ? I've never used it, but could see using it if I had a transaction-heavy application. On Wed, May 29, 2013 at 11:43 PM, Michael Klishin michael.s.klis...@gmail.com wrote: The

Re: realizing a lazy line-seq inside with-open

2013-05-28 Thread Sean Corfield
On Mon, May 27, 2013 at 9:50 PM, Kevin Downey redc...@gmail.com wrote: doall doesn't recurse, so you are not realizing the lazy-seq, you want something like [msg (doall sig-strs)] Thank you Kevin! When Elango said my suggestion didn't work, I was puzzled. Now it makes sense! -- Sean A Corfield

Re: I don't feel the absence of a debugger, because I've learnt enough that I don't ever need a debugger.

2013-05-28 Thread Sean Corfield
On Tue, May 28, 2013 at 1:35 PM, Softaddicts lprefonta...@softaddicts.ca wrote: I came to the same conclusion as Stuart after 30+ years of coding in various languages/assemblers and architectures. Interesting thread and I find myself in agreement with Luc here. I've been programming

Re: ClassNotfound Exception while loading JAR files in Clojure 1.2

2013-05-22 Thread Sean Corfield
You'll need to provide more details about exactly which Clojure JARs you use and the stack trace for the exception (at least telling us which class is not found and enough of the stack trace for us to see where the reference is coming from). My suspicion is you're using the Clojure 1.2 contrib

Re: How to: reduce boolean operations?

2013-05-22 Thread Sean Corfield
On Wed, May 22, 2013 at 9:32 AM, Peter Mancini peter.manc...@gmail.com wrote: (defn all-true? [coll] (every? (fn [x] (= x true)) coll)) (defn all-true? [coll] (every? true? coll)) -- Sean A Corfield -- (904) 302-SEAN An Architect's View -- http://corfield.org/ World Singles, LLC. --

Re: seancorfield /clj-soap

2013-05-20 Thread Sean Corfield
wish the service I need to integrate with was REST based… On 19/05/2013, at 12:43 AM, Sean Corfield seancorfi...@gmail.com wrote: Since my name was invoked via mention of this repo, I figured it was a good chance to post from the readme: Note however that I am not actively maintaining

Re: seancorfield /clj-soap

2013-05-18 Thread Sean Corfield
Since my name was invoked via mention of this repo, I figured it was a good chance to post from the readme: Note however that I am not actively maintaining this library and would welcome someone taking it over. I updated Tetsuya's code to use a more modern Clojure environment purely to test it

Re: Why is using (not (empty? coll)) not idiomatic?

2013-05-13 Thread Sean Corfield
On Mon, May 13, 2013 at 7:08 AM, Meikel Brandmeyer (kotarak) m...@kotka.de wrote: You misunderstood my argument. cycle returns a sequence = use seq. count is the wrong thing to call here. And calling seq without using its return value (with a name) is a smell. count should not be called in

[ANN] clojure.java.jdbc 0.3.0 alpha 4

2013-05-13 Thread Sean Corfield
Latest alpha build of the upcoming 0.3.0 release of Clojure's JDBC wrapper contrib library. TL;DR: Extensive code changes around connection handling that I'd like to see get tested in the real world... http://corfield.org/blog/post.cfm/clojure-java-jdbc-0-3-0-alpha-4 -- Sean A Corfield -- (904)

Re: [ANN] clojure.java.jdbc 0.3.0 alpha 4

2013-05-13 Thread Sean Corfield
On Mon, May 13, 2013 at 3:01 PM, Gary Deer gdee...@gmail.com wrote: What are your plans for documentation beyond the doc strings? There are some additional documentation pages, based on the doc folder in the Github repo here: https://github.com/clojure/java.jdbc/tree/master/doc/clojure/java/jdbc

Re: unusual question: how do you get morale?(or moral support)

2013-05-12 Thread Sean Corfield
+100 :) I write code because I have to. If my job doesn't have me doing much programming, I spin up OSS projects in my spare time. When my job has me doing hardcore programming all the time, my urges are satisfied and my OSS projects don't get as much love. If my wife's away for the weekend, to

<    4   5   6   7   8   9   10   11   12   13   >