Skip to content
No description, website, or topics provided.
Ruby
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
examples
src
.gitignore
README.md
functions.md
tidy.rb

README.md

Tidy

Tidy is a language made for the "Range" Language Design Challenge.

list of available functions

What is a range?

I define a range as an iterable, possibly infinite sequence of numbers, with some sort of start and end point. I will use the following notation to talk about ranges:

[a, b] = all integers between a and b inclusive
[a, b[ = all integers between a and b, excluding b
]a, b] = all integers between a and b, excluding a
]a, b[ = all integers between a and b, excluding a and b

The bounds can be infinite. For example, [1, ∞) is the range starting at one and continuing infinitely.

How does the language operate?

Tidy operates on many data types, particularly, through transforming ranges. Let's frame a few problems with these types of ranges.

Suppose we want to check if a number n is prime. We know that n cannot be prime if it has any divisors. We know all divisors of n lie in the range [2, n). Consider the following code:

n := 13
divisors := { x : n % x = 0 } from [2, n[
out(count(divisors) = 0)

Let's decompose this. [2, n[.

(sorry for incomplete tutorial)

You can’t perform that action at this time.