New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Perl5 doesn't distinguish "originally was a string" and "originally was a number" and doesn't let one control caching of stringification #12801
Comments
From @demerphqI am not including a Perl version data in this ticket as it applies to Perl doesn't preserve the original type of a scalar var, so one has $x= "1"; This causes problems in serialization for variables that have been We should remember the original type. I believe Chip in the past did Related to this we do not give the user any ability to control the # dont let Perl chew up all our ram caching stuff we will only use once... I think there should be an easier way to control this behavior, and Cheers, -- |
From perl@profvince.com
My negative opinion on this hasn't changed since Vincent |
The RT System itself - Status changed from 'new' to 'open' |
From @demerphqOn 20 February 2013 03:29, Vincent Pit <perl@profvince.com> wrote:
With all due respect your objections rely on something that is "there's no safe way to do this besides stating explicitely in which kind If perl remembered that an SvPVIV was originally a PV then this would IMO this is doable if we want to do it. Yves -- |
From @chipdudeOn 2/19/2013 6:38 PM, demerphq wrote:
Indeed. But I'm not interesting it doing it right now. The effort |
From perl@profvince.com
I'm not sure how you can consider practical to tell people that 1 and
We can do a lot of things. The question is whether we should do them. Vincent |
From @demerphqOn 20 February 2013 04:05, Vincent Pit <perl@profvince.com> wrote:
Can you give an example where that would happen? You seem to be worried about a case im having problems understanding. I am worried about cases like this: $x= "0 but true"; I want to be able to know that this needs to be serialized as C<"0 but Similar I want to be able to know that $x= 1; that I can safely serialize $x as an SvIV and not as a SvPVIV, which So, what problem are you worried about in practice? I am really
Like I said, can you turn this from a hypothetical to a more
Well, you claimed it can't be safely done, I don't see how that can be true. And I said "with all due respect" for a reason: I wasn't trying to be
Yeah of course. No argument there. Yves -- |
From @ap* demerphq <demerphq@gmail.com> [2013-02-20 04:20]:
Right, the issue isn’t treating perfect equivalents like 1 and '1' as (I have argued before that if anything like this is done, then any core Regards, |
From @janduboisOn Thu, Feb 21, 2013 at 12:31 PM, Aristotle Pagaltzis <pagaltzis@gmx.de> wrote:
This is not generally true; "0 but true" is just a special case that $ perl -MDevel::Peek -e '$a="0"; $b=$a+1; Dump $a' $ perl -MDevel::Peek -e '$a="0 but"; $b=$a+1; Dump $a' $ perl -MDevel::Peek -e '$a="0 but true"; $b=$a+1; Dump $a' There are other special cases for "Inf" and "NaN" too, but it looks $ perl -MDevel::Peek -e '$a="Inf"; $b=$a+1; Dump $a' $ perl -MDevel::Peek -e '$a=2**9999; $b="$a"; Dump $a' I think though that the SVp_IOK difference may be an accidental Another problem with NaN and Inf is that their string representation Cheers, |
From @janduboisOn Thu, Feb 21, 2013 at 4:32 PM, Jan Dubois <jand@activestate.com> wrote:
Never mind, it doesn't actually work: $ perl -MDevel::Peek -e '$a=2**9999; $b=$a+1; $b="$a"; Dump $a' So there is no way to tell if they started as an NV or a PV. Cheers, |
Migrated from rt.perl.org#116871 (status was 'open')
Searchable as RT116871$
The text was updated successfully, but these errors were encountered: