-
Notifications
You must be signed in to change notification settings - Fork 10
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
over-simplifying #67
Comments
Follow-up on eddelbuettel/rcppsimdjson#10 (comment) Is the following what's desired? test1 <- jsonify::from_json(
'{
"a": [
1,
[
2,
[
3
]
]
]
}', simplify = FALSE
) # except w/ the default `simplify = TRUE`
target1 <- list(
a = list(
1L,
list(
2L,
list(
3L
)
)
)
)
stopifnot(identical(test1, target1))
test2 <- jsonify::from_json(
'{
"a": [
1,
[
2,
[
3,
4
]
]
]
}'
)
target2 <- list(
a = list(
1L,
list(
2L,
c(3L,
4L)
)
)
)
stopifnot(identical(test2, target2)) |
Yes. But, now you've brought it up, I'm having a slight crisis-of-confidence on how the "simplifying" is working vs what I intended it to do back when it was written... |
This is seemingly a one-off edge case that needs handling, rather than something systemic ## incorrect
from_json( '[1,[2]]' )
# [,1]
# [1,] 1
# [2,] 2 Given these exmples are correct ## right
from_json( '[[1,2],2]' )
# [[1]]
# [1] 1 2
#
# [[2]]
# [1] 2
from_json( '[5,[6,7]]' )
# [[1]]
# [1] 5
#
# [[2]]
# [1] 6 7 |
Notes for me to remember in the morning:
|
I'm simplifying one-step too much in this exmaple
smaller example for testing
from_json('[1,[2]]')
The text was updated successfully, but these errors were encountered: