Looked easy enough to test my new-found Lisp skills. Although I was not consciously choosing the next test / step based on the transformation priority, I was curious to know if I had been doing it all along without knowing it.
This innocuous looking kata had me stuck initially - what is the right first step? Trash-canned the first couple of attempts. The third attempt was slow but I succeeded. I did it again in C# just to see if the language had any bearing on my method. This time I was faster because I was familiar with the trail now.
- I am not wiser with regard to the priority premise - I found I used a bunch of transformations that were not part (bold) of the original list (shown in blue below). As a result, their priorities are unknown. This was the proverbial rain on my parade.
- Also in the C# variant, I found a couple of tests where I needed multiple transformations to get to the next green & I could not figure out a smaller test.
Attempt#1 Flash Cards Kata in Lisp
TEST User should be asked a question
- {} => statement
- P5 (statement->statements) adding more unconditional statements.
- P6 (unconditional->if) splitting the execution path
- P4 (constant->scalar) replacing a constant with a variable or an argument
- constant => expr
- {} => loop (statement)
- exprX => exprY
- value => expr
TEST User is asked the question
- P2 nil -> constant
- {} => statement *** Play()
- constant => field *** LastQuestionAsked
- void => statement *** Ask() - is there a smaller step here?
- P2 nil -> constant
- P5 (unconditional->if) splitting the execution path *** Play()
- P4 (statement->statements) adding more unconditional statements
- nil => expr *** User.WhoAnswers
- field assignment *** User.ctor
- constant => field *** User.LastConfirmationReceived
- void => statement *** User.Notify
- P4 constant => scalar arg
- constant => expression
- {} => statements
- {} => loop
- P4 (statement->statements) adding more unconditional statements *** User
- field assignment *** User.ctor
- exprX => exprY
- value => expr