Skip Menu |

This queue is for tickets about the JSON CPAN distribution.

Report information
The Basics
Id: 47602
Status: rejected
Priority: 0/
Queue: JSON

People
Owner: Nobody in particular
Requestors: blue [...] thisisnotmyrealemail.com
Cc:
AdminCc:

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



Subject: accept scalar ref for json text
for a large json string, it would be more efficient to pass a reference to the string to avoid unnecessary copying. please allow either a scalar or scalar ref for json strings.
On 2009-7月-05 日 20:26:54, blue wrote: Show quoted text
> for a large json string, it would be more efficient to pass a reference > to the string to avoid unnecessary copying. please allow either a scalar > or scalar ref for json strings.
Sorry, I missed your report. what you want to do is this? decode_json( \$large_json_text ); Currently I don't have a plan about the feature. But I think that a resource saving will be realized by incr_parse. Regards,
Closed.
From: justincase [...] yopmail.com
On Tue Mar 30 04:37:57 2010, MAKAMAKA wrote: Show quoted text
> On 2009-7月-05 日 20:26:54, blue wrote:
> > for a large json string, it would be more efficient to pass a reference > > to the string to avoid unnecessary copying. please allow either a scalar > > or scalar ref for json strings.
> > Sorry, I missed your report. > what you want to do is this? > > decode_json( \$large_json_text ); > > Currently I don't have a plan about the feature. > But I think that a resource saving will be realized by incr_parse. > > Regards,
I was about to create a separate ticket for the same feature before I found this ticket. It's more convenient to allow either a scalar or scalar ref and it's a widely used pattern. See the results of this google search: http://google.com/search?q=site%3Asearch.cpan.org+allow+either+scalar+or+scalar+ref Also, the incremental parser should also accept a scalar ref since it's possible to feed a very large string to it.
On Thu Mar 31 11:43:40 2011, justincase wrote: Show quoted text
> On Tue Mar 30 04:37:57 2010, MAKAMAKA wrote:
> > On 2009-7月-05 日 20:26:54, blue wrote:
> > > for a large json string, it would be more efficient to pass a > > > reference > > > to the string to avoid unnecessary copying. please allow either a > > > scalar > > > or scalar ref for json strings.
> > > > Sorry, I missed your report. > > what you want to do is this? > > > > decode_json( \$large_json_text ); > > > > Currently I don't have a plan about the feature. > > But I think that a resource saving will be realized by incr_parse. > > > > Regards,
> > I was about to create a separate ticket for the same feature before I > found this ticket. It's more convenient to allow either a scalar or > scalar ref and it's a widely used pattern. See the results of this > google search: > http://google.com/search?q=site%3Asearch.cpan.org+allow+either+scalar+or+scalar+ref > > Also, the incremental parser should also accept a scalar ref since > it's > possible to feed a very large string to it.
I understand the convenience you mentioned, but because \1 and \0 have special meanings in JSON and its backends, we can't accept this. Thanks.