3 ms·
That sounds like how you have to access JSON data dynamically in any statically typed language.
by IshKebab 9y ago
That sounds like how you have to access JSON data dynamically in any statically typed language.
- actsasbuffoon 9y agoBut these other languages wouldn't necessarily remain type-safe. The functor approach doesn't involve any type casting, and null pointer exceptions are impossible.
- IshKebab 9y agoSo, like this sort of thing: int JsonValue::getAsInt(int defaultIfError); Or, in Go: func (JsonValue*) AsInt() (int64, error) Or are you just talking about it returning the value as a Rust-style Result sum type?