www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - What are the reasons for this syntax??

reply Matthew Ong <ongbp yahoo.com> writes:
Hi ALL,

Refering to these 2 URL:
http://hg.dsource.org/projects/dwt2/file/d00e8db0a568/base/src/java/io/FileOutputStream.d

// why the public here?
6 public import java.io.File;
7 public import java.io.OutputStream;
9 import java.lang.all; // I can understand this here.

13} else { // Phobos
    // Why the import needed static?
14 static import std.file;
15 static import std.path;
16}

// What is the purpose of using alias here?
20 alias java.io.OutputStream.OutputStream.write write;
21 alias java.io.OutputStream.OutputStream.close close;


http://hg.dsource.org/projects/dwt2/file/d00e8db0a568/base/src/java/io/ByteArrayInputStream.d

8 alias java.io.InputStream.InputStream.read read;
9 alias java.io.InputStream.InputStream.skip skip;
10 alias java.io.InputStream.InputStream.available available;
11 alias java.io.InputStream.InputStream.close close;
12 alias java.io.InputStream.InputStream.mark mark;
13 alias java.io.InputStream.InputStream.reset reset;
14 alias java.io.InputStream.InputStream.markSupported markSupported;

Thanks very much.

-- 
Matthew Ong
email: ongbp yahoo.com
May 24 2011
parent Trass3r <un known.com> writes:
Read about import types here:  
http://www.digitalmars.com/d/2.0/module.html#ImportDeclaration
May 24 2011