Any ways to prevent protocol functions from being hardcoded in?

2011-06-28 Thread Brian Marick
] "hi mom") (indirect-adder 1 2) => "hi mom" ; rather than 3 I expect there are no tricks like :dynamic true <http://blog.n01se.net/?p=134> that work, but I thought I'd check. - Brian Marick, Artisanal Labrador Contract programming in Ruby and

Help: Some AOT-compiled classes can't be required

2011-06-22 Thread Brian Marick
https://github.com/marick/Midje/blob/v.1.2-alpha3/src/midje/fakes.clj Any ideas for either preventing AOT compiling for the jar file or fixing this problem some other way? - Brian Marick, Artisanal Labrador Contract programming in Ruby and Clojure Occasional consulting on Agile www.exampl

Re: What's the best way to test private functions?

2011-06-17 Thread Brian Marick
t/expect x => y) truthy '(+ x y) falsey 'expectfalsey) - Brian Marick, Artisanal Labrador Contract programming in Ruby and Clojure Occasional consulting on Agile www.exampler.com, www.twitter.com/marick -- You received th

Re: hammock driven development...

2011-06-09 Thread Brian Marick
e shower. Or on long walks. Mileage varies. - Brian Marick, Artisanal Labrador Contract programming in Ruby and Clojure Occasional consulting on Agile www.exampler.com, www.twitter.com/marick -- You received this message because you are subscribed to the Google Groups "Clojure"

Re: Testing clojure.contrib.condition

