Created
August 22, 2019 09:57
-
-
Save altbodhi/7042c081f49420ab264122ab60b93187 to your computer and use it in GitHub Desktop.
Nemerle implements write and writeln like as turbo pascal
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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