new structure for checks
Opened this issue · 0 comments
florianschanda commented
Having written several complex checks, its clear to me that the existing format is too simple, quickly resulting in repeated constructs.
I suggest a new form:
type T {
a Integer
b Integer
c String
d Integer [1 .. *]
begin checks
if a > b then
assert c == "gt", "blah"
elif a < b then
assert c == "lt", "blah"
else
assert c == "eq", "blah"
end if
let tmp = a + b
forall item in d loop
assert d >= tmp, "blah"
end loop
end checks
}
For a more detailed proposal see https://github.com/florianschanda/trlc/blob/main/language-reference-manual/proposal-checks.md