2011-04-29 Thread Brian Marick
.. (throw-exception "hi") => (throws Error "hi") (throw-exception "hi") => (throws Error #"h.")) You could use what's already built in, since conditions are built on top of exceptions. Alternately, you could write condition-specific "checke

Clojure interest in Zurich

2011-04-14 Thread Brian Marick
I'll be working in Zurich from 16 May through 3 June. Anyone interested in weekend or evening Clojure hacking? Clojure user's group? ----- Brian Marick, Artisanal Labrador Contract programming in Ruby and Clojure Occasional consulting on Agile www.exampler.com, www.twitter.com/maric

Re: Multimethod mock using clojure.contrib.mock

2011-04-12 Thread Brian Marick
ching > key. Thus far, I haven't seriously grappled with multimethods in Midje (https://github.com/marick/Midje) but I've given it a little thought (http://bit.ly/er46Dm) I you can provide sample midje-style tests, I could add making-them-work to the backlog. - Brian Marick, Ar

Re: Midje 1.1 released (testing tool)

2011-04-05 Thread Brian Marick
est(s) passed or failed. I have it on my list to make such a connection, just because people expect it. ----- Brian Marick, Artisanal Labrador Contract programming in Ruby and Clojure Occasional consulting on Agile www.exampler.com, www.twitter.com/marick -- You received this message because yo

Midje 1.1 released (testing tool)

2011-04-05 Thread Brian Marick
(fact (severity input) => :high (provided (error-count) =streams=> (range))) https://github.com/marick/Midje/wiki/Using-stateful-functions-as-prerequisites - Brian Marick, Artisanal Labrador Contract programming in Ruby and Clojure Author of /Ring/ (forthco

Re: Monad Lessons

2011-03-13 Thread Brian Marick
On Mar 12, 2011, at 9:09 PM, Ken Wesson wrote: > On Sat, Mar 12, 2011 at 7:20 PM, Brian Marick wrote: >> http://www.vimeo.com/20963938 > > Your sequence-decider can be simplified a bit: (mapcat rest-fn step-val). :) Yes, but separating the map from the concat makes the e

Re: Monad Lessons

2011-03-12 Thread Brian Marick
m/20717301 http://www.vimeo.com/20798376 http://www.vimeo.com/20963938 ----- Brian Marick, Artisanal Labrador Contract programming in Ruby and Clojure Author of /Ring/ (forthcoming; sample: http://exampler.com/tmp/ring.pdf) www.exampler.com, www.exampler.com/blog, www.twitter.com/marick -- Yo

Re: clojure.contrib.condition

2011-02-28 Thread Brian Marick
; set up the class path)? What behaves differently if you run (require > 'clojure.contrib.condition) in the repl and "in your program"? Thanks for the offer of help. I decided that going monadic would be cleaner. I'll revisit this if I turn out to be wrong. - Brian

Re: better error messages > smaller stack traces

2011-02-28 Thread Brian Marick
ts (Or report a bug in the tracker if it turns out you were right but Midje was wrong.) - Brian Marick, Artisanal Labrador Contract programming in Ruby and Clojure Author of /Ring/ (forthcoming; sample: http://exampler.com/tmp/ring.pdf) www.exampler.com, www.exampler.com/blog, www.twitter.com/m

Re: Release.Next Version Number

2011-02-24 Thread Brian Marick
o expect. I like semantic versioning myself, but I think considerations are different for peripheral libraries like mine than they are for the foundational core of the whole shebang. - Brian Marick, Artisanal Labrador Contract programming in Ruby and Clojure Author of /Ring/ (forthcoming;

Re: Release.Next Version Number

2011-02-23 Thread Brian Marick
not > quite ready for a "2.0". I agree. My gut tells me "2.0" implies promises about the ecosystem and ease-of-adoption. Clojure 2.0 would be overpromising. Better to underpromise and overdeliver, as they say. - Brian Marick, Artisanal Labrador Contract progr

Re: Ordering of defn's?

2011-02-23 Thread Brian Marick
gramming in Clojure. If that's a style you like, you may be interested in this: http://www.vimeo.com/19404746 - Brian Marick, Artisanal Labrador Contract programming in Ruby and Clojure Author of /Ring/ (forthcoming; sample: http://exampler.com/tmp/ring.pdf) www.exampler.com, www.examp

Re: better error messages > smaller stack traces

2011-02-08 Thread Brian Marick
On Feb 8, 2011, at 8:01 AM, Stuart Halloway wrote: > > Please let us know when you get a misleading error message from a > macroexpansion, so we can make it better. Or contribute a patch along the > lines of [2]. > What medium is best? ----- Brian Marick, Artisanal La

clojure.contrib.condition

2011-02-07 Thread Brian Marick
mpiling or something else I'm doing wrong. Please enlighten. ----- Brian Marick, Artisanal Labrador Contract programming in Ruby and Clojure Author of /Ring/ (forthcoming; sample: http://exampler.com/tmp/ring.pdf) www.exampler.com, www.exampler.com/blog, www.twitter.com/marick -- You receiv

ANN: Midje ready for production use (#testing #clojure.test)

2011-01-25 Thread Brian Marick
how to migrate from clojure.test to Midje: http://www.youtube.com/watch?v=a7YtkcIiLGI (8 minutes) The entry point to the documentation is here: https://github.com/marick/Midje/blob/master/README.md Thank you. - Brian Marick, Artisanal Labrador Contract programming in Ruby and Clojure Author of

Distinguishing a map from a record

2011-01-21 Thread Brian Marick
In the absence of #'record?, what's the safest way to tell whether a particular object is a true map or a record? ----- Brian Marick, Artisanal Labrador Contract programming in Ruby and Clojure Author of /Ring/ (forthcoming; sample: http://exampler.com/tmp/ring.pdf) www.ex

Re: Testing if a sequence is lazy

2011-01-18 Thread Brian Marick
On Jan 18, 2011, at 11:29 AM, Brian Marick wrote: > f this were my problem, I'd wonder if I could make the computation accept > functions. Then you could do something like this: That was a lame solution except in the special case where the first element must be computed. Here

Re: Testing if a sequence is lazy

2011-01-18 Thread Brian Marick
om!")))] (first (sprout-maker explosive-seed)) => identity-sprout? (second (sprout-maker explosive-seed)) => (throws Error #"Boom"))) - Brian Marick, Artisanal Labrador Contract programming in Ruby and Clojure Author of /Ring/ (forthcoming; sample: http://exam

Book on Ring - reviewers needed

2011-01-17 Thread Brian Marick
I'm working on a short book on Ring for the Pragmatic Bookshelf. The first two chapters are here: http://exampler.com/tmp/ring.pdf If you'd like to be a reviewer, send me mail. ----- Brian Marick, Artisanal Labrador Contract programming in Ruby and Clojure Author of /Ring/ (forthcomi

Re: list* does not make a list?

2011-01-16 Thread Brian Marick
On Jan 16, 2011, at 12:55 PM, Alan wrote: > list* consumes its last argument lazily, which means it can't count it That is indeed what it does. seq* would have been a better name. Too late now, I guess. ----- Brian Marick, Artisanal Labrador Contract programming in Ruby and Clojure A

list* does not make a list?

2011-01-16 Thread Brian Marick
movies.core> (list? (apply list (map identity [1 2 3]))) true Makes sense to me! movies.core> (list? (list* (map identity [1 2 3]))) false Huh? - Brian Marick, Artisanal Labrador Contract programming in Ruby and Clojure Author of /Ring/ (forthcoming; sample: http://

Midje 0.9 released #testing

2011-01-07 Thread Brian Marick
n use checkers within checkers: user> (fact {:a 1 :b 3 :c 5} => (just {:a odd? :b odd? :c odd?})) true ... and so on. You can find a complete description here: https://github.com/marick/Midje/wiki/Checkers-for-collections-and-strings - Brian Marick, Artisanal Labrador Contract programmin

Re: Mocking multimethods

2010-12-22 Thread Brian Marick
ork as well. Midje isn't a superset of the features of other clojure.test alternatives. For example, it doesn't have the auto-runner that LazyTest does, and it doesn't have the trimmed stack traces of Expectations. I plan to keep stealing ideas, though. - Brian Marick,

Re: Mocking multimethods

2010-12-22 Thread Brian Marick
h...) => anything >(provided > (undo-fn ...patch...) => (fn [] (reset! > visible-evidence-of-a-side-effect :happened!)) > (remove-patch ...patch...) => :nothing-of-interest) >@visible-evidence-of-a-side-effect => :happened!)) - Brian Marick, Artisanal Lab

Re: Mocking multimethods

2010-12-22 Thread Brian Marick
nce-of-a-side-effect :happened!)) (remove-patch ...patch...) => :nothing-of-interest) @visible-evidence-of-a-side-effect => :happened!)) 1855 $ lein midje midje.util.git All claimed facts (2) have been confirmed. 1856 $ - Brian Marick, Artisanal Labrador Contract programmin

