From 2b3b0b298c0b3917ad85ae2c9a54dc2f37c1e034 Mon Sep 17 00:00:00 2001 From: sergeych Date: Sat, 31 May 2025 18:58:14 +0400 Subject: [PATCH] more docs on ranges --- docs/tutorial.md | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/docs/tutorial.md b/docs/tutorial.md index 3e75725..5db663c 100644 --- a/docs/tutorial.md +++ b/docs/tutorial.md @@ -9,7 +9,7 @@ __Other documents to read__ maybe after this one: - [Advanced topics](advanced_topics.md) - [OOP notes](OOP.md) - [math in Ling](math.md) -- Some class references: [List](List.md), [Real](Real.md) +- Some class references: [List](List.md), [Real](Real.md), [Range](Range.md) # Expressions @@ -585,6 +585,27 @@ There are self-assigning version for operators too: sum >>> 5050 +# Ranges + +Ranges are convenient to represent the interval between two values: + + 5 in (0..100) + >>> true + +It could be open and closed: + + assert( 5 in (1..5) ) + assert( 5 !in (1..<5) ) + >>> void + +Ranges could be inside other ranges: + + assert( (2..3) in (1..10) ) + >>> void + + +See [Ranges](Range.md) for detailed documentation on it. + # Comments // single line comment