May 24, 2011 What are the reasons for this syntax?? | ||||
---|---|---|---|---|
| ||||
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 Re: What are the reasons for this syntax?? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Matthew Ong | Read about import types here: http://www.digitalmars.com/d/2.0/module.html#ImportDeclaration |
Copyright © 1999-2021 by the D Language Foundation