// ALNOOR Documentation
In ALNOOR, a key feature is the ability to store functions as variables.
Config:
STD.FUNC.LAMBDA
STD.IO.INT
Main.lsmx:
fn main() {
Blank func = () l> {
String str = "";
int number = in_int (
"Please enter a number: "
);
for (int i = 1; i <= number; i++)
str = (i != number) ?
str.concat(i + "\n") :
str.concat("" + i);
ret str;
};
println! ("\n" +
func.call().toString()
);
}
This program may look complicated, but try it and see;
it is much simpler than the same implementation in Java.
STD.FUNC.LAMBDA
STD.IO.INT
fn main() {
Blank func = () l> {
String str = "";
int number = in_int (
"Please enter a number: "
);
for (int i = 1; i <= number; i++)
str = (i != number) ?
str.concat(i + "\n") :
str.concat("" + i);
ret str;
};
println! ("\n" +
func.call().toString()
);
}