undar-lang/test/malloc.ul

27 lines
396 B
Fortran

/**
* Constants
*/
const str nl = "\n";
plex Terminal {
nat handle;
}
/**
* Main function
*/
function main() {
Terminal term = open("/dev/term/0", 0);
pln(term, "Enter a string: ");
pln(term, term.read(32));
return 0;
}
/**
* Print with a newline
*/
function pln(Terminal term, str message) {
write(term, message, message.length);
write(term, nl, nl.length);
}