Skip to content
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

AsIs object for [] #11

Open
jeroen opened this issue Apr 16, 2014 · 1 comment
Open

AsIs object for [] #11

jeroen opened this issue Apr 16, 2014 · 1 comment

Comments

@jeroen
Copy link

jeroen commented Apr 16, 2014

In RJSONIO a [] json string gets converted to an AsIs object, see here. What is the reasoning behind this?

> library(RJSONIO)
> fromJSON("[]")
list()
> is(fromJSON("[]"))
[1] "AsIs"     "oldClass"
> is(fromJSON("[]"), "list")
[1] FALSE
@duncantl
Copy link
Owner

Hi Jeroen
AFAIR, this was to ensure round-tripping worked in cases where there was some ambiguity.
I can't recall if this is still necessary. But basically it is where an object degenerates to a scalar, for example, and it needs to be mapped back to a vector. But this is not the case here, but it is in that spirit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants