-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathCharacter.strict
More file actions
34 lines (34 loc) · 839 Bytes
/
Character.strict
File metadata and controls
34 lines (34 loc) · 839 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
has number
constant zeroCharacter = 48
constant NewLine = Character(10)
constant Tab = Character(7)
from(text)
Character("b") is "b"
Character(7) is Tab
7 to Character is "7"
Character("ab") is Error
text(0)
to Text
Character("a") to Text is "a"
"" + value
+(other) Text
Character("1") + Character("2") is "12"
value to Text + other
to Number
Character("3") to Number is 3
constant notANumber = Error
Character("A") to Number is notANumber
let result = number - zeroCharacter
result is in Range(0, 10) then result else notANumber(value)
Upper Character
Character("a").Upper is "A"
Character("A").Upper is "A"
if number is in Range(97, 123)
return Character(number - 32)
value
Lower Character
Character("A").Lower is "a"
Character("a").Lower is "a"
if number is in Range(65, 91)
return Character(number + 32)
value