λ
Programming with
Nex

A step-by-step guide to Nex — from first programs to software engineering practice.

// Design by Contract in Nex
class Stack<T>

  fn push(value: T)
    requires !is_full()
    ensures  count == old_count + 1
  end

  fn pop()  T
    requires count > 0
  end

end
fn class requires ensures let if while match module
Vijay Mathew
Contents →