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 reverse-string approaches #335

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

BNAndras
Copy link
Member

@ErikSchierboom, here are the three approaches I'm looking at. Before I fill these out further, do you think the substring and index-based techniques are different enough to justify separate approaches?

Copy link
Member

@ErikSchierboom ErikSchierboom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Before I fill these out further, do you think the substring and index-based techniques are different enough to justify separate approaches?

I'm not familiar enough with Racket syntax, but does the reversing-by-index approach also use recursion? I don't see it used explicitly, but it probably is there?

@BNAndras
Copy link
Member Author

does the reversing-by-index approach also use recursion? I don't see it used explicitly, but it probably is there?

No, build-string internally makes a string of N length and then loops over the indices to update each element. See https://github.com/racket/racket/blob/05c3fe4a92bb7d310675d2ffda2d55fdd24a596a/racket/collects/racket/private/list.rkt#L303. I can tweak that approach to use string-set! explicitly to make it clear there's no recursion.

Copy link
Member

@ErikSchierboom ErikSchierboom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great! Then let's keep it like this. The only thing you also have to do is to add an introduction key with authors to the config.json (see configlet output).

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