mirror of
https://github.com/BoardWare-Genius/jarvis-models.git
synced 2025-12-14 00:53:25 +00:00
feat: dotchain lang
This commit is contained in:
16
src/dotchain/main.dc
Normal file
16
src/dotchain/main.dc
Normal file
@ -0,0 +1,16 @@
|
||||
// 註解
|
||||
|
||||
// 變量宣告
|
||||
let hello = 123;
|
||||
|
||||
// 函數宣告
|
||||
let add = (left, right) => {
|
||||
// 返回值
|
||||
return left + right;
|
||||
}
|
||||
|
||||
// TODO 函數呼叫
|
||||
add(1,2);
|
||||
add(3, add(1,2));
|
||||
// 以 . 呼叫函數,將以 . 前的值作為第一個參數
|
||||
// hello.add(2) == add(hello, 2);
|
||||
Reference in New Issue
Block a user