Skip to content

Instantly share code, notes, and snippets.

@altbodhi
Created August 22, 2019 09:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save altbodhi/7042c081f49420ab264122ab60b93187 to your computer and use it in GitHub Desktop.
Save altbodhi/7042c081f49420ab264122ab60b93187 to your computer and use it in GitHub Desktop.
Nemerle implements write and writeln like as turbo pascal
#pragma indent
// io.n
using System.Console;
macro writeln (params a: array[expr])
mutable exps = [];
foreach(e in a)
exps = <[ Write($e); ]> :: exps;
exps = <[ WriteLine();]> :: exps;
exps = exps.Reverse();
<[ { .. $exps } ]>
//main.n compile with reference to io.n (compiled to dll)
writeln ("Name = ", "Alice", ", age = ", 23, ", student = ", true);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment