exercism/ceylon

Name: ceylon

Owner: exercism

Description: Exercism exercises in Ceylon.

Created: 2016-07-09 13:30:01.0

Updated: 2018-04-19 08:15:50.0

Pushed: 2018-04-19 08:15:49.0

Homepage: http://exercism.io/languages/ceylon

Size: 119

Language: Ceylon

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Exercism Ceylon Track

Build Status

Exercism problems in Ceylon.

Contributing Guide
Asking for help

If you're ever unsure about how to help, don't worry! You can just ask in the Exercism Gitter support channel or by creating an issue for the Ceylon track and we are happy to help you!

How to contribute

The Exercism-wide contributing guide covers topics relevant to contributing to the entire Exercism project, including but not limited to the Ceylon track.

Depending on what your contribution deals with, you may have to direct it at a certain repository:

Porting an exercise

The Exercism site provides a list of exercises not on the Ceylon track. A possible contribution would be to choose one of these exercises and add it to this track. The Exercism documentation repo has a guide on porting an exercise.

Note that you will need to add the problem to the exercises section in config.json as well, otherwise it will not be available via exercism fetch (or any other means, other than by cloning the repository).

The order in which the exercises are listed in config.json is the order in which they will be served by default by exercism fetch ceylon.

For the Ceylon track, the files needed to port an exercise are described in the next section about exercise structure.

Exercise structure

Each exercise is located in the exercises directory, in a directory with the same name as its slug (the leap exercise will be at exercises/leap, etc.). This directory should contain the following files and directories, where <slug> is the slug of the exercise with all hyphens deleted, and <Slug> is the CamelCased version:

Running the tests

As mentioned, Travis CI runs our tests to ensure that our exercises are solvable. The tests are run on all pull requests (PRs), and we should strive to only merge PRs for which the tests are passing.

It is possible to run these tests locally as well. In particular, the bin/test-exercise will test just one exercise:

test-exercise exercises/leap

This script automates the process of moving the example files in, running the tests, and then moving the example files back. This is useful when changing an exercise in this repository. The test can be run locally to make sure everything is working without having to wait for Travis CI.

Style and conventions

Various choices were made in the past to get the repository to the state it is in now. These choices aren't set in stone; they could be changed at a later date. But the rationale behind the current choices made will be noted here.

Style

This repository uses ceylon format: https://github.com/eclipse/ceylon.formatter.

This should be automatically installed with ceylon (it was known to be installed with SDKMan as of Ceylon 1.3.3).

CI will ensure that code follows ceylon format.

Idiomatic Ceylon

All example code should be idiomatic Ceylon, to set a good example for anyone who might look at this repository for solutions to the exercises. The current maintainer may have trouble with this point, since the current maintainer is only a Ceylon beginner and may not be familiar enough with the language to tell what is idiomatic or not. Help in this area is especially appreciated.

Project structure

The current maintainer finds it regrettable that the exercise slug must be repeated so many times: exercises/<slug>/source/<slug>/<Slug>.ceylon.

The current maintainer wishes there was less duplication, but does not really see a good way out. Any ideas here are welcome.

Stubs

We provide the stubs with signatures included because we felt it was not a sufficiently interesting learning experience to make students have to puzzle out the expected signatures by just looking at the tests.

Because Ceylon is a statically-typed language, the entire test suite must type-check before it can be run at all. Thus, not providing the type signatures forces the students to figure out the types for all the functions being tested, rather than being able to focus on just one at a time.

The Ceylon track is not the only track that had to make this decision. Other tracks have discussed this as well, and come to various conclusions.

If students suggest that they would like to have the challenge of figuring out type signatures, we would gladly change our minds on this point. They might suggest this on the exercism.io site, or on this repository via issues. It's likely that the latter is more often monitored.

Parameterized tests versus one test at a time

As mentioned above, we used parameterized tests since this avoids test code duplication.

Unfortunately, since by default all cases are enabled, this runs counter to the usual Exercism style in which only a single test case is enabled, and the student enables one more test case after making the previous one pass, taking an iterative process.

The ignore annotation does not seem like it can be applied to individual cases of a parameterized test.

One possible solution to this would be to comment out all cases except the first. If this solution were taken, students would need to be aware of this, and be informed that they need to uncomment the cases. The Travis CI run would need to uncomment the cases as well (without uncommenting any actual comments, which would probably cause syntax errors!).

The current maintainer does not have a good solution to this, so ideas here are welcome.

Ceylon icon

The Ceylon icon is assumed to be owned by Red Hat, Inc. It appears to be released under the Creative Commons Attribution Share-Alike 3.0 license. We have modified its colour scheme for use on Exercism.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.