| 1 | package Sidef::Object::Convert; | ||
| 2 | |||
| 3 | # Used as parent by Sidef::Object::Object. | ||
| 4 | |||
| 5 | 1 | ▶ | use utf8; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 6 | 1 | ▶ | use 5.016; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 7 | |||
| 8 | 1 | ▶ | use overload; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 9 | 1 | ▶ | use Sidef::Types::Bool::Bool; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 10 | |||
| 11 | 0 | ▶ | sub to_type { |
|
Subroutine
to_type: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 12 | 0 | my ($self, $obj) = @_; | |
| 13 | 0 | $obj->new($self); | |
| 14 | } | ||
| 15 | |||
| 16 | 0 | ▶ | sub to_str { |
|
Subroutine
to_str: not called CC=1 SCAR=6.9
Pod
undocumented
| |||
| 17 | 0 | $_[0]; | |
| 18 | } | ||
| 19 | |||
| 20 | 1 | *to_s = \&to_str; | |
| 21 | |||
| 22 | 0 | ▶ | sub to_num { |
|
Subroutine
to_num: not called CC=1 SCAR=6.9
Pod
undocumented
| |||
| 23 | 0 | Sidef::Types::Number::Number->new($_[0]); | |
| 24 | } | ||
| 25 | |||
| 26 | 1 | *to_n = \&to_num; | |
| 27 | |||
| 28 | 0 | ▶ | sub to_int { |
|
Subroutine
to_int: not called CC=1 SCAR=6.9
Pod
undocumented
| |||
| 29 | 0 | Sidef::Types::Number::Number->new($_[0])->int; | |
| 30 | } | ||
| 31 | |||
| 32 | 1 | *to_i = \&to_int; | |
| 33 | |||
| 34 | 0 | ▶ | sub to_float { |
|
Subroutine
to_float: not called CC=1 SCAR=6.9
Pod
undocumented
| |||
| 35 | 0 | Sidef::Types::Number::Number->new($_[0])->float; | |
| 36 | } | ||
| 37 | |||
| 38 | 1 | *to_f = \&to_float; | |
| 39 | |||
| 40 | 0 | ▶ | sub to_rat { |
|
Subroutine
to_rat: not called CC=1 SCAR=6.9
Pod
undocumented
| |||
| 41 | 0 | Sidef::Types::Number::Number->new($_[0])->rat; | |
| 42 | } | ||
| 43 | |||
| 44 | 1 | *to_r = \&to_rat; | |
| 45 | |||
| 46 | 0 | ▶ | sub to_array { |
|
Subroutine
to_array: not called CC=1 SCAR=6.9
Pod
undocumented
| |||
| 47 | 0 | Sidef::Types::Array::Array->new($_[0]); | |
| 48 | } | ||
| 49 | |||
| 50 | 1 | *to_a = \&to_array; | |
| 51 | |||
| 52 | 0 | ▶ | sub to_vector { |
|
Subroutine
to_vector: not called CC=1 SCAR=6.9
Pod
undocumented
| |||
| 53 | 0 | Sidef::Types::Array::Vector->new($_[0]); | |
| 54 | } | ||
| 55 | |||
| 56 | 1 | *to_v = \&to_vector; | |
| 57 | |||
| 58 | 0 | ▶ | sub to_matrix { |
|
Subroutine
to_matrix: not called CC=1 SCAR=6.9
Pod
undocumented
| |||
| 59 | 0 | Sidef::Types::Array::Matrix->new(@{$_[0]}); | |
| 60 | } | ||
| 61 | |||
| 62 | 1 | *to_m = \&to_matrix; | |
| 63 | |||
| 64 | 0 | ▶ | sub to_file { |
|
Subroutine
to_file: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 65 | 0 | Sidef::Types::Glob::File->new("$_[0]"); | |
| 66 | } | ||
| 67 | |||
| 68 | 0 | ▶ | sub to_dir { |
|
Subroutine
to_dir: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 69 | 0 | Sidef::Types::Glob::Dir->new("$_[0]"); | |
| 70 | } | ||
| 71 | |||
| 72 | 0 | ▶ | sub to_regex { |
|
Subroutine
to_regex: not called CC=1 SCAR=6.9
Pod
undocumented
| |||
| 73 | 0 | Sidef::Types::Regex::Regex->new("$_[0]"); | |
| 74 | } | ||
| 75 | |||
| 76 | 1 | *to_re = \&to_regex; | |
| 77 | |||
| 78 | 0 | ▶ | sub to_bool { |
|
Subroutine
to_bool: not called CC=1 SCAR=6.9
Pod
undocumented
| |||
| 79 | 0 | Sidef::Types::Bool::Bool::TRUE; | |
| 80 | } | ||
| 81 | |||
| 82 | 1 | *to_b = \&to_bool; | |
| 83 | |||
| 84 | 0 | ▶ | sub to_set { |
|
Subroutine
to_set: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 85 | 0 | Sidef::Types::Set::Set->new($_[0]); | |
| 86 | } | ||
| 87 | |||
| 88 | 0 | ▶ | sub to_bag { |
|
Subroutine
to_bag: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 89 | 0 | Sidef::Types::Set::Bag->new($_[0]); | |
| 90 | } | ||
| 91 | |||
| 92 | 0 | ▶ | sub to_caller { |
|
Subroutine
to_caller: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 93 | 0 | Sidef::Module::OO->__NEW__("$_[0]"); | |
| 94 | } | ||
| 95 | |||
| 96 | 0 | ▶ | sub to_fcaller { |
|
Subroutine
to_fcaller: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 97 | 0 | Sidef::Module::Func->__NEW__("$_[0]"); | |
| 98 | } | ||
| 99 | |||
| 100 | 1 | 1 | |