Re: Midje: a different slant on clojure testing

2010-12-16 Thread Brian Marick
and change old tests to the new format at your leisure. (The downside is that if you want the test summaries to be right, you have to wrap the Midje tests in #'deftest. Otherwise fact successes and failures aren't counted when you do 'lein test'.) - Brian Marick, Arti

Re: Midje: a different slant on clojure testing

2010-12-16 Thread Brian Marick
that they become terser.) I find the test failures easier to interpret, especially when I use "chatty checkers" (which was inspired by Phlip's assert{2.0} for Ruby http://www.oreillynet.com/ruby/blog/2008/02/assert2.html) - Brian Marick, Artisanal Labrador Contract prog

Re: Midje: a different slant on clojure testing

2010-12-15 Thread Brian Marick
that makes sending a single fact to the repl work better.) The whole story about "backgrounds" is here: https://github.com/marick/Midje/wiki/Setup%2C-Teardown%2C-and-State https://github.com/marick/Midje/wiki/Background-prerequisites - Brian Marick, Artisanal Labrador Contract prog

Midje: a different slant on clojure testing

2010-12-15 Thread Brian Marick
own: (fact (against-background (before :checks (swap! test-atom (constantly 0 (swap! test-atom inc) => 1 (swap! test-atom dec) => -1) (background (around :facts (sql/with-connection db ?form))) I've worked up an emacs interface, and there are features I

Re: unquote

2010-12-15 Thread Brian Marick
ntln (name symbol))) '(a b c))) That will produce this output: a b c (nil nil nil) (See also #'dorun.) - Brian Marick, Artisanal Labrador Contract programming in Ruby and Clojure Author of /Ring/ (forthcoming; sample: http://bit.ly/hfdf9T) www.exampler.com, www.exampler.com/blog,

Re: Getting strange behavior when stubbing

2010-12-12 Thread Brian Marick
ess-than 5)) Then an implementation of fact that was (repeatedly (constantly arg)) would silently spin forever. - Brian Marick, Artisanal Labrador Contract programming in Ruby and Clojure Author of /Ring/ (forthcoming; sample: http://bit.ly/hfdf9T) www.exampler.com, www.exampler.com/blog, ww

Re: Getting strange behavior when stubbing

2010-12-10 Thread Brian Marick
je applies an #'eagerly function before checking. (Note: I found that #'doall isn't always enough, because you can be bitten in the same way by laziness in nested expressions, so #'eagerly walks the whole tree, not just the top level.) - Brian Marick, Artisanal Labrador

Re: Pre-expansion macro form

2010-12-05 Thread Brian Marick
On Dec 5, 2010, at 3:32 PM, Alex Osborne wrote: >> >> Is there any way to get the original call form? Something like &env? Some >> hook into the reader? > > Try &form I should have guessed. Thanks. - Brian Marick, Artisanal Labrador Contract programmi

Pre-expansion macro form

2010-12-05 Thread Brian Marick
to get the original call form? Something like &env? Some hook into the reader? - Brian Marick, Artisanal Labrador Contract programming in Ruby and Clojure Author of /Ring/ (forthcoming; sample: http://bit.ly/hfdf9T) www.exampler.com, www.exampler.com/blog, www.twitter.com/marick --

Re: Test-driven development in Clojure

2010-10-25 Thread Brian Marick
sweet" syntax, which is built on top of a plain functions-and-maps interface.) - Brian Marick, independent consultant Mostly on agile methods with a testing slant Author of /Programming Cocoa with Ruby/ www.exampler.com, www.exampler.com/blog, www.twitter.com/marick -- You received this

Re: Conj arrivals and Thursday night...

2010-10-19 Thread Brian Marick
ll be at the hotel around the same time, would be happy to join. - Brian Marick, independent consultant Mostly on agile methods with a testing slant Author of /Programming Cocoa with Ruby/ www.exampler.com, www.exampler.com/blog, www.twitter.com/marick -- You received this message because

Re: Test-driven development in Clojure

2010-10-12 Thread Brian Marick
t;) => "301"))) I do that in Midje's tests for itself. - Brian Marick, independent consultant Mostly on agile methods with a testing slant Author of /Programming Cocoa with Ruby/ www.exampler.com, www.exampler.com/blog, www.twitter.com/marick -- You received this message because

