www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 9029] New: Built-in types treated specially for alias parameters

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=9029

           Summary: Built-in types treated specially for alias parameters
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: timon.gehr gmx.ch



DMD 2.060:

template Foo(alias a){ }
struct S{}

alias S X;     // ok
alias int Y;   // ok
mixin Foo!S;   // ok
mixin Foo!int; // not ok

The code should compile.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Nov 15 2012
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=9029


yebblies <yebblies gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |galaxylang gmail.com



*** Issue 8491 has been marked as a duplicate of this issue. ***

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Nov 15 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=9029


Manu <turkeyman gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |turkeyman gmail.com



I'm suffering from this problem too.
Fix would be nice! :)

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Nov 26 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=9029




This is one of those perennial issues, that everybody discovers.

Previous enhancement requests identical to this one include bug 1100, bug 3116,
bug 4639. I remember requesting it once, as well.

It goes back even further. Here's a discussion from July 2004 (template alias
parameters were first implemented in Jan 2004, so this is the dawn of time):

http://digitalmars.com/d/archives/digitalmars/D/6063.html

Interestingly one thing which _was_ changed in D2 is that template alias
parameters can now include expressions. Late in the history of D1, local
variables were also added as template alias parameters. But still not basic
types.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Nov 29 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=9029





 This is one of those perennial issues, that everybody discovers.
 
 Previous enhancement requests identical to this one include bug 1100, bug 3116,
 bug 4639. I remember requesting it once, as well.
 
 It goes back even further. Here's a discussion from July 2004 (template alias
 parameters were first implemented in Jan 2004, so this is the dawn of time):
 
 http://digitalmars.com/d/archives/digitalmars/D/6063.html
 
 Interestingly one thing which _was_ changed in D2 is that template alias
 parameters can now include expressions. Late in the history of D1, local
 variables were also added as template alias parameters. But still not basic
 types.
There was a proposal recently on the NG suggesting builtin types should have entries in the symbol table. Sounded fairly reasonable. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Nov 29 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=9029


Jacob Carlborg <doob me.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |doob me.com





 There was a proposal recently on the NG suggesting builtin types should have
 entries in the symbol table. Sounded fairly reasonable.
Yeah, this is what the dragon book suggests as well. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Nov 29 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=9029






 
 There was a proposal recently on the NG suggesting builtin types should have
 entries in the symbol table. Sounded fairly reasonable.
Yeah, this is what the dragon book suggests as well.
Huh? There is no technical difficulty whatsoever, AFAIK it was _never_ thought to be difficult to implement. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Nov 29 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=9029







 
 There was a proposal recently on the NG suggesting builtin types should have
 entries in the symbol table. Sounded fairly reasonable.
Yeah, this is what the dragon book suggests as well.
Huh? There is no technical difficulty whatsoever, AFAIK it was _never_ thought to be difficult to implement.
When did the difficulty come in to question? Something to do with this 'dragon book' that I don't understand? -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Nov 29 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=9029






 When did the difficulty come in to question? Something to do with this 'dragon
 book' that I don't understand?
I don't know. There's a book called "Compilers: Principles, Techniques, and Tools" which is also referred to as "the dragon book". It's basically the bible for compiler construction. If I recall correctly, Walter has said that DMD doesn't contain any fancy code, just the standard algorithms present in the dragon book. http://en.wikipedia.org/wiki/Compilers:_Principles,_Techniques,_and_Tools -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Nov 29 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=9029




I ran into this bug again today twice. In one case the alias was to receive
'void' which it didn't like either.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Nov 29 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=9029








 
 There was a proposal recently on the NG suggesting builtin types should have
 entries in the symbol table. Sounded fairly reasonable.
Yeah, this is what the dragon book suggests as well.
Huh? There is no technical difficulty whatsoever, AFAIK it was _never_ thought to be difficult to implement.
When did the difficulty come in to question? Something to do with this 'dragon book' that I don't understand?
The comments you guys have made indicated to me that you don't realize that the reason this isn't part of the language is simply because Walter has seen it as undesirable. (Not that it would make the compiler ugly or complicated or anything like that). -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Nov 30 2012
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=9029





 The comments you guys have made indicated to me that you don't realize that the
 reason this isn't part of the language is simply because Walter has seen it as
 undesirable. (Not that it would make the compiler ugly or complicated or
 anything like that).
Ah okay, yeah I have no idea about the implementation, just commenting on a conversation I saw which sounded sensible :) It'd be nice to have some sort of fix regardless. Any changes to make D more orthogonal in general are surely good. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Nov 30 2012