typesafety
view release on metacpan or search on metacpan
typesafety.pm view on Meta::CPAN
my $lastline; my $lastfile; my $lastpack; # set from COP statements as we go
#
# debugging
#
use Carp 'confess', 'cluck';
use B::Concise 'concise_cv';
sub debug { my @args = @_; my $line = (caller)[2]; print "debug: $line: ", @args, "\n" if $debug; }
sub nastily () { " in package $lastpack, file $lastfile, line $lastline"; }
# $SIG{__DIE__} = $SIG{INT} = sub {
# # when someone does kill -INT <our pid> from the command line, dump our stack and exit
# print STDERR shift, map { (caller($_))[0] ? sprintf("%s at line %d\n", (caller($_))[1,2]) : ''; } 0..30;
# print STDERR join "\n", @_;
# exit 1;
# };
typesafety.pm view on Meta::CPAN
sub reset_prototype { typesafety::confess } # typesafety::methodob
sub shift_prototype { typesafety::confess } # typesafety::methodob
sub aelem_prototype { typesafety::confess } # typesafety::methodob
sub new {
my $self = bless ['none', typesafety::source_status(), (undef) x 4, [], [], undef], shift();
while(@_) {
my $f = shift; $self->$f = shift;
}
# ignore the output string, just make sure that the fields required for diagnostics are defined
$self->created = (caller)[2];
$self->diagnostics();
typesafety::debug("typesafety::typeob: new: created ", $self->diagnostics());
return $self;
}
sub clone {
my $self = shift;
my @new = @$self;
# augment description - this is the primary (only?) change made to clones
$new[6] ||= ''; $new[6] .= ' ' . $_[0] if @_;
( run in 2.585 seconds using v1.01-cache-2.11-cpan-cdf2f3d4e48 )