Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
87 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
=begin pod | ||
=head1 Cool | ||
class Cool is Any { } | ||
C<Cool>, also known as the B<C>onvenient B<OO> B<L>oop, is a base class | ||
for strings, numbers and other built-in classes that you are supposed to use | ||
mostly interchangable. | ||
Methods in C<Cool> coerce the invocant to a more | ||
specific type, and then calls the same method on that type. For example both | ||
L<Int> and L<Str> inherit from C<Cool>, and calling method C<substr> on in | ||
C<Int> converts the integer to C<Str>. | ||
123.substr(1, 1); # '2', same as 123.Str.substr(1, 1) | ||
The following table summarizes the methods and what type they coerce to | ||
=begin table | ||
method coercion type | ||
abs Numeric | ||
conj Numeric | ||
sqrt Numeric | ||
sign Numeric | ||
rand Numeric | ||
sin Numeric | ||
asin Numeric | ||
cos Numeric | ||
acos Numeric | ||
tan Numeric | ||
atan Numeric | ||
atan2 Numeric | ||
sec Numeric | ||
asec Numeric | ||
cosec Numeric | ||
acosec Numeric | ||
cotan Numeric | ||
acotan Numeric | ||
sinh Numeric | ||
asinh Numeric | ||
cosh Numeric | ||
acosh Numeric | ||
sech Numeric | ||
asech Numeric | ||
asech Numeric | ||
cosech Numeric | ||
acotanh Numeric | ||
cis Numeric | ||
log Numeric | ||
exp Numeric | ||
roots Numeric | ||
log10 Numeric | ||
unpolar Numeric | ||
round Numeric | ||
floor Numeric | ||
ceiling Numeric | ||
truncate Numeric | ||
ord Int | ||
chars Str | ||
fmt Str | ||
uc Str | ||
lc Str | ||
capitalize Str | ||
fc Str | ||
flip Str | ||
trans Str | ||
index Str | ||
rindex Str | ||
ords Str | ||
split Str | ||
match Str | ||
comb Str | ||
subst Str | ||
sprintf Str | ||
printf Str | ||
samecase Str | ||
trim Str | ||
trim-leading Str | ||
trim-trailing Str | ||
eval Str | ||
=end table | ||
=end pod |