News for hackers. Stuff that matters.
Re:The Crystal Programming Language by actsasbuffoon on Tuesday April 17, 2018 @05:28PM (#16862465)
But these other languages wouldn't necessarily remain type-safe.

The functor approach doesn't involve any type casting, and null pointer exceptions are impossible.

Re:The Crystal Programming Language by IshKebab on Wednesday April 18, 2018 @06:07AM (#16866070)
So, 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?