Skip to content

Commit

Permalink
docs: 📝 Tutorials for data-type and Basic standard module updated
Browse files Browse the repository at this point in the history
  • Loading branch information
BHznJNs committed Aug 17, 2023
1 parent 3e96da8 commit 84b8499
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 1 deletion.
7 changes: 7 additions & 0 deletions tutorials/CN/标准库函数/basic.calcrs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ input("Please input something: ")
# 其它类型代码常量:
# - STRING
# - BOOLEAN
# - UNIQUE
# - ARRAY
# - MAP
# - LAZYEXPR
# - FUNCION
# - CLASS
Expand All @@ -38,6 +40,11 @@ float("1.1") # 1.1
# 接收两个 Number 类型的值作为分子和分母, 返回 (upper / lower)。
fraction(1, 2) # (1 / 2)

# 定义: unique(identifier $Str)
# 接收一个原始字符串值,
# 返回以该字符串为标识符的 Unique 类型值。
unique("identi str")

# 定义: bool(value $_)
# 将值转换为 Boolean 类型,当接收到
# Lazy-Expression | Function | Class | Object 类型的值时,
Expand Down
4 changes: 4 additions & 0 deletions tutorials/CN/语法教程/data_types.calcrs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import Basic
import String
import Array

Expand All @@ -9,6 +10,9 @@ number_float_var = 1.2 # 浮点型数字
bool_true_var = true
bool_false_var = false

# Unique 类型
unique_var = unique("identi str")

# 原始字符串类型
raw_str_var = "abcd"
# 字符串对象类型
Expand Down
5 changes: 5 additions & 0 deletions tutorials/EN/std-functions/basic.calcrs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ float("1.1") # 1.1
# Receives two int typed Number value as dividend and divisor, returns (upper / lower).
fraction(1, 2) # (1 / 2)

# Def: unique(identifier $Str)
# Receives a Raw-String,
# returns Unique typed value with inputed value as identifier.
unique("identi str")

# Def: bool(value $_)
# Convert value to Boolean type, will return true when received
# Lazy-Expression typed, Function typed, Class typed or Object typed value.
Expand Down
5 changes: 4 additions & 1 deletion tutorials/EN/syntax/data_types.calcrs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import Basic
import String
import Array

Expand All @@ -9,6 +10,9 @@ number_float_var = 1.2 # float number
bool_true_var = true
bool_false_var = false

# Unique type
unique_var = unique("identi str")

# Raw-String type
raw_str_var = "abcd"
# String-Object type
Expand Down Expand Up @@ -37,4 +41,3 @@ class_var = cl {prop $_}

# Object type
object_var = new class_var(1)

0 comments on commit 84b8499

Please sign in to comment.