exercism / rust

Exercism exercises in Rust.
https://exercism.org/tracks/rust
MIT License
1.47k stars 520 forks source link

Implement new Concept Exercise: iterators #1065

Closed workingjubilee closed 1 year ago

workingjubilee commented 4 years ago

This issue describes how to implement the iterator concept exercise for the Rust track.

Getting started

Please please please read the docs before starting. Posting PRs without reading these docs will be a lot more frustrating for you during the review cycle, and exhaust Exercism's maintainers' time. So, before diving into the implementation, please read up on the following documents:

Please also watch the following video:

Goal

Iterators are one of Rust's more versatile linguistic abstractions, so it is not possible to cover in a single exercise. This exercise has only the goal of covering the foundations of Iterator so that advanced usage can be covered in detail.

Learning objectives

Student should be able to...

Student may be able to...

Out of scope

Concepts

Prerequisites

Resources to refer to

Hints

After

Likely better for later exercises, but relevant:

Representer

This should require no special changes to the representer.

Analyzer

This should require no special changes to the analyzer.

Implementing

See our implementation guide for guidance. . You may want to make use of boil_exercise.sh in the concept directory

Help

If you have any questions while implementing the exercise, please post the questions as comments in this issue.

ghost commented 3 years ago

Found Tim McNamara's video tutorial which would be a great intermediate / continue learning post: https://tim.mcnamara.nz/post/618982870485172224/rust-iteration.

gilescope commented 3 years ago

Would luhn work well for this concept?

personally I would change the spec to allow single character numbers so that the implementation is slightly nicer when done as a single expression.

ghost commented 3 years ago

@gilescope I feel we'll only know by trying! So if you are up for it, give it a whirl! For concept exercises I am unsure of how it will go and don't want to waste time on Exercism specific metadata, I have used a draft PR with a single example.rs. exercism/v3#3061 is an example.

gilescope commented 3 years ago

Actually I think maybe we should aim for a functional rust track where each answer is expected to be one expression and the tasks getting gradually harder as we introduce different things. For example lune should be targeting as a showcase for try_fold.

nahuakang commented 2 years ago

@coriolinus I wouldn't mind working on this next (both the concept and concept exercise). But it seems like we should have covered the trait concept before building out iterator? Do you have an opinion what would be the concepts/concept exercises that should be ready before working on iterator? I'd be happy to work on those first and eventually cover this issue.

coriolinus commented 2 years ago

It looks to me as though this concept is about using iterators, not defining them. I'm not sure how useful it would be to require knowledge of traits first. My instinct is that it should be OK to have this concept depend solely on the methods concept, and then have students implement a generator (via the Iterator trait) as part of the traits concept, which naturally would then come after this one.

We have to mention in the concept documentation that it is a trait, but I think it's OK to defer further explanation for later.

On Thu, May 5, 2022, 16:35 Nahua @.***> wrote:

@coriolinus https://github.com/coriolinus I wouldn't mind working on this next (both the concept and concept exercise). But it seems like we should have covered the trait concept before building out iterator? Do you have an opinion what would be the concepts/concept exercises that should be ready before working on iterator? I'd be happy to work on those first and eventually cover this issue.

— Reply to this email directly, view it on GitHub https://github.com/exercism/rust/issues/1065#issuecomment-1118631214, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB3V4TXCYNJNE4VX53V7GPLVIPMCJANCNFSM4WXPOFKA . You are receiving this because you were mentioned.Message ID: @.***>

nahuakang commented 2 years ago

Happy to claim this if you assign it to me. Shall I also create an issue for the trait concept exercise?

coriolinus commented 2 years ago

Sounds good! Please do create a traits concept issue.

senekor commented 1 year ago

After several failed attempts to create a high-quality syllabus, I believe any future attempts will have to do their own design work from scratch.