exercism / v3

The work-in-progress project for developing v3 tracks
https://v3.exercism.io
Other
170 stars 163 forks source link

[Common Lisp] Implement new Concept Exercise: function-definition #953

Closed TheLostLambda closed 3 years ago

TheLostLambda commented 4 years ago

This issue describes how to implement the functions concept exercise for the Common Lisp 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

This exercise should focus on teaching defun and its most commonly used options. The student should be comfortable defining top-level functions and using optional and keyword arguments. They should also be introduced to the usage of docstrings.

Learning objectives

Out of scope

Concepts

Prerequisites

Resources to refer to

Hints

After

Feel free to mention more niche or advanced lambda-list parameters here, things like &allow-other-keys or &aux.

Representer

Analyzer

Implementing

Contrary to most exercises, the stub file for this exercise should not contain any defun's. Comments should be used to indicate which functions the student needs to implement.

Help

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

verdammelt commented 4 years ago

I think this looks good. Plenty of stuff in scope that will help the student have lots of tools in their toolbox for later use.

verdammelt commented 4 years ago

Taking a moment to re-review this. I'm assuming that the supplied-p-parameter for &optional and &key are in scope? How about &allow-other-keys? (I'm thinking the former is in scope by the later is out of scope).

As for the in-scope 'taking function parameters' - any ideas of how we'd do that in an exericse? I'm thinking apply and funcall might be not for this exercise. So perhaps the student must write a function that takes a function argument that is when passed to another function - such as map or count etc.?

TheLostLambda commented 4 years ago

Thanks for taking another look at this! Yes, I think the supplied predicates would be good to include, I'll add that to in scope. As for the &allow-other-keys, maybe it's not a focus of the exercise, but is something to mention in after.md?

And "taking function parameters" was poorly worded on my part, I just meant accepting parameters in a function. I think that higher-order functions are probably out of scope here. I think they would fix better with lambdas in a later exercise.

verdammelt commented 4 years ago

In reviewing existing concepts I think that this exercise could cover the 'function', 'default_argument', 'named_parameter', and 'rest_parameter' concepts rather than 'function-definition'.

Thoughts @TheLostLambda

TheLostLambda commented 4 years ago

I think that sounds like a good idea! Are those concepts some of the ones shared between tracks?