Re: Test-driven development in Clojure

2010-10-11 Thread Brian Marick
ust maturing now but I found his blog posts illuminating. I'll be doing a talk on this at Strange Loop, and would also be happy to show people at clojure-conj. - Brian Marick, independent consultant Mostly on agile methods with a testing slant Author of /Programming Cocoa

Line numbers for forms embedded in macros

2010-09-12 Thread Brian Marick
the interpreter, I'll have it annotate it with the correct line numbers. That way, a simple keyboard gesture will take me to the failing line. Better ideas for fallbacks? - Brian Marick, independent consultant Mostly on agile methods with a testing slant Author of /Programming C

Re: testing local functions?

2010-09-10 Thread Brian Marick
ays thought it to be good style to make helper functions only as > visible as needed, e.g. by using letfn. > > But when I want to test my code, I just dont see a way to access these > local functions for tests. - Brian Marick, independent consultant Mostly on agile methods with

Re: clojure-conj registration is now open!

2010-09-04 Thread Brian Marick
Well, I'll be there even though they've inexplicably scheduled the birthday party for the day before my birthday. ----- Brian Marick, independent consultant Mostly on agile methods with a testing slant Author of /Programming Cocoa with Ruby/ www.exampler.com, www.example

Tutorial: clojure.zip

2010-09-02 Thread Brian Marick
I've written a short tutorial for clojure.zip: http://www.exampler.com/blog/2010/09/01/editing-trees-in-clojure-with-clojurezip/ - Brian Marick, independent consultant Mostly on agile methods with a testing slant Author of /Programming Cocoa with Ruby/ www.exampler.com, www.exampler.com

Re: Clojure Conj Questions

2010-08-20 Thread Brian Marick
also my birthday. I like chocolate "money cake" with 1 quarter, 2 dimes, 2 nickels, and 10 pennies baked in. Thanks! - Brian Marick, independent consultant Mostly on agile methods with a testing slant Author of /Programming Cocoa with Ruby/ www.exampler.com, www.exampler.com/blog, w

Re: Identifying error-kit Throwables

2010-08-16 Thread Brian Marick
change my mind again. - Brian Marick, independent consultant Mostly on agile methods with a testing slant Author of /Programming Cocoa with Ruby/ www.exampler.com, www.exampler.com/blog, www.twitter.com/marick -- You received this message because you are subscribed to the Google Groups "

Identifying error-kit Throwables

2010-08-16 Thread Brian Marick
I have a need to catch and handle all Java Throwables except those used by c.c.error-kit. I can identify an error-kit throwable like this: (re-find #"^Error Kit Control Exception" (.toString e))) That does not fill me with joy. What's the right way to do it? ----- Brian Mari

<    1   2   3