Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] work on concepts #78

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ There is a tool, that counts and prints exercises unlocked by each concept, and

`_tools/concepts-practice.red`

Recently, Exercism introduced tasks, which are just parts of an exercise. Currently, they are only possible in concept exercises. You can indicate, which tests are specific for particular task. Each track links tasks with tests [in a way maintainers find appropriate](https://github.com/exercism/docs/blob/main/building/tooling/test-runners/interface.md#task-id). In Red it is done by adding `" task_id: 1"` at the end of the test description string in exercise test file. Notice three spaces before "task_id".

## Contact

Besides creating issues and commenting in this repository, you are welcome to post on [Red's "training" Gitter channel](https://gitter.im/red/training).
16 changes: 16 additions & 0 deletions concepts/basics/introduction.md
Original file line number Diff line number Diff line change
@@ -1 +1,17 @@
# Introduction

Everything you need to run Red programs and do exercises in Exercism:

* Using editor
* Running your code
* Executing tests for exercises

Red code is built from **blocks** and **values**. Block can contain values and other blocks. In fact, a block is also a value.

Each value has its **type**. Block's type is `block!`. And type is also a value of type `type!`. There are lots of types in Red, like numbers, dates, tuples, urls, paths, strings, binary data, maps, vectors, emails... about a 50 of them.

There are also **comments**. They start with `;` and end with end of line. Red has also block comments, but they are a different kind. In fact, they are accomplished with a function called `comment`, which takes any type of argument (can be block, string or anything) and just does absolutely nothing.

Red is a homoiconic language, so it's code is actually just a data, until we **evaluate** a block. Which simply means, that we "execute" it and get value of last expression.


9 changes: 9 additions & 0 deletions concepts/conditionals/introduction.md
Original file line number Diff line number Diff line change
@@ -1 +1,10 @@
# Introduction

what's "truthy"

* if
* unless
* either
* case
* default: `true` or word, like `'default`
* switch
8 changes: 8 additions & 0 deletions concepts/dsl/introduction.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
# Introduction

> Provide a brief introduction to a student who has not yet completed the corresponding concept exercise.

There are various ways to implement a DSL:

* define functions and run DSL as Red code
* parse DSL as Red blocks of data
* parse DSL strings

... and any combinations of these methods.
4 changes: 4 additions & 0 deletions concepts/evaluation/introduction.md
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
# Introduction

Precedence is left to right

There is a fun part with comparison and math operators
1 change: 1 addition & 0 deletions concepts/functions/about.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ TODO:

* Most exercises here are written as functions, because they are reusable and easy to test, which makes them perfect for separating pieces of code.
* Function names by convention should be verbs or contain verbs.
* In Red everything is a function, even expressions, that are keywords or operators in other languages, like `if` or `+`.