Skip to content
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

ADD PDResultSuccessEmpty #86

Merged
merged 4 commits into from
Nov 9, 2024

Conversation

ninovanhooff
Copy link
Collaborator

By using the Scoreboards API for Wheelsprung, it feels wrong to classify a result without data as an error.

Therefore I added an extra PDResultKind for this and documented the cases where this may be returned to the callback

@ninovanhooff ninovanhooff requested a review from Nycto October 29, 2024 14:42
src/playdate/scoreboards.nim Outdated Show resolved Hide resolved
@ninovanhooff
Copy link
Collaborator Author

ninovanhooff commented Oct 29, 2024

So a disadvantage is that you are forced to handle the new result kind also for the two responses that have a non-optional response: getScoreboards and getScores.

We could work around this by having two sets of types: PDRequiredResult + PDRequiredResultKind vs PDOptionalResult + PDOptionalResultKind.

That feels over-engineered. Feeling lukewarm about that, let's not do it. Unless you know of some fancy Nim feature that lets us express this nicely? @Nycto

@Nycto
Copy link
Collaborator

Nycto commented Oct 29, 2024

Well — let’s start with: what are we modeling here? Is it actually a failed request (like WiFi unavailable)? If so, why don’t the other requests include this response state?

@ninovanhooff ninovanhooff requested a review from Nycto November 6, 2024 21:08
@ninovanhooff
Copy link
Collaborator Author

qeued

Yeah, I guess the unavailable response is always relevant. Made the change to Unavailable

src/playdate/scoreboards.nim Outdated Show resolved Hide resolved
tests/t_scoreboards.nim Outdated Show resolved Hide resolved
@ninovanhooff ninovanhooff requested a review from Nycto November 8, 2024 18:18
@ninovanhooff ninovanhooff merged commit 5ef3109 into samdze:dev Nov 9, 2024
4 checks passed
@ninovanhooff ninovanhooff mentioned this pull request Dec 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants