Thread overview | ||||||
---|---|---|---|---|---|---|
|
January 31, 2008 Nanu library on dsource | ||||
---|---|---|---|---|
| ||||
The nanu library source that I have been working on is now on dsource. |
January 31, 2008 Re: Nanu library on dsource | ||||
---|---|---|---|---|
| ||||
Posted in reply to Mark Mohr | Mark Mohr wrote:
> The nanu library source that I have been working on is now on dsource.
Uh.... you may want to tell people what it is....
|
February 01, 2008 Re: Nanu library on dsource | ||||
---|---|---|---|---|
| ||||
Posted in reply to J Duncan | OK.. It is a converting Mono to D. This will enable anyone who wrote C# code in .Net. To recompile in D. There will be some minor tweaking but the syntax for the most part will remain the same. There is still a lot do do and check out the dsource page. http://www.dsource.org/projects/nanu If interested in helping out let me know. here is an example... import system.console; import system.int32; import system.text.asciiencoding; import system.text.utf8encoding; int main(){ try{ // The endoding. //ASCIIEncoding e = new ASCIIEncoding(); UTF8Encoding e = new UTF8Encoding(); // A Unicode string with two characters outside the ASCII code range nchar[] unicodeString = "This Unicode string contains two characters with codes outside the ASCII code range, Pi (\u03a0) and Sigma (\u03a3)."; Console.WriteLine("Original string:"); Console.WriteLine(unicodeString); Console.WriteLine("Length = " ~ Int32(unicodeString.length).ToString()); Console.WriteLine(); ubyte[] encodedBytes = e.GetBytes(unicodeString); foreach(ubyte b; encodedBytes){ Console.Write("[" ~ Int32(cast(int)b).ToString() ~ "]"); } Console.WriteLine(); nchar[] decodeString = e.GetString(encodedBytes); Console.WriteLine(); Console.WriteLine("Decoded bytes:"); Console.WriteLine(decodeString); } catch(Exception e){ Console.WriteLine(e.ToString()); } return 0; } J Duncan Wrote: > Mark Mohr wrote: > > The nanu library source that I have been working on is now on dsource. > > Uh.... you may want to tell people what it is.... |
February 01, 2008 Re: Nanu library on dsource | ||||
---|---|---|---|---|
| ||||
Posted in reply to Mark Mohr | Mark Mohr wrote:
> OK..
>
> It is a converting Mono to D. This will enable anyone who wrote C# code in .Net. To recompile in D.
I think this is a brilliant idea!
L.
|
Copyright © 1999-2021 by the D Language Foundation