houhoulis / gnu-apl

Exercism exercises in GNU APL.

Home Page:http://exercism.io/languages/gnu-apl

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Exercism GNU APL Track

build status

Exercism exercises in GNU APL.

Setup

Installing GNU APL

On MacOS, GNU APL is available as a Homebrew formula; just type brew install gnu-apl to install it.

On other operating systems, the simplest way to install GNU APL is probably to follow the instructions on the GNU APL website. Version 1.6 works, but version 1.7 has some bugs involving the )COPY system command that prevent it from working for Exercism. If you want 1.7 features for Exercism, then build it from source at SVN commit 945 (when the bug was fixed) or later.

Installing a keyboard layout

APL uses many symbols that don't appear on most keyboard layouts, so you'll probably want to install an APL keyboard layout. The keyboard layouts from Dyalog seem to work well, and are available for free download for all modern operating systems. The same page also has links to fonts optimized for APL code (and even ordering information for physical keyboards with APL symbols on them).

Contributing

Thank you so much for contributing! 🎉

Please read about how to get involved in a track. Be sure to read the Exercism Code of Conduct.

We welcome pull requests of all kinds. No contribution is too small.

We encourage contributions that provide fixes and improvements to existing exercises. Please note that this track's exercises must conform to the Exercism-wide standards described in the documentation. If you're unsure about how to make a change, then go ahead and open a GitHub issue, and we'll discuss it.

Exercise Tests

At the most basic level, Exercism is all about the tests. You can read more about how we think about test suites in the Exercism documentation.

We are currently using GNU APL's testing framework, with some extra tooling found in the test.apl file at the root of the track. So test files should be called <exercise-name>.tc, and should be in the following format. ( indicates comments that should be in the actual test file; # are explanatory comments for the purposes of this README.)

log'./<exercise-name>.tc.log'
 ')COPY ',(⎕FIO 30),'/../../test.apl'

test∆copy_relative '<exercise-name>.apl'
test∆clear_log log

# The preceding lines are boilerplate, and must be in every test file (sorry about that!).  The actual test code follows.

 ∇greet # Name of function being tested; not mandatory, but nice.

 it returns a greeting to the supplied name # description of test case
  1⎕CR greet 'Chris' # APL code to execute; 1⎕CR quotes strings and does other nice things
'Hello, Chris!' # exact expected output

 when left argument is supplied, uses it instead of 'Hello' # another test case
  1⎕CR 'Good morning' greet 'Sandy'
'Good morning, Sandy!'

test∆show_log log # this must be at the end of the file so that the test results get displayed to STDERR

When in doubt, copy the format of the existing test files, or otherwise do what seems sensible.

Opening an Issue

If you plan to make significant or breaking changes, please open an issue so we can discuss it first. If this is a discussion that is relevant to more than just the GNU APL track, please open an issue in exercism/discussions.

Submitting a Pull Request

Pull requests should be focused on a single exercise, issue, or conceptually cohesive change. Please refer to Exercism's pull request guidelines.

Verifying Your Change

Before submitting your pull request, you'll want to verify the changes in two ways:

  • Run all the tests for the GNU APL exercises
  • Run an Exercism-specific linter to verify the track

All the tests for GNU APL exercises can be run from the top level of the repo with

bin/run-all-tests

For the Exercism-specific linting, please see the documentation.

Contributing a New Exercise

Please see the documentation about adding new exercises.

Useful notes:

  • Each exercise must stand on its own. Do not reference files outside the exercise directory (except for the supplied test.apl). They will not be included when the user fetches the exercise.
  • Exercises should use only the GNU APL core language. If it is feasible, they should be portable to other APL interpreters too (such as Dyalog). This shouldn't be hard in most cases, since GNU APL adheres closely to the ISO 13751 standard.
  • Exercises must conform to the Exercism-wide standards described in the documentation.
  • Each exercise should have a test suite, an example solution, a README (generated by Configlet), and a template file for the real implementation (optional). The CI build expects files to be named using the following convention (where <exercise-name> is the slug as it appears in the config file):
    • <exercise-name>/
      • README.md
      • <exercise-name>.tc (test suite)
      • <exercise-name>-example.apl (example solution)
      • <exercise-name>.apl (optional template)
  • Make sure your example file (and template, if you have one) has an initial #! (shebang) line; GNU APL doesn't seem to like to execute files without it when they're loaded from the command line. We recommend something like the following:
#!/usr/bin/env apl --script
  • Be sure to add the exercise to the appropriate place in the config.json file.

About

Exercism exercises in GNU APL.

http://exercism.io/languages/gnu-apl

License:MIT License


Languages

Language:APL 52.7%Language:Shell 33.0%Language:Dockerfile 14.3%