下一代完美语言: D语言(300分)

L

lich

Unregistered / Unconfirmed
GUEST, unregistred user!
了解了它的特性之后,认识到 C/C++ 终于迎来了它的替代者 D语言。

http://search.csdn.net/search/null/3/all/uframer/

官方网站:
http://www.digitalmars.com/d/index.html
 
这个给人的感觉似乎是GCC的发展版吧,虽然有提到RAD和web开发,但感觉还是遍向非win平台的东东,关注
 
d有意思,有编译器吗?
 
不是很清楚
 
很早都有了,第一次看见呢,遗憾!!!
 
看起来好像还是C++嘛
 
郁闷,刚才一点官方网站死机了[:(]
 
C++ + JAVA
 
要学习一下,不过好象还没有这方面的中文书哟!
 
发现什么语言都差不多!
 
真那么厉害?
 
D语言与其他语言功能比较表:
http://www.digitalmars.com/d/comparison.html
 
有没有给点指导性的发言
 
This is an example D program illustrating some of the capabilities:

#!/usr/bin/dmd -run
/* sh style script syntax is supported */

/* Hello World in D
To compile:
dmd hello.d
or to optimize:
dmd -O -inline -release hello.d
*/

import std.stdio;

void main(char[][] args)
{
writefln("Hello World, Reloaded");

// auto type inference and built-in foreach
foreach (argc, argv
args)
{
// Object Oriented Programming
CmdLin cl = new CmdLin(argc, argv);
// Improved typesafe printf
writefln(cl.argnum, cl.suffix, &quot
arg: %s", cl.argv);
// Automatic or explicit memory management
delete cl;
}

// Nested structs and classes
struct specs
{
// all members automatically initialized
int count, allocated;
}

// Nested functions can refer to outer
// variables like args
specs argspecs()
{
specs* s = new specs;
// no need for '->'
s.count = args.length; // get length of array with .length
s.allocated = typeof(args).sizeof
// built-in native type properties
foreach (argv
args)
s.allocated += argv.length * typeof(argv[0]).sizeof;
return *s;
}

// built-in string and common string operations
writefln("argc = %d, &quot
~ "allocated = %d",
argspecs().count, argspecs().allocated);
}

class CmdLin
{
private int _argc;
private char[] _argv;

public:
this(int argc, char[] argv) // constructor
{
_argc = argc;
_argv = argv;
}

int argnum()
{
return _argc + 1;
}

char[] argv()
{
return _argv;
}

char[] suffix()
{
char[] suffix = "th";
switch (_argc)
{
case 0:
suffix = "st";
break;
case 1:
suffix = "nd";
break;
case 2:
suffix = "rd";
break;
default:
break;
}
return suffix;
}
}

乍一看像C#呢,为什么叫D....
foreach (argv
args)
s.allocated += argv.length * typeof(argv[0]).sizeof;
这个...Delphi在怎么变,也不会弄成这样的格式,
(argv
args)
typeof(argv[0]).sizeof
...
虽然{ }比 Begin end 方便,但习惯还是比较可怕的,感觉不用Begin..end筐起来就不爽呢!
唉,什么时候也来个D#吧。
 
哈哈。好。。。
 
D 和delphi7有关系吗?
 

Similar threads

D
回复
0
查看
1K
DelphiTeacher的专栏
D
S
回复
0
查看
3K
SUNSTONE的Delphi笔记
S
S
回复
0
查看
2K
SUNSTONE的Delphi笔记
S
I
回复
0
查看
638
import
I
D
回复
0
查看
1K
DelphiTeacher的专栏
D
顶部