Files
Fig/ExampleCodes/2-Function.fig
PuqiAR c93840af5f [VER] v0.3.6-alpha
[Feat] 增加控制台在线安装器 !
[Impl] 修改ExampleCodes的一些实现,使用最新库 std.io
2026-01-04 00:51:11 +08:00

16 lines
225 B
Plaintext

import std.io;
func greeting(name:String) -> String
{
return "Hello " + name + "!";
}
io.println(greeting("Fig"));
func adder(x)
{
return func (n) => x + n; // closure
}
const add2 = adder(2);
io.println(add2(3));