13 lines
563 B
Text
13 lines
563 B
Text
using Nemerle.Assertions;
|
|
|
|
class SampleClass
|
|
{
|
|
public SomeMethod (input : list[int]) : int
|
|
requires input.Length > 0 // requires keyword indicates precondition,
|
|
// there can be more than one condition per method
|
|
{ ... }
|
|
|
|
public AnotherMethod (input : string) : list[char]
|
|
ensures value.Length > 0 // ensures keyword indicates postcondition
|
|
{ ... } // value is a special symbol that indicates the method's return value
|
|
}
|