Re: Effects of diving into Clojure

2014-01-14 Thread Travis Vachon
+1 here. I'm afraid the only solution I've found is to stop writing Ruby. ¯\_(ツ)_/¯ On Tue, Jan 14, 2014 at 2:39 PM, Mark markaddle...@gmail.com wrote: I misread the critical piece of your post :) You are, indeed, a step ahead of me On Tuesday, January 14, 2014 11:30:13 AM UTC-8, g vim

Re: How to handle configuration in Clojure?

2014-01-13 Thread Travis Vachon
Another option is to use leiningen profiles to change the classpath, loading different versions of a (eg) config.clj file in different environments. This lets you `require` the config namespace and refer to config parameters like `config/the-configured-value` Travis On Mon, Jan 13, 2014 at 11:05

[ANN] progressbar: easy progress bars in clojure

2013-08-08 Thread Travis Vachon
progressbar transparently wraps any map-able object to print feedback to standard out as items in the seq are processed: user (require '[progressbar.core :refer [progressbar]]) user (doall (map identity (progressbar (range 10) :print-every 2))) [) # this is animated from [) to [) using

Re: Clojure in production

2013-06-13 Thread Travis Vachon
We've used Clojure at Copious (http://copious.com) to build our activity feed (http://www.youtube.com/watch?v=0l7Va3-wXeI) and a number of backend services. We're definitely looking to use it even more in the future: it's the cat's pajamas. On Thu, Jun 13, 2013 at 2:07 PM, Deepak Giridharagopal

Re: user math expression evaluation

2013-05-28 Thread Travis Vachon
Incanter has some stuff that does this: http://data-sorcery.org/2010/05/14/infix-math/ this looks even closer to what you're looking for: https://github.com/tristan/clojure-infix On Tue, May 28, 2013 at 2:19 PM, Brian Craft craft.br...@gmail.com wrote: Are there any existing libs for the

Re: binding funkiness

2013-04-22 Thread Travis Vachon
Hi Daniel map is creating a lazy seq, which isn't evaluated until the REPL's forces it to be printed, which is outside the scope of the binding. This: (binding [*funkybind* true] (doall (map (fn [_] *funkybind*) [1 2]))) forces evaluation inside the binding, and does what you want. This is

Re: Namespaces, APIs, protocols and records

2013-04-15 Thread Travis Vachon
For what it's worth, I've been refactoring big namespaces out into small, focused namespaces lately. A rough heuristic I've found useful is that when I require a namespace I should be able to assign it a name that aids with readability. So for example: (ns foo.book) (defn search [book term]

Re: Namespaces, APIs, protocols and records

2013-04-15 Thread Travis Vachon
definitely like that it keeps things simpler for me (the implementer), but clients have to know about multiple namespaces rather than a single namespace and I don't like that. I must say I'm finding it hard to decide which way to go. On Monday, 15 April 2013 15:31:49 UTC+1, travis vachon wrote

Re: What's the point of - ?

2013-03-11 Thread Travis Vachon
- can also be used in conjunction with a well designed DSL to construct values in a very readable fashion. clj-time has some great examples of this: http://seancorfield.github.com/clj-time/doc/clj-time.core.html#var-from-now (- 30 minutes from-now)

Re: :use an entire namespace full of protocols or stick with :require?

2013-03-09 Thread Travis Vachon
Speaking strictly for myself, but as someone who spends about half his professional day writing Clojure: :use is dead, long live :require. I've found using :require [foo :refer :all] rather than :use foo has lead to cleaner, more consistent ns statements in my own code, and I've made it a policy

Re: Maps, keywords, and functions

2012-12-21 Thread travis vachon
Having both options available also allows you to make NullPointerException-averse decisions as appropriate. That is, in this function: (defn foo [a-map] (a-map :foo)) I'm potentially exposed to an NPE if the given map is nil. By rewriting it: (defn foo [a-map] (:foo a-map)) I avoid this

Re: ANN: lein-cdt 1.0.0 - a leiningen plugin for the Clojure Debugging Toolkit

2011-01-12 Thread Travis Vachon
, Jan 10, 2011 at 9:34 PM, Travis Vachon travis.vac...@gmail.com wrote: Hi folks I'd like to announce the first stable release of lein-cdt, a leiningen plugin that makes running George Jahad's excellent Clojure Debugging Toolkit a little easier. George has been polishing CDT over the past

ANN: lein-cdt 1.0.0 - a leiningen plugin for the Clojure Debugging Toolkit

2011-01-10 Thread Travis Vachon
Hi folks I'd like to announce the first stable release of lein-cdt, a leiningen plugin that makes running George Jahad's excellent Clojure Debugging Toolkit a little easier. George has been polishing CDT over the past couple weeks and we both hope that this plugin will help others start to use