It's also interesting to note that I most often write my clojure.test code
thusly:

(is (= (some-function some-val)
         42))

Which reads pretty much the same way, but without (many) macros.
Technically `is` is a deep walking macro, but that's more about error
reporting than DSLs.

Timothy

On Sun, Jan 31, 2016 at 9:05 AM, Brian Marick <mar...@exampler.com> wrote:

>
>
> 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.
>



-- 
“One of the main causes of the fall of the Roman Empire was that–lacking
zero–they had no way to indicate successful termination of their C
programs.”
(Robert Firth)

-- 
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.

Reply via email to