New syntax within DWT / 2.

Matthew Ong ongbp at yahoo.com
Tue May 24 00:39:54 PDT 2011


Hi D Experts,

The reasons that I am asking these questions is to learn how to port a 
Java Library into D. The clear

I am new to D, Just less than 2 weeks. But experience in Java.

 From
http://www.dsource.org/projects/dwt/wiki/Contributors
http://www.dsource.org/projects/dwt

I have some questions about

FileOutputStream.d
-------------------------------------
module java.io.FileOutputStream;

// Why Public
public import java.io.File;
public import java.io.OutputStream;

// Why No public
import java.lang.all;

version(Tango){
     import TangoFile = tango.io.device.File;
} else { // Phobos
     static import std.file;  // why static import?? Does it impact memory?
     static import std.path;
}

public class FileOutputStream : java.io.OutputStream.OutputStream {

     // How is this being used within the context of this class? What if 
there is another overloaded write signature?
     alias java.io.OutputStream.OutputStream.write write;
     alias java.io.OutputStream.OutputStream.close close;
...
      public override void write( int b ){ // is override a must keyword?
        ...
      }

}

ByteArrayInputStream.d there is also a bunch of alias defined but not used.


Thanks very much.
-- 
Matthew Ong
email: ongbp at yahoo.com



More information about the Digitalmars-d-learn mailing list