Suggestion re the manual

matheus matheus at gmail.com
Thu Jun 9 14:21:39 UTC 2022


On Wednesday, 8 June 2022 at 18:34:20 UTC, Paul wrote:
> ...
> Here is an example. Working with one of our programmers, he 
> could not understand the following (sorry for my newbie 
> simplistic example and understanding of D):
>
> if ( a_name.exists ) ...
>
> Where a_name is a string argument passed into the function. He 
> felt that it was checking if the string has a value and could 
> not understand why. It was a surprise to find that "exists" is 
> actually a uniquely named D function that actually means 
> "fileexists". Same with copy and remove.
>
> ...

I know this is an example and maybe there is more things going 
around, but still using this case, it isn't a matter of naming 
things better? - For example:

> if ( a_name.exists ) ...

Well... yes the "a_name" as is (Or another name chosen) may not 
help with the context, but:

if (myfile.exists) {}

I think that with "myfile" the context is clear now and the 
method/property "exists" is deductible from it and what will be 
expected.

Matheus.


More information about the Digitalmars-d mailing list