On Sat, Aug 19, 2023 at 9:40â¯AM Dave Mitchell <davem@iabyn.com> wrote: > On Sat, Aug 19, 2023 at 02:56:13AM +0000, Oodler 577 via perl5-porters > wrote: > > Does that help answer your initial questions? > > 'fraid not :-) > > If I am understanding correctly, Perl::Types is intended to be something > which can be used stand-alone, independent of RPerl, and which you want to > be bundled with the perl core. > > Within that context, how does adding 'use Perl::Types' at the top of a > perl (not RPerl) program do its thing? What mechanism are you using that > causes this line in a non-RPerl program to croak; > > my number $x; > ... > $x = 'foo'; # croak > > e.g. is it a source filter, set magic attached to $x, or ...? > > Also, from your reply about my mutator example not croaking by default, > this seems to imply that it's quite possible for $x to obtain a > non-numeric value under some circumstances. So, by default, what > circumstances will croak and which will silently allow $x to become > something other than a number? E.g. which of these lines croaks? > > $x = 'foo'; > $x =~ s/1/a/; > substr($x,0,1) = 'foo'; > my $y = substr($x,0,1); > > Just in general terms I'm still confused as to what effect adding > 'Perl::Types' to my program will have, and how it achieves that effect. > You're assuming that Perl::Types isn't all vaporware and this is a proposal by people who know what they're doing. It all becomes much clearer when you let go of those assumptions. LeonThread Previous | Thread Next