From 3573d32150781d27a03e05e9afbf70a5f45c7fb6 Mon Sep 17 00:00:00 2001 From: Shunsuke Shibayama Date: Sun, 30 Oct 2022 17:56:26 +0900 Subject: [PATCH] Update docs --- doc/EN/syntax/00_basic.md | 4 ++-- doc/EN/syntax/01_literal.md | 13 ++++++++----- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/doc/EN/syntax/00_basic.md b/doc/EN/syntax/00_basic.md index aa606a31..996a986a 100644 --- a/doc/EN/syntax/00_basic.md +++ b/doc/EN/syntax/00_basic.md @@ -79,10 +79,10 @@ The code after `#` is ignored as a comment. Use this to explain the intent of th ```python # Comment # `#` and after are ignored until a new line is inserted -# [ +#[ Multi-line comment Treated as a comment all the way up to the corresponding `]#` -]# +]# ``` ## Expressions, separators diff --git a/doc/EN/syntax/01_literal.md b/doc/EN/syntax/01_literal.md index 2bcee327..8b52a98b 100644 --- a/doc/EN/syntax/01_literal.md +++ b/doc/EN/syntax/01_literal.md @@ -14,6 +14,8 @@ 0.00, -0.0, 0.1, 400.104, ... ``` +Note that the Ratio type is different from the Float type; the API is the same, but there are differences in the accuracy and efficiency of the calculation results. + If a `Ratio` literal has an integer or decimal part of `0`, you can omit the `0`. ```python @@ -62,7 +64,7 @@ Each of these literals has its own documentation describing them separately, so ### [Array Literal](./10_array.md) ```python -[], [1], [1, 2, 3], ["1", "2",], [1, "1", True, [1]], ... +[], [1], [1, 2, 3], ["1", "2",], ... ``` ### [Tuple Literal](./11_tuple.md) @@ -86,7 +88,7 @@ Each of these literals has its own documentation describing them separately, so ### [Set Literal](./14_set.md) ```python -{}, {1}, {1, 2, 3}, {"1", "2", "1"}, {1, "1", True, [1]} ... +{}, {1}, {1, 2, 3}, {"1", "2", "1"}, ... ``` As a difference from `Array` literals, duplicate elements are removed in `Set`. @@ -112,10 +114,11 @@ None ## Range Object ```python -assert 0..5 == {1, 2, 3, 4, 5} assert 0..10 in 5 assert 0..<10 notin 10 assert 0..9 == 0..<10 +assert (0..5).to_set() == {1, 2, 3, 4, 5} +assert "a" in "a".."z" ``` ## Float Object @@ -130,10 +133,10 @@ Float objects are constructed by multiplying a `Ratio` object by `f64`, which is ## Complex Object ```python -1+2im, 0.4-1.2im, 0im, im +1+2Im, 0.4-1.2Im, 0Im, Im ``` -A `Complex` object is simply an arithmetic combination of an imaginary unit object, `im`. +A `Complex` object is simply an arithmetic combination of an imaginary unit object, `Im`. ## *-less multiplication