Last active
December 20, 2017 11:05
-
-
Save alphaKAI/510ec5ac9d9bc77cd05c to your computer and use it in GitHub Desktop.
Idea of my programming language : lambdang
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(main {string[] args} : bool; | |
string (str "HelloWorld"); | |
bool (res { | |
(io (writeln (str)))(); | |
return true; | |
}); | |
return res; | |
) | |
//Function | |
(functionName {type arg1, type arg2} : int/*returnType*/; | |
//type (name value); | |
string (str "abc"); | |
int (num 1); | |
int (added (+ (1, 2))); | |
int (intClosure [int tmp1, int tmp2]{ | |
return (+ (tmp1, tmp2)); | |
});//closure | |
(if ((intClosure(1, 1) > 1)); | |
=>//if : expr is true | |
//do | |
(io (writeln( "over 1!")))(); | |
<=//End of block | |
=>((intClosure() < 1))//Else if | |
(io (writeln( "under 1")())(); | |
<=//End of block | |
->//Else | |
//do | |
(io (writeln( "false!")))(); | |
<-//End of block | |
); | |
return 0; | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
returnを明示的に書かなくていいようにしよう(提案)