Vigil is a very safe programming language in which you have to swear what kind of result you’ll be returning. If a function fails to uphold what it has sworn to do, it will be deleted from you’re source-code.
You can also define that parameters should have certain desirable properties. If a caller of a function uses a invalid parameter he will be removed from the source-code.
This results into a “bugfree” program. Ex. :D
def fib(n): if n < 2: result = n else: result = fib(n - 1) + fib(n - 2) # fib() never returns negative number. swear result >= 0 return result
Subscribe to get the latest posts sent to your email.