[Issue 8364] Allow exclamation mark in template definition

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Jul 9 13:36:27 PDT 2012


http://d.puremagic.com/issues/show_bug.cgi?id=8364


timon.gehr at gmx.ch changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |timon.gehr at gmx.ch


--- Comment #3 from timon.gehr at gmx.ch 2012-07-09 13:36:26 PDT ---
(In reply to comment #2)
> Of what value is that? The current situation is wonderfully unambiguous.
> 

True.

> This proposal would make the parser's life harder

Not really. Having this as the only template declaration syntax would even make 
the parser's life easier. (and if both were legal, parsing the kind that has 
the '!' would be slighly more efficient.)

> and would probably make it so that the grammar could no longer be context free 

This is not the case. The grammar would stay context free.

> (which would be very bad).
> And from the perspective of the programmer (not just the compiler), it's 
> _useful_ to be able to tell the difference between a template and a template
> instantiation at a glance.

The proposal does not put this ability in danger.

Anyway, I don't prefer either scheme and in my opinion it is fine to either 
leave the template declaration grammar as it is, or to change it to always
require '!'. The latter is not going to happen though.

(I remember that when I wrote my very first function template in D, I 
used the proposed syntax and was confused that it didn't work.)

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


More information about the Digitalmars-d-bugs mailing list