Timothy Baldridge wrote:
This is a good example of a DSL, and it falls under the criticisms I
level at most DSLs, mainly they aren't Clojure. If we dive into
I note that Midje once had an intermediate “semi-sweet” functional
interface that the `fact` macro expanded into. (It was most similar to
Expectations’.) That’s because I was originally thinking the syntax was
a little extreme and people would prefer something Lispy or to invent
their own.
At some point, the extra level of translation got annoying, so I asked
on the mailing list if anyone objected to my deleting it. No one did.
So there is some user demand for a DSL.
And I think there’s probably a reason why /The Joy of Clojure/ and other
books write examples in a left-right format like:
(if true :truthy :falsey) ;=> :truthy
… rather than:
(is (= :truthy (if true :truthy :falsey)))
I broadly agree with the idea of avoiding complex macros as DSLs. But
testing - like textbooks - is a domain where understandability by
someone new to an API is really important. So it’s a place where user
experience might trump general principles.
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
---
You received this message because you are subscribed to the Google Groups "Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.