Skip to content

ConorOBrien-Foxx/Tidy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tidy

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

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)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages