diff options
Diffstat (limited to 'std/stack.zc')
| -rw-r--r-- | std/stack.zc | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/std/stack.zc b/std/stack.zc index 3d7c3c5..7df77f1 100644 --- a/std/stack.zc +++ b/std/stack.zc @@ -50,6 +50,18 @@ impl Stack<T> { } return Option<T>::None(); } + + fn length(self) -> usize { + return self.len; + } + + fn clear(self) { + self.len = 0; + } + + fn is_empty(self) -> bool { + return self.len == 0; + } } impl Drop for Stack<T> { |
