[Issue 785] Make 'cent' and 'ucent' syntactically valid pending implementation

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Oct 29 04:36:52 PDT 2007


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


smjg at iname.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |enhancement
             Status|RESOLVED                    |REOPENED
         Resolution|INVALID                     |
            Summary|static if(is(cent)): "basic |Make 'cent' and 'ucent'
                   |type expected, not cent"    |syntactically valid pending
                   |                            |implementation




------- Comment #4 from smjg at iname.com  2007-10-29 06:36 -------
That doesn't follow.  Because the token is syntactically illegal at the moment,
and because versioned out code still has to be syntactically valid, that won't
work.  Though you could use a mixin to get around the difficulty, this is a
rather dirty workaround.  It would be silly if library code that wants to use
cent if it's implemented has to either be peppered with such mixins or define
its own alias and check if that exists instead.

Besides, how is one supposed to know in which (DM)D version cent/ucent will be
implemented?  Similarly, with the number of different version identifiers
people are likely to make up, they can't all coincide with the one that you
decide to use.  And even if any time now you decide on a version identifier
(such as D_Cent) that is going to denote support for this feature, it is a much
neater solution if is(cent) or is(ucent) is defined to do the same, and
attempts to use cent/ucent rejected at the semantic, not syntactic, level.

Meanwhile, I'm changing this to an enhancement request.

And it should be straightforward to implement.  Effectively, cent and ucent
would parse as BasicType, but the semantic analysis would treat them as the
_identifiers_ 'cent' and 'ucent', which are always undefined because they
cannot be used in declarations, where the _syntax_ requires an Identifier.


-- 



More information about the Digitalmars-d-bugs mailing list