Skip to content

Commit

Permalink
be [Cool]
Browse files Browse the repository at this point in the history
  • Loading branch information
moritz committed Jun 28, 2012
1 parent 8bac80e commit 1a2dd21
Showing 1 changed file with 87 additions and 0 deletions.
87 changes: 87 additions & 0 deletions lib/Cool.pod
@@ -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

0 comments on commit 1a2dd21

Please sign in to comment.