This repository was archived by the owner on Aug 9, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Syntax ideas
Mario Montoya edited this page Aug 8, 2020
·
6 revisions
- All integers are 64-bits.
Syntax:
1
- All floating-point data are 64-bits.
Syntax:
1.1f
- For money data type use decimals.
Syntax:
1.1d
- True value:
Syntax:
true
- False value:
Syntax:
falsetrue false not and or < <= <>
- All strings are UTF-8 encoding guaranteed. You could delimiter strings with double-quotes or an apostrophe.
Using double-quotes if you want to escape apostrophes.
Syntax:
"hello 'wonderful' world!"
Using apostrophes if you want to escape double-quotes.
Syntax:
'hello "wonderful" world!'
- You could use triple quotes for multiline strings.
Syntax:
"""hello from
multiline world!"""
"hello {1 + 2}"
dt"2001-01-10T23_02_10"
d"2001-01-10"
t"23_02_10"
nums = Vec[it:i32;1, 2, 3]
nums = 1
nums = [1]
Fac = Map[| key id:i32, code, cust, salesman|] //header/type
Map = [|
id:i32, name:Str;
1, "hello"; //row0
2, "world" //row1
|]
Tree = [<
id:Int = 1, 2; //col0
name:Str = "hello", "world" //col1
>]
city = Map[| id:i32, pk code, cust, salesman|]
city = Tree[| id:i32, code, pk name, salesman|]
named:
city = | id=1, name="miami" |
anon:
city = | 1, "miami" |
enum Color do
Blue: Int
Red: (String, String)
Green
rel City do
pk id:Int
name:Str
Color types
COLOR const
color vars
color_blue
[1, 2, 3] # 0
[1, 3, 4] # [0, 2] = [1, 4]
city #name #id
city ?select #name
if is a:Vec[Int] do
let a = cast a:Vec[Int]
[1, 3, 4] .map .filter .print
save(city)
city.save()