Coder Social home page Coder Social logo

ee7 / exercism-pyret Goto Github PK

View Code? Open in Web Editor NEW

This project forked from exercism/pyret

0.0 0.0 0.0 337 KB

Exercism exercises in Pyret.

Home Page: https://exercism.org/tracks/pyret

License: MIT License

Shell 2.45% PowerShell 0.62% Pyret 96.94%

exercism-pyret's Introduction

Exercism Pyret Track

Configlet .github/workflows/test.yml

Exercism exercises in Pyret.

Setup

If you're solving Exercism exercises offline, you'll need a recent copy of pyret-npm (0.0.27+). Currently, pyret-npm works on Linux and MacOS platforms although Windows users can run it via the WSL. However, you can also use Pyret's online IDE. In that case, you'll need to switch from the IDE's default essentials2021 namespace to the older essentials2020 supported by pyret-npm.

Support

For support with Pyret in Exercism, please visit the Pyret subcategory on the official Exercism forum.

Coding Style

Please consult the official Pyret style guide.

Testing

To test the exercises, run ./bin/verify-exercises on a Linux or MacOS platform. This command will iterate over all exercises and check to see if their exemplar/example implementation passes all the tests.

Contributing Guide

Please see Exercism's contributing guide.

At the moment, there's not a generator for Pyret exercises.

Here's the basic template for an exercise-slug-test.arr. Each check block corresponds to a single test case, and the string label is reported to the student. Each check block is wrapped inside a no-parameter function which is then stored inside the run field of a test value of the TestRun datatype. This test value also contains an active field which indicates whether a test should be run (true) or not (false). All test values go inside a list that Pyret iterates over at runtime, executing the functions within each test value marked as active.

A contributor is responsible for copying this template, adding the appropriate functions and check blocks, and populating the list at the bottom.

use context essentials2020

include file("exercise-slug.arr")

#|
  When working offline, all tests except the first one are skipped by default.
  Once you get the first test running, unskip the next one until all tests pass locally.
  Check the block comment below for further details.
|#

fun foo-returns-1():
  check "foo returns 1":
    foo() is 1
  end
end

fun bar-returns-2():
  check "bar returns 2":
    bar() is 2
  end
end

#|
  Code to run each test. Each line corresponds to a test above and whether it should be run.
  To mark a test to be run, replace `false` with `true` on that same line after the comma.
  test(test-a, true) will be run. test(test-a, false) will be skipped.
|#

data TestRun: test(run, active) end

[list: 
  test(foo true),
  test(bar, false),
].each(lam(t): when t.active: t.run() end end)

Track linting

configlet is an Exercism-wide tool for working with tracks. You can download it by running:

./bin/fetch-configlet

Run its lint command to verify if all exercises have all the necessary files and if config files are correct:

$ ./bin/configlet lint

The lint command is under development.
Please re-run this command regularly to see if your track passes the latest linting rules.

Basic linting finished successfully:
- config.json exists and is valid JSON
- config.json has these valid fields:
    language, slug, active, blurb, version, status, online_editor, key_features, tags
- Every concept has the required .md files
- Every concept has a valid links.json file
- Every concept has a valid .meta/config.json file
- Every concept exercise has the required .md files
- Every concept exercise has a valid .meta/config.json file
- Every practice exercise has the required .md files
- Every practice exercise has a valid .meta/config.json file
- Required track docs are present
- Required shared exercise docs are present

exercism-pyret's People

Contributors

bnandras avatar dependabot[bot] avatar erikschierboom avatar exercism-bot avatar ihid avatar isaacg avatar kytrinyx avatar meatball133 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.