Skip to content

Commit 18f5adc

Browse files
authored
Improve Cool's description/summary
Fixes #1095
1 parent 04ab40b commit 18f5adc

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

doc/Type/Cool.pod6

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,18 @@
22
33
=TITLE class Cool
44
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
66
77
class Cool is Any { }
88
99
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.
1217
1318
Methods in C<Cool> coerce the invocant to a more
1419
specific type, and then call the same method on that type. For example both

0 commit comments

Comments
 (0)