removal of cruft from D
Yigal Chripun
yigal100 at gmail.com
Fri Nov 20 23:40:13 PST 2009
On 21/11/2009 02:45, Andrei Alexandrescu wrote:
> Ellery Newcomer wrote:
>> Nick Sabalausky wrote:
>>> "Yigal Chripun" <yigal100 at gmail.com> wrote in message
>>> news:he6sqe$1dqu$1 at digitalmars.com...
>>>> Based on recent discussions on the NG a few features were
>>>> deprecated/removed from D, such as typedef and C style struct
>>>> initializers.
>>>>
>>>> IMO this cleanup and polish is important and all successful
>>>> languages do such cleanup for major releases (Python and Ruby come
>>>> to mind). I'm glad to see that D follows in those footsteps instead
>>>> of accumulating craft like C++ does.
>>>>
>>>>
>>>> As part of this trend of cleaning up D before the release of D2,
>>>> what other features/craft should be removed/deprecated?
>>>>
>>>> I suggest reverse_foreach and c style function pointers
>>>>
>>>> please add your candidates for removal.
>>>>
>>> s/reverse_foreach/foreach_reverse/ ;)
>>>
>>> 1. Floating point literals without digits on *both* sides!!! "1.",
>>> ".1" --> Useless hindrance to future language expansion!
>>>
>>> 2. Octal literals! I think it'd be great to have a new octal syntax,
>>> or even better, a general any-positive-inter-base syntax. But until
>>> that finally happens, I don't want "010 == 8" preserved. And I don't
>>> think the ability to have an octal literal is important enough that
>>> lacking it for a while is a problem. And if porting-from-C really has
>>> to be an issue, then just make 0[0-9_]+ an error for a transitionary
>>> period (or forever - it'd at least be better than maintaining "010 ==
>>> 8").
>>>
>>> 3. Also the comma operator, but that's already been recently discussed.
>>>
>>>
>>>
>>
>> <bikeshed>
>>
>> hex literal prefix: 0x, not 0h
>> =>
>> octal literal prefix: 0c, not 0o
>>
>> </bikeshed>
>
> This I'm on board with. 0o is too much like a practical joke.
>
> Andrei
in the short term I wouldn't mind if they would be typed as:
0baseEightXXX or what ever as long as the current syntax is removed.
in the long term, I'd like to see a more general syntax that allows to
write numbers in any base.
something like:
[base]n[number] - e.g. 16nA0FF, 2n0101, 18nGH129, etc.
also define syntax to write a list of digits:
1024n[1005, 452, 645, 16nFFF] // each digit can also be defined in
arbitrary base
More information about the Digitalmars-d
mailing list