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: conditionals #1012

Closed TheLostLambda closed 4 years ago

TheLostLambda commented 4 years ago

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 write when, unless, if, cond, and case 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

Out of scope

Concepts

Prerequisites

Resources to refer to

Hints

After

Representer

Analyzer

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 avoid eq, 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 from eql.

Help

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

verdammelt commented 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).

TheLostLambda commented 4 years ago

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!