Example within documentations of D seriously need some improvement.

David Nadlinger see at klickverbot.at
Fri May 27 14:46:57 PDT 2011


On 5/27/11 9:09 PM, Jacob Carlborg wrote:
> On 2011-05-27 16:18, Matthew Ong wrote:
>> On 5/27/2011 9:16 PM, dennis luehring wrote:
 >> >[…]
>> >that YOU can start imeditately by bringing in new/changed content -
>> would be great
>> It is too early for me to do that as I am just 3 week in D.
>
> Maybe that's what just we need. Someone with almost no experience in D
> can look at the documentation with fresh eyes and better see what needs
> to be change to make it easier for people new to D.

At least, it would be way more productive than uninformed language 
development suggestions… Don't get my wrong, Matthew, I'm sure nobody 
here minds beginner questions (after all, we have dm.D.learn solely for 
this purpose), but suggesting new constructs for a language one is not 
really familiar with is not likely to be very fruitful, even for 
experienced developers. To reply to your other two recent threads inline:

I don't quite see the point in introducing »runtime special tokens«, as 
you suggested, because the very essence of special tokens is that they 
are handled in a – well – special way by the lexer. What you are 
probably looking for instead are standard library functions (e.g. getpid()).

About your function hijacking question: Be assured that this isn't an 
issue in practice – aliasing in the base class implementations is only 
required to continue using other _overloads_ of an overridden method, 
not for any other methods of the class. The code examples you cited are 
generated, not written by hand, and e.g. in DWT's ByteArrayInputStream, 
not a single of the alias declarations is actually necessary – I suppose 
it was just the path of least resistance to always emit them to emulate 
the Java overriding/overloading rules.

Regards,
David


More information about the Digitalmars-d mailing list