Syntax Question
From: Michael Feathers (mfeathers_at_objectmentorNOSPAM.com)
Date: 05/30/04
- Next message: Daniel T.: "Re: VB man goes Java. Casting.."
- Previous message: Daniel T.: "Re: UML class diagram question"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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
- Next message: Daniel T.: "Re: VB man goes Java. Casting.."
- Previous message: Daniel T.: "Re: UML class diagram question"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|