Thread overview
[Issue 3011] New: alias, typedef should have assignment syntax
May 20, 2009
dhasenan@gmail.com
[Issue 3011] alias should have assignment syntax
Aug 25, 2012
Nick Treleaven
Aug 25, 2012
Nick Treleaven
Oct 16, 2012
Kenji Hara
Nov 15, 2012
yebblies
Nov 15, 2012
Kenji Hara
May 20, 2009
http://d.puremagic.com/issues/show_bug.cgi?id=3011

           Summary: alias, typedef should have assignment syntax
           Product: D
           Version: 2.027
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla@digitalmars.com
        ReportedBy: dhasenan@gmail.com


alias and typedef should have assignment syntax to correspond with assignments and renamed imports.

Whenever I see or want to write "alias a b", it takes some thinking to remember what order the arguments should be in. If aliases worked as "alias newsymbol = existingsymbol", it would be trivial to determine which symbol is new and which it refers to.

Typedef has the same ugly syntax, so the same change should apply to it.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
August 25, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=3011


Nick Treleaven <ntrel-public@yahoo.co.uk> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Platform|x86                         |All
            Version|2.027                       |D2
         OS/Version|Linux                       |All


--- Comment #1 from Nick Treleaven <ntrel-public@yahoo.co.uk> 2012-08-25 08:50:26 PDT ---
I removed typedef from the title as it is now deprecated in D2.

Besides assignment syntax having consistency with renamed imports and variable declarations, the current alias syntax is awkward to read and confusing for newcomers.

Alias assignment syntax should also be used for alias this:

struct Foo {
    alias this = foo;
    ...
}

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
August 25, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=3011



--- Comment #2 from Nick Treleaven <ntrel-public@yahoo.co.uk> 2012-08-25 09:02:28 PDT ---
Also alias is often used to alias symbols, not just types. So using C typedef syntax is weird, especially now typedef is deprecated in D.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
October 16, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=3011



--- Comment #3 from Kenji Hara <k.hara.pg@gmail.com> 2012-10-16 10:01:19 PDT ---
https://github.com/D-Programming-Language/dmd/pull/1187

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
October 22, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=3011



--- Comment #4 from github-bugzilla@puremagic.com 2012-10-22 09:50:26 PDT ---
Commits pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/796aba2877e2db672806c2f2562e0c5a2f30ab17 fix Issue 3011 - alias should have assignment syntax

https://github.com/D-Programming-Language/dmd/commit/6c01188d71433508bc4c0af6b821a97e8df2e986 Merge pull request #1187 from 9rnsr/fix3011

[enh] Issue 3011 - alias should have assignment syntax

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
October 22, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=3011



--- Comment #5 from github-bugzilla@puremagic.com 2012-10-22 09:50:55 PDT ---
Commits pushed to master at https://github.com/D-Programming-Language/d-programming-language.org

https://github.com/D-Programming-Language/d-programming-language.org/commit/2248b317d50d0ab109e3e816a0c16b05b4631bbd fix Issue 3011 - alias should have assignment syntax

https://github.com/D-Programming-Language/d-programming-language.org/commit/5668f12dbb296b485df58fbcab2fc4188c30d3b9 Merge pull request #177 from 9rnsr/fix3011

Issue 3011 - alias should have assignment syntax

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
November 15, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=3011


yebblies <yebblies@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |yebblies@gmail.com


--- Comment #6 from yebblies <yebblies@gmail.com> 2012-11-15 22:21:16 EST ---
Is this finished now?

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
November 15, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=3011


Kenji Hara <k.hara.pg@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED


--- Comment #7 from Kenji Hara <k.hara.pg@gmail.com> 2012-11-15 05:41:48 PST ---
(In reply to comment #6)
> Is this finished now?

Yes. I close this now.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------