Skip to content

Precondition

KuSpa edited this page Feb 16, 2018 · 1 revision

What is a Precondition?

A Precondition is the part of a Contract, which defines the correct parameter for a proper method execution. A Precondition is a Block with the arguments as parameter. A Precondition is stored in its Contract.

Examples

String input and debug

Object>>workWith: aString

[:args | |param|
    param := args first.
    param assert: param isString]

Clone this wiki locally