crystal icon indicating copy to clipboard operation
crystal copied to clipboard

Adding docs for Integer#downto

Open yb66 opened this issue 1 year ago • 3 comments

I've a small pull request to put in that adds some docs to downto as missing docs bother me, even for "obvious" stuff. It also renames the variable to to limit a là Ruby, because downto(limit) reads better than downto(to), especially for writing documentation. I've matched that up in the DowntoIterator for consistency.

As an aside, none of the issue templates really seemed appropriate for this, any chance of one for documentation? (or something like "other")

Regards, iain

PS Yes, I meant Int not Integer

yb66 avatar Sep 10 '22 09:09 yb66

Sounds good.

Adding documentation is always welcome and doesn't necessarily require writing an issue about it first. If there's something that's up for discussion, I think the language improvement discussion choice is good. Same for changing the API, it's a language improvement discussion.

straight-shoota avatar Sep 10 '22 09:09 straight-shoota

I'll keep it in mind, thanks. I'll draft a template for documentation issues when I can, hopefully remove a little bit of friction, docs are always a good one for newcomers to have a go at :)

Regards, iain

yb66 avatar Sep 10 '22 09:09 yb66

I'm not sure about changing to to limit. It's not a huge improvement, so the question stands whether it's worth it. We'd have to support to as a named argument as well for backwards compatibility. This should also be discussed together with Int#upto which has the same parameter name. In Ruby, both parameters are called limit, in Crystal, both are called to. They should definitely match up.

straight-shoota avatar Sep 10 '22 10:09 straight-shoota