Executable now prints a pretty string description of the returned value.
[panda.git] / st / Character.st
blob4f09961b9224d586c2f802316f1905a1c028ee7a
3 "instance creation"
5 Character classMethod!
6 characterFor: unicodeValue
7         <primitive: 'Character_characterFor'>
8         self primitiveFailed!
10 Character classMethod!
11 new
12         ^ self basicNew!
14 Character classMethod!
15 new: anInteger
16         ^ self basicNew!
18 Character classMethod!
19 basicNew
20         self error: 'Characters can only be created with #characterFor:'!
23 "common integers"
25 Character classMethod!
27         ^ $\n!
29 Character classMethod!
30 tab
31         ^ $\t!
33 Character classMethod!
34 space
35         ^ $\0020!
38 "accessing"
40 Character method!
41 value
42         <primitive: 'Character_value'>
43         self primitiveFailed!
45 "comparing"
47 Character method!
48 = aCharacter
49         ^ aCharacter isCharacter and: [(self compare: aCharacter) = 0]!
51 Character method!
52 < aCharacter
53         ^ (self compare: aCharacter) < 0!
55 Character method!
56 > aCharacter
57         ^ (self compare: aCharacter) > 0!
59 Character method!
60 <= aCharacter
61         ^ (self compare: aCharacter) <= 0!
63 Character method!
64 >= aCharacter
65         ^ (self compare: aCharacter) >= 0!
67 Character method!
68 compare: aCharacter
69         ^ self value - aCharacter value!
71 Character method!
72 hash
73         ^ self value!
76 "testing"
78 Character method!
79 isCharacter
80         ^ true!
83 "printing"
85 Character method!
86 printOn: aStream
87         aStream nextPut: $$.
88         aStream nextPut: self!