Closed TheLostLambda closed 3 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.
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.?
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 lambda
s in a later exercise.
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
I think that sounds like a good idea! Are those concepts some of the ones shared between tracks?
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
defun
defun
with a docstring&optional
&rest
to take an arbitrary number of arguments&key
supplied-p
parameters with optional / keyword argumentsOut of scope
lambda
flet
,labels
, etc.&aux
keyword&allow-other-keys
keywordvalues
return-from
Concepts
function-definition
Prerequisites
expressions
integers
arithmetic
conditionals
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.