logoalt Hacker News

turtletontinelast Saturday at 9:25 PM1 replyview on HN

I think there is an important difference here from both Option<T> and Result<T, E>: the C3 optional doesn’t allow an arbitrary error type, it’s just a C-style integer error code. I think that makes a lot of sense and fits perfectly with their “evolution, not revolution” philosophy. And the fact that the syntax is ‘type?’ rather than ‘Optional<type>’ also eases any confusion.


Replies

loeglast Saturday at 9:44 PM

Sure, there is a restriction on the type of E. This is similar to Zig's result ADT, I think?