Skip Menu |

This queue is for tickets about the JSON-PP CPAN distribution.

Report information
The Basics
Id: 125865
Status: rejected
Priority: 0/
Queue: JSON-PP

People
Owner: Nobody in particular
Requestors: sogerc1 [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: new functionality request, tie decoded hashes
Date: Tue, 17 Jul 2018 14:48:48 +0300
To: bug-JSON-PP [...] rt.cpan.org
From: sogerc1 <sogerc1 [...] gmail.com>
I've seen a few questions about this floating on the internet and I also had this problem a few times, that I would need to modify some json stuff but with keeping the order of keys in hashes. Encoding already works with tied hashes but would you consider adding a configuration option to tie every newly created hash to Tie::IxHash during decoding?
On Tue Jul 17 20:48:56 2018, sogerc1@gmail.com wrote: Show quoted text
> I've seen a few questions about this floating on the internet and I also > had this problem a few times, that I would need to modify some json stuff > but with keeping the order of keys in hashes. Encoding already works with > tied hashes but would you consider adding a configuration option to tie > every newly created hash to Tie::IxHash during decoding?
Sorry, no. You might want to try https://metacpan.org/pod/JSON::YAJL::Parser instead.
Subject: Re: [rt.cpan.org #125865] new functionality request, tie decoded hashes
Date: Wed, 18 Jul 2018 01:34:46 +0300
To: bug-JSON-PP [...] rt.cpan.org
From: sogerc1 <sogerc1 [...] gmail.com>
All right. May I ask why not? Or rather may I ask if there's a reason why I shouldn't fork JSON::PP and add the functionality myself? AFAICT from a superficial look I would only need to add one line of code and I can't imagine how that would hinder the module. Except of course the performance penalty but that's pretty much a given when tie()-ing hashes. On Tue, Jul 17, 2018 at 5:13 PM, Kenichi Ishigaki via RT < bug-JSON-PP@rt.cpan.org> wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=125865 > > > On Tue Jul 17 20:48:56 2018, sogerc1@gmail.com wrote:
> > I've seen a few questions about this floating on the internet and I also > > had this problem a few times, that I would need to modify some json stuff > > but with keeping the order of keys in hashes. Encoding already works with > > tied hashes but would you consider adding a configuration option to tie > > every newly created hash to Tie::IxHash during decoding?
> > Sorry, no. > > You might want to try https://metacpan.org/pod/JSON::YAJL::Parser instead. > >
On Wed Jul 18 07:34:54 2018, sogerc1@gmail.com wrote: Show quoted text
> All right. > May I ask why not? Or rather may I ask if there's a reason why I > shouldn't > fork JSON::PP and add the functionality myself? AFAICT from a > superficial > look I would only need to add one line of code and I can't imagine how > that > would hinder the module. Except of course the performance penalty but > that's pretty much a given when tie()-ing hashes.
Because the feature isn't compatible with JSON::XS (and its fork), and thus doesn't help JSON.pm users in general. I don't want to add a feature that is only available to JSON::PP, to keep things simple. If you do want to fork JSON::PP to add your feature, well I think it's OK as long as you choose a name that wouldn't conflict with a future version of JSON::PP, but if you do, I'd rather recommend to use much cleaner JSON::Tiny as your base, or, as I said before, use JSON::YAJL as it should be faster and spare you the burden to maintain the fork. Show quoted text
> > On Tue, Jul 17, 2018 at 5:13 PM, Kenichi Ishigaki via RT < > bug-JSON-PP@rt.cpan.org> wrote: >
> > <URL: https://rt.cpan.org/Ticket/Display.html?id=125865 > > > > > On Tue Jul 17 20:48:56 2018, sogerc1@gmail.com wrote:
> > > I've seen a few questions about this floating on the internet and I > > > also > > > had this problem a few times, that I would need to modify some json > > > stuff > > > but with keeping the order of keys in hashes. Encoding already > > > works with > > > tied hashes but would you consider adding a configuration option to > > > tie > > > every newly created hash to Tie::IxHash during decoding?
> > > > Sorry, no. > > > > You might want to try https://metacpan.org/pod/JSON::YAJL::Parser > > instead. > > > >