Closed TheLostLambda closed 4 years ago
Re-reviewing this and have some questions: is the idea of a sameness
concept still on the table?(and characters could be safe to use in case
as well...).
I can't think of how to get a student to use when
and unless
however. That is how to write a test that will cause a student to use when
rather than if
or for that matter cond
. It seems that the differences are stylistic rather than functional. Perhaps it will be the job of the analyzer/representer to help steer the student? But will those be in play for concept exercises? (i'll have to look into that).
I'm thinking that sameness
could still be it's own concept, as that seems like a sizeable chunk of information. And we could use characters if that's easier, I just hadn't added it to avoid adding characters
as a prerequisite.
I think that the analysers will be active for concept exercises and, as you point out, this is probably to perfect place to apply one. I'll add a note in the issue under the analyser section!
This document describes how to implement the
conditionals
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
The goal of this exercise is to teach the student about the various
conditionals
within Common Lisp. The student should be able to recognize which conditional is the most appropriate in a given context and be able to confidently writewhen
,unless
,if
,cond
, andcase
expressions.Additionally, the student will be introduced to the concept of "true" and "false" values. That is to say, in Common Lisp,
nil
and'()
are "false", while all other values are "true"Learning objectives
when
andunless
for single-branch conditionsif
for two-branch conditionscond
for multi-branch conditionscase
andecase
for special, multi-branch conditionsOut of scope
eq
,eql
,equal
,equalp
, etc.)and
andor
ccase
macro, which actually does involve conditions and restartstypecase
macroConcepts
conditionals
truthy-and-falsy
Prerequisites
expressions
integers
arithmetic
symbols
Resources to refer to
Hints
After
Representer
Analyzer
cond
vsif
vswhen
, so the analyzer, not the test suite, needs to pick up on this.Implementing
When implementing this exercise, avoid the topic of
sameness
as much as possible, as that is its own concept. Stick to only using values as true / false or basic numerical relations (<
,>=
,=
, etc.) and avoideq
,eql
,equal
, etc.The
case
macro is a bit of an exception here. Just be sure to use symbols or numbers here so that the default:test
does not need to be changed fromeql
.Help
If you have any questions while implementing the exercise, please post the questions as comments in this issue.