Skip to content

Instantly share code, notes, and snippets.

@alphaKAI
Last active December 20, 2017 11:05
Show Gist options
  • Save alphaKAI/510ec5ac9d9bc77cd05c to your computer and use it in GitHub Desktop.
Save alphaKAI/510ec5ac9d9bc77cd05c to your computer and use it in GitHub Desktop.
Idea of my programming language : lambdang
(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;
)
@rigibun
Copy link

rigibun commented May 22, 2014

returnを明示的に書かなくていいようにしよう(提案)

@alphaKAI
Copy link
Author

というと、最後に書いた値が戻り値になる的な?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment