Talk:D (programming language): Difference between revisions

Content deleted Content added
Type naming policy: new section
Line 64:
 
The section about concurrent programming only contains source code. Should there not be some sort of explanation to ''why'' it is concurrent and what the code does (besides from the very thin information in the comments)? [[User:SBareSSomErMig|SBareSSomErMig]] ([[User talk:SBareSSomErMig|talk]]) 10:22, 6 March 2013 (UTC)
 
== Type naming policy ==
 
I don't think it's future proof name types way they are named currently.
 
http://dlang.org/type.html
<pre>
void - no type
bool false boolean value
byte 0 signed 8 bits
ubyte 0 unsigned 8 bits
short 0 signed 16 bits
ushort 0 unsigned 16 bits
int 0 signed 32 bits
uint 0 unsigned 32 bits
long 0L signed 64 bits
ulong 0L unsigned 64 bits
cent 0 signed 128 bits (reserved for future use)
ucent 0 unsigned 128 bits (reserved for future use)
float float.nan 32 bit floating point
double double.nan 64 bit floating point
real real.nan largest FP size implemented in hardware (Implementation Note: 80 bits for x86 CPUs or double size, whichever is larger)
ifloat float.nan*1.0i imaginary float
idouble double.nan*1.0i imaginary double
ireal real.nan*1.0i imaginary real
cfloat float.nan+float.nan*1.0i a complex number of two float values
cdouble double.nan+double.nan*1.0i complex double
creal real.nan+real.nan*1.0i complex real
char 0xFF unsigned 8 bit UTF-8
wchar 0xFFFF unsigned 16 bit UTF-16
dchar 0x0000FFFF unsigned 32 bit UTF-32
</pre>
 
This would be way better naming...
<pre>
void - no type
bool false boolean value
s8int 0 signed 8 bits
u8int 0 unsigned 8 bits
s16int 0 signed 16 bits
u16int 0 unsigned 16 bits
s32int 0 signed 32 bits
u32int 0 unsigned 32 bits
s64int 0L signed 64 bits
u64int 0L unsigned 64 bits
s128int 0 signed 128 bits (reserved for future use)
u128int 0 unsigned 128 bits (reserved for future use)
sLint 0 largest signed integer implemented in hardware
uLint 0 largest unsigned integer implemented in hardware
n32float float.nan 32 bit floating point
n64float double.nan 64 bit floating point
nLfloat real.nan largest FP size implemented in hardware (Implementation Note: 80 bits for x86 CPUs or double size, whichever is larger)
i32float float.nan*1.0i imaginary float
i64float double.nan*1.0i imaginary double
iLfloat real.nan*1.0i imaginary real
c32float float.nan+float.nan*1.0i a complex number of two float values
c64float double.nan+double.nan*1.0i complex double
cLfloat real.nan+real.nan*1.0i complex real
b8char 0xFF unsigned 8 bit UTF-8
b16char 0xFFFF unsigned 16 bit UTF-16
b32dchar 0x0000FFFF unsigned 32 bit UTF-32
</pre>
 
Also I added two more there, "largest (un)signed integer implemented in hardware". <br />
triedoutd [[Special:Contributions/188.238.70.207|188.238.70.207]] ([[User talk:188.238.70.207|talk]]) 15:40, 4 September 2013 (UTC)