You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// This function returns the list of objects read, and a boolean indicating if the end of the stream was reached.
read-stream-object-names: func(len: u64) -> result<tuple<list<object-name>, bool>, error>;
I implemented two back-ends for this. In one of them, I interpreted this as "it indicates it by being false if the end of the stream was reached." In the other, I interpreted it as "it indicates it by being true if the end of the stream was reached." I didn't discover this until I got the second back end spun up and into testing.
Now, one clear lesson from this is "Ivan is an idiot." And that's fair. But idiots abound.
At minimum, the documentation should explicitly state the behaviour, e.g. "a boolean which is <value> if the end of the stream has been reached."
But much better would be to use an enum e.g. enum stream-status { at-end, moar } and return that. Or return a record with named fields. Bare booleans, even with docs, are just too error-prone.
The text was updated successfully, but these errors were encountered:
From the
stream-object-names
WIT:I implemented two back-ends for this. In one of them, I interpreted this as "it indicates it by being false if the end of the stream was reached." In the other, I interpreted it as "it indicates it by being true if the end of the stream was reached." I didn't discover this until I got the second back end spun up and into testing.
Now, one clear lesson from this is "Ivan is an idiot." And that's fair. But idiots abound.
At minimum, the documentation should explicitly state the behaviour, e.g. "a boolean which is
<value>
if the end of the stream has been reached."But much better would be to use an enum e.g.
enum stream-status { at-end, moar }
and return that. Or return a record with named fields. Bare booleans, even with docs, are just too error-prone.The text was updated successfully, but these errors were encountered: