On Wednesday, 15 July 2015 at 19:28:13 UTC, Jacob Carlborg wrote:
On 2015-07-13 09:12, Atila Neves wrote:


Also on HN, but as usual can't post the link.

The comment about not having to name the steps. One way to do that could be something like this:

step("foo bar", {
    // step implementation

There are two problems with that:

1. D doesn't support module level code like this. Which could be solved by either using a unit test block, a module constructor or some other function the framework knows about to call.

Do mixin templates work on module level? They can even have an identifier.

2. That syntax is not as nice as in Ruby. It would be really nice if the following could be supported:

step("foo bar") {
    // step implementation

A trailing delegate syntax, where the delegate is passed after the regular argument list.

Unfortunately there are syntactical ambiguities:

    step("foo bar") {

Is that a call chain, or two statements, with the second one calling a function in the root scope? And I think there are other similar cases...

Reply via email to