Welcome to Nanu
Nanu Standalone Library for the D Language.
About Nanu
If you are like me then you where a big Mork and Mindy fan. Well thats how I came up with nanu or as Mork would said nanu nanu.
Anyway what is this library about. Well it is a port of the Mono C# code directly to D. This takes a little tweaking but the languages have some similarity. As for some of the back end code in Mono that is written in C again this comes over to nicely as well.
My goal for this library is for anyone to port there code over from C# .Net to D using nanu.
Project Information
| Name | Nanu |
| Category | Libraries-System |
| Status | 3 - Alpha |
| Short Description | Port of Mono to the D Language |
| Long Description | |
| Forum | /forums/viewforum.php?f=182 |
| Home Page | http://webpages.charter.net/mohr989/ |
Example
C# Code
using System;
using System.IO;
class Test
{
public static void Main()
{
// Create an instance of StreamWriter to write text to a file.
// The using statement also closes the StreamWriter.
using (StreamWriter sw = new StreamWriter("TestFile.txt"))
{
// Add some text to the file.
sw.Write("This is the ");
sw.WriteLine("header for the file.");
sw.WriteLine("-------------------");
// Arbitrary objects can also be written to the file.
sw.Write("The date is: ");
sw.WriteLine(DateTime.Now);
}
}
}
Code redone using Nanu
import system.datetime;
import system.io.streamwriter;
int main(){
// Create an instance of StreamWriter to write text to a file.
// The using statement also closes the StreamWriter.
StreamWriter sw = new StreamWriter(new String("TestFile.txt"));
// Add some text to the file.
sw.Write("This is the ");
sw.WriteLine("header for the file.");
sw.WriteLine("-------------------");
// Arbitrary objects can also be written to the file.
sw.Write("The date is: ");
sw.WriteLine(DateTime.Now.ToString());
return 0;
}
