Enumerate cards simplified/info management#8458
Merged
NBKelly merged 16 commits intomtgred:masterfrom Dec 9, 2025
Merged
Conversation
NoahTheDuke
reviewed
Dec 9, 2025
NoahTheDuke
reviewed
Dec 9, 2025
|
|
||
| (defn enumerate-cards | ||
| "Enumerates a collection of cards, optionally in sorted order" | ||
| ([cards] (enumerate-cards cards nil)) |
Collaborator
There was a problem hiding this comment.
Should we default to sorted?
Collaborator
Author
There was a problem hiding this comment.
I think it could be either, but:
- The default behaviour (unsorted) means if you forget the key, the info is slightly harder to parse
- The default being sorted means if you forget the key, you leak info
So I think this is safer.
Collaborator
There was a problem hiding this comment.
How does sorted leak info?
Collaborator
Author
|
Oh whoops, I definitely didn't think that through correctly.
https://proton.me/mail/home
…-------- Original Message --------
On Wednesday, 12/10/25 at 12:14 Noah Bogart ***@***.***> wrote:
@NoahTheDuke commented on this pull request.
---------------------------------------------------------------
In [src/clj/game/utils.clj](#8458 (comment)):
> @@ -123,6 +123,14 @@
(str/join (str " " sep " ") strings)
(str (apply str (interpose ", " (butlast strings))) (str ", " sep " ") (last strings)))))
+(defn enumerate-cards
+ "Enumerates a collection of cards, optionally in sorted order"
+ ([cards] (enumerate-cards cards nil))
How does sorted leak info?
—
Reply to this email directly, [view it on GitHub](#8458 (comment)), or [unsubscribe](https://github.com/notifications/unsubscribe-auth/ACFMQTNZ5N3IOUVZCUWVPZD4A5JTVAVCNFSM6AAAAACORP4WE2VHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZTKNRQGEYDMOBRGQ).
You are receiving this because you modified the open/close state.Message ID: ***@***.***>
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
enumerate-cardsfn which is cleaner than (enumerate-str (map :title/get-title ...))`, and supports sorting where appropriate