www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Functions that look like methods

reply Charlie <Charlie_member pathlink.com> writes:
Where is this documented ?  Its very cool I think.  But Im a little concerned
with D being overcome with special cases and idiosynchrosies ( like the 'length'
qualification < cough ... > ).  At the least I think these need to be
documented.  In the spirit of Demios Rising, maybe its time for a D
Documentation project , cleaning up the existing docs.

Im am very glad that its been extended to all dynamic arrays ( maybe other types
? ) :).

Chuck D


import std.stream;

void p(char []  x)
{
stdout.writeLine(x);
}

void main () 
{
char [] n = "That theres a hen hizzy.";
n.p();
}
Aug 26 2004
parent pragma <pragma_member pathlink.com> writes:
In article <cgl7qo$ia0$1 digitaldaemon.com>, Charlie says...
Where is this documented ?  Its very cool I think.  But Im a little concerned
with D being overcome with special cases and idiosynchrosies ( like the 'length'
qualification < cough ... > ).  At the least I think these need to be
documented.  In the spirit of Demios Rising, maybe its time for a D
Documentation project , cleaning up the existing docs.

Im am very glad that its been extended to all dynamic arrays ( maybe other types
? ) :).
It's be brought up before at least once before. Sadly, this nifty feature only works for array types. And no, it's not in the documentation. I had posted a proposal ("typedef block") which would allow for arbitrary extension of scalar types (static operators, constructors and methods) to accomplish this very behavior, before I was informed of this feature. The D wiki is supposed to be a good repository for doc comments, but it seems to be lacking serious use at the moment (not to mention reciprocal linkage from the official D manual). Perhaps we're getting to the point where the NG needs a FAQ? -Pragma [[ EricAnderton at (FAQ?) yahoo.com ]]
Aug 26 2004