[racket] Thoughts on Overeasy
On Mon, Aug 29, 2011 at 9:33 AM, Neil Van Dyke <neil at neilvandyke.org> wrote:
> However, in response to Noel's suggestion, I'm thinking that there might be
> a place for some dumbed-down syntactic sugar for simple forms of setup and
> teardown. Specifically, "#:setup" and #:teardown" keyword arguments that are
> followed by expressions, and then expanded to something like "(dynamic-wind
> (lambda () SETUP) (lambda () CODE) (lambda () TEARDOWN)". Part of the
> rationale is that Overeasy might be considered a minilanguage for testing,
> perhaps used by a software test engineer, and by incorporating the setup and
> teardown into the "test" form, "test" can provide a nice little
> self-contained specification of most individual tests. When the dumbed-down
> syntactic sugar is adequate, it's prettier.
I think core of my beef with keyword args in Overeasy is that they
don't compose. For example, if you give all of setup, teardown, and
around keyword args, in what order are they applied? I.e. if I specify
both setup and around, which runs first? I prefer writing an
expression, as this makes it explicit and obvious what is going on. I
don't like the use of keyword arguments for the other parameters for
similar reasons. I think they can all be replaced with library
procedures. E.g.
(with-output name expr)
to capture current-output-port.
HTH,
N.