Skip to content

Mark complex numbers as deprecated + remove from spec #2100

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion deprecate.dd
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ $(SPEC_S Deprecated Features,
$(TROW $(DEPLINK Using the result of a comma expression), 2.072, 2.072,  ,  )
$(TROW $(DEPLINK delete), future,  ,  ,  )
$(TROW $(DEPLINK scope for allocating classes on the stack), future,  ,  ,  )
$(TROW $(DEPLINK Imaginary and complex types), future,  ,  ,  )
$(TROW $(DEPLINK Imaginary and complex types), 2.079, 2.079,  ,  )
$(TROW $(DEPLINK Implicit catch statement), 2.072, 2.072, future, future )
$(TROW $(DEPLINK .sort and .reverse properties for arrays), ?, 2.072,  , 2.075)
$(TROW $(DEPLINK C-style array pointers), ?, 2.072;,  ,  )
Expand Down
36 changes: 3 additions & 33 deletions spec/abi.dd
Original file line number Diff line number Diff line change
Expand Up @@ -457,12 +457,6 @@ $(H3 $(LNAME2 type_mangling, Type Mangling))
$(GLINK TypeFloat)
$(GLINK TypeDouble)
$(GLINK TypeReal)
$(GLINK TypeIfloat)
$(GLINK TypeIdouble)
$(GLINK TypeIreal)
$(GLINK TypeCfloat)
$(GLINK TypeCdouble)
$(GLINK TypeCreal)
$(GLINK TypeBool)
$(GLINK TypeChar)
$(GLINK TypeWchar)
Expand Down Expand Up @@ -646,24 +640,6 @@ $(H3 $(LNAME2 type_mangling, Type Mangling))
$(GNAME TypeReal):
$(B e)

$(GNAME TypeIfloat):
$(B o)

$(GNAME TypeIdouble):
$(B p)

$(GNAME TypeIreal):
$(B j)

$(GNAME TypeCfloat):
$(B q)

$(GNAME TypeCdouble):
$(B r)

$(GNAME TypeCreal):
$(B c)

$(GNAME TypeBool):
$(B b)

Expand Down Expand Up @@ -724,11 +700,7 @@ $(H3 $(LNAME2 return_value, Return Value))
are returned in EDX,EAX, where EDX gets the most significant
half.)

$(LI float, double, real, ifloat, idouble, ireal are returned
in ST0.)

$(LI cfloat, cdouble, creal are returned in ST1,ST0 where ST1
is the real part and ST0 is the imaginary part.)
$(LI float, double, real, are returned in ST0.)

$(LI Dynamic arrays are returned with the pointer in EDX
and the length in EAX.)
Expand Down Expand Up @@ -792,10 +764,8 @@ foo(a1, a2, ..., an);
They are pushed most significant first.
$(B out) and $(B ref) are passed as pointers.
Static arrays are passed as pointers to their first element.
On Windows, a real is pushed as a 10 byte quantity,
a creal is pushed as a 20 byte quantity.
On Linux, a real is pushed as a 12 byte quantity,
a creal is pushed as two 12 byte quantities.
On Windows, a real is pushed as a 10 byte quantity.
On Linux, a real is pushed as a 12 byte quantity.
The extra two bytes of pad occupy the $(SINGLEQUOTE most significant) position.
)

Expand Down
6 changes: 0 additions & 6 deletions spec/declaration.dd
Original file line number Diff line number Diff line change
Expand Up @@ -121,12 +121,6 @@ $(MULTICOLS 5,
$(D float)
$(D double)
$(D real)
$(D ifloat)
$(D idouble)
$(D ireal)
$(D cfloat)
$(D cdouble)
$(D creal)
$(D void))

