-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathComp.br
More file actions
35 lines (27 loc) · 778 Bytes
/
Comp.br
File metadata and controls
35 lines (27 loc) · 778 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#
#
# Comp.br
#
# created at: 2013-12-06T10:54:27.880526-05:00
#
# Copyright (c) 2013 Katherine Whitlock
#
#
within Mortar
trait Comp<t>
method less_than?(obj:t) -> Bool
(self <=> obj) == -1
method greater_than?(obj:t) -> Bool
(self <=> obj) == 1
method equals?(obj:t) -> Bool
(self <=> obj) == 0
method less_than_or_equals?(obj:t) -> Bool
self.less_than?(obj) || self.equals?(obj)
method greater_than_or_equals?(obj:t) -> Bool
self.greater_than?(obj) || self.equals?(obj)
method between?(min:t, max:t) -> Bool
if self.less_than?(min) return false
else if self.greater_than?(max) return false
else return true
method spaceship(obj:t) -> Bool
return nil