File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change 2
2
3
3
= TITLE class Cool
4
4
5
- = SUBTITLE Value that can be treated as a string or number interchangeably
5
+ = SUBTITLE Object that can be treated as either a string or number
6
6
7
7
class Cool is Any { }
8
8
9
9
C < Cool > , also known as the B < C > onvenient B < OO > B < L > oop, is a base class
10
- for strings, numbers and other built-in classes that you are supposed to use
11
- mostly interchangeably.
10
+ employed by a number of built-in classes that can be meaningfully coerced
11
+ to a string or a number. For example, an L < Array > can be used in mathematical
12
+ operations, where its numerical representation is the number of elements it
13
+ contains. At the same time, it can be concatenated to a string, where its
14
+ stringy representation is all of its elements L < joined|/routine/join > by
15
+ a space. Because L < Array > is L < Cool > , the appropriate coercion happens
16
+ automatically.
12
17
13
18
Methods in C < Cool > coerce the invocant to a more
14
19
specific type, and then call the same method on that type. For example both
You can’t perform that action at this time.
0 commit comments