$(GNAME BasicType2):
Expand Down
2 changes: 1 addition & 1 deletion spec/expression.dd
Original file line number Diff line number Diff line change
Expand Up @@ -1577,7 +1577,7 @@ $(H3 $(LNAME2 uniform_construction_syntax, Uniform construction syntax for built
---
auto a = ushort(); // same as: ushort.init
auto b = wchar(); // same as: wchar.init
auto c = creal(); // same as: creal.init
auto c = int(); // same as: int.init
---


Expand Down
6 changes: 0 additions & 6 deletions spec/grammar.dd
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,6 @@ $(GNAME BasicTypeX):
$(D float)
$(D double)
$(D real)
$(D ifloat)
$(D idouble)
$(D ireal)
$(D cfloat)
$(D cdouble)
$(D creal)
$(D void)

$(GNAME BasicType2):
Expand Down
2 changes: 0 additions & 2 deletions spec/interfaceToC.dd
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,6 @@ $(H2 $(LNAME2 data_type_compat, Data Type Compatibility))



$(TROW2 cdouble, double _Complex)
$(TROW2 creal, long double _Complex)
$(TROW2 struct, struct)
$(TROW2 union, union)
$(TROW2 enum, enum)
Expand Down
8 changes: 4 additions & 4 deletions spec/latex.ddoc
Original file line number Diff line number Diff line change
Expand Up @@ -412,13 +412,13 @@ $(LATEX_NO_DATE)
\lstdefinelanguage{D}[ANSI]{C++}{basicstyle={\ttfamily}, basewidth={0.5em,0.5em}, breakatwhitespace=true, columns=fullflexible, commentstyle=\color{OliveGreen}\textsl, escapeinside={/*[}{]*/}, fontadjust=true, keepspaces=true, keywordstyle=\color{NavyBlue}, linewidth=\textwidth, literate={\\\$}{\$}1 {\\par}{}0, morecomment=[n]{/+}{+/}, morekeywords={
@disable, @property,
@safe, @system, @trusted, abstract, alias, align, asm, assert,
auto, body, bool, break, byte, case, cast, catch, cdouble,
cent, cfloat, char, class, const, continue, creal, dchar,
auto, body, bool, break, byte, case, cast, catch,
cent, char, class, const, continue, dchar,
debug, default, delegate, delete, deprecated, do, double,
else, enum, export, extern, false, final, finally, float, for,
foreach, foreach_reverse, function, goto, idouble, if, ifloat,
foreach, foreach_reverse, function, goto, if,
immutable, import, in, inout, int, interface, invariant,
ireal, is, lazy, long, mixin, module, new, nothrow, null, out,
is, lazy, long, mixin, module, new, nothrow, null, out,
override, package, pragma, private, protected, public, real,
ref, return, scope, shared, short, static, struct, super,
switch, synchronized, template, this, throw, true, try,
Expand Down
20 changes: 0 additions & 20 deletions spec/lex.dd
Original file line number Diff line number Diff line change
Expand Up @@ -887,9 +887,6 @@ $(GNAME LeadingDecimal):
The $(B f) or $(B F) suffix means it is a
float, and $(B L) means it is a real.
)

$(P If a floating literal is followed by $(B i), then it is an
$(I ireal) (imaginary) type.
)

$(P Examples:)
Expand All @@ -898,9 +895,6 @@ $(GNAME LeadingDecimal):
0x1.FFFFFFFFFFFFFp1023 // double.max
0x1p-52 // double.epsilon
1.175494351e-38F // float.min
6.3i // idouble 6.3
6.3fi // ifloat 6.3
6.3Li // ireal 6.3
---------

$(P It is an error if the literal exceeds the range of the type.
Expand All @@ -914,14 +908,6 @@ $(GNAME LeadingDecimal):
1f; // OK
1.f; // forbidden
1.; // OK, double
---------

$(P Complex literals are not tokens, but are assembled from
real and imaginary expressions during semantic analysis:
)

---------
4.5 + 6.2i // complex number (phased out)
---------

$(H2 $(LNAME2 keywords, Keywords))
Expand All @@ -948,14 +934,11 @@ $(MULTICOLS 4,
$(LINK2 statement.html#SwitchStatement, $(D case))
$(LINK2 expression.html#CastExpression, $(D cast))
$(LINK2 statement.html#TryStatement, $(D catch))
$(LINK2 type.html, $(D cdouble))
$(LINK2 type.html, $(D cent))
$(LINK2 type.html, $(D cfloat))
$(LINK2 type.html, $(D char))
$(LINK2 class.html, $(D class))
$(LINK2 attribute.html#const, $(D const))
$(LINK2 statement.html#ContinueStatement, $(D continue))
$(LINK2 type.html, $(D creal))

$(LINK2 type.html, $(D dchar))
$(LINK2 version.html#debug, $(D debug))
Expand All @@ -982,17 +965,14 @@ $(MULTICOLS 4,

$(LINK2 statement.html#GotoStatement, $(D goto))

$(LINK2 type.html, $(D idouble))
$(LINK2 statement.html#IfStatement, $(D if))
$(LINK2 type.html, $(D ifloat))
$(LINK2 attribute.html#immutable, $(D immutable))
$(LINK2 expression.html#ImportExpression, $(D import))
$(LINK2 expression.html#InExpression, $(D in))
$(LINK2 function.html#inout-functions, $(D inout))
$(LINK2 type.html, $(D int))
$(LINK2 interface.html, $(D interface))
$(LINK2 contracts.html, $(D invariant))
$(LINK2 type.html, $(D ireal))
$(LINK2 expression.html#IsExpression, $(D is))

$(LINK2 function.html#overload-sets, $(D lazy))
Expand Down
6 changes: 0 additions & 6 deletions spec/type.dd
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,6 @@ $(H2 $(LEGACY_LNAME2 Basic Data Types, basic-data-types, Basic Data Types))
$(TROW $(D double), $(D double.nan), 64 bit floating point)
$(TROW $(D real), $(D real.nan), largest FP size implemented in
hardware$(FOOTNOTE Implementation Note: 80 bits for x86 CPUs or $(D double) size$(COMMA) whichever is larger))
$(TROW $(D ifloat), $(D float.nan*1.0i), imaginary float)
$(TROW $(D idouble), $(D double.nan*1.0i), imaginary double)
$(TROW $(D ireal), $(D real.nan*1.0i), imaginary real)
$(TROW $(D cfloat), $(D float.nan+float.nan*1.0i), a complex number of two float values)
$(TROW $(D cdouble), $(D double.nan+double.nan*1.0i), complex double)
$(TROW $(D creal), $(D real.nan+real.nan*1.0i), complex real)
$(TROW $(D char), $(D 0xFF), unsigned 8 bit (UTF-8 code unit))
$(TROW $(D wchar), $(D 0xFFFF), unsigned 16 bit (UTF-16 code unit))
$(TROW $(D dchar), $(D 0x0000FFFF), unsigned 32 bit (UTF-32 code unit))
Expand Down