Syntax Question

From: Michael Feathers (mfeathers_at_objectmentorNOSPAM.com)
Date: 05/30/04


Date: Sun, 30 May 2004 14:58:50 GMT


I'm bootstrapping a little prototype-based programming language this weekend
for fun. Sort of a reward for myself for having finished a very big
project. I have the model down and tested. I'm about to write the parser.
What do you all think of the following syntax? This is an example xUnit
implementation:

testmaker.newTest(name) = {
    test = {}
    test.name = name
    test.passed = true

    test.setup() = {}
    test.teardown() = {}

    test.assertTrue(value) = {
        value.ifFalse({ passed = false })
    }

    test.run(result) = {
        setup()
        runTest(result)
        teardown()
    }

    test.runTest(result) = {}
    test
}

test = testmaker.newTest("fred")

test.runTest(result) = { assertTrue(false) }

result = {}

result.errors = {}
result.addError(error) = {
    errors[errors.size] = error
}

test.run(result)

Michael Feathers
www.objectmentor.com



Relevant Pages

  • Re: AC stats
    ... For the first time I had ... small impact, all things considered, but it is still so much fun to be ... telling him I did not wish communication with him of ANY sort, ... an effective Internet carpet cleaning service? ...
    (alt.coffee)
  • Re: Dear Diary...
    ... both kinds of players. ... young woman come to play with our group one time who had a 12-page character ... It got me to thinking - this sort of creativity and "in character" ... Any thoughts, suggestions, or ideas as to how to cook up a usable reward ...
    (rec.games.frp.dnd)
  • Re: Who else was in Telluride 20 years ago today?
    ... Fun part was that we were sort of...invited? ... Unca Bobo had a house in Telluride, ... And the other big fun was showing up in whatever town about 40 miles to ... And then there was the convergence. ...
    (rec.music.gdead)
  • Re: AE Wi Fi Radio Installation
    ... that's fairly typical of the sort of probs to expect with those ... WiFi Network on his ADSL Modem Router thingy, ... So a fun piece of kit with a much wider choice of stations than DAB. ... I am putting the security back on the WAP step by step, ...
    (uk.people.silversurfers)
  • Re: Advice needed - barbarian magic item (long)
    ... 15 to make, and that my barbarian can use; ... Useful, but not fun. ... How about some sort of barding that includes a sort of permanent shield ... damage from area effects (take your own damage, ...
    (rec.games.frp.dnd)