www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Insufficient Documentation?

reply Manfred Nowak <svv1999 hotmail.com> writes:
http://dlang.org/phobos/std_stdio.html:

void write(S...)(S args);
    Writes its arguments in text format to the file.

1)
Feeding "arguments in text format" into the search-function for the whole 
site does not give a hint to `toString'.

What am I missing?

2)
"to the file" ... which file?

-manfred 
Jul 28 2013
next sibling parent "Tobias Pankrath" <tobias pankrath.net> writes:
On Monday, 29 July 2013 at 06:17:10 UTC, Manfred Nowak wrote:
 http://dlang.org/phobos/std_stdio.html:

 void write(S...)(S args);
     Writes its arguments in text format to the file.

 1)
 Feeding "arguments in text format" into the search-function for 
 the whole
 site does not give a hint to `toString'.

 What am I missing?

 2)
 "to the file" ... which file?

 -manfred
I, too, think that the Documentation is rather insufficient. But 2) is only a matter of formatting. Is's the file you call 'write' on, because 'write' belongs to the struct File as indicated by indentation.
Jul 28 2013
prev sibling parent reply "Jesse Phillips" <Jesse.K.Phillips+D gmail.com> writes:
On Monday, 29 July 2013 at 06:17:10 UTC, Manfred Nowak wrote:
 http://dlang.org/phobos/std_stdio.html:

 void write(S...)(S args);
     Writes its arguments in text format to the file.

 1)
 Feeding "arguments in text format" into the search-function for 
 the whole site does not give a hint to `toString'.

 What am I missing?
I'm not sure what results you are interest in when searching for "arguments in text format." If I search for "convert object to string/text" then I get some references to toString or std.conv.
Jul 30 2013
parent reply Manfred Nowak <svv1999 hotmail.com> writes:
Jesse Phillips wrote:

     Writes its arguments in text format to the file.
I'm not sure what results you are interest in when searching for "arguments in text format."
I expected a closer explanation for the broad explanation "arguments in text format". If the explanation for `write' would be Converts all arguments to strings and catenates those strings to `File' in lexical order of appearance of the arguments. then I still would not search for `object', but for conversion.
 If I search for "convert object to 
 string/text" then I get some references to toString or std.conv.
How did you know about "convert object"? -manfred
Jul 30 2013
parent reply "Jesse Phillips" <jessek.phillips+D gmail.com> writes:
On Wednesday, 31 July 2013 at 04:05:48 UTC, Manfred Nowak wrote:
 Jesse Phillips wrote:
 How did you know about "convert object"?

 -manfred
If I had an object (argument) then I'd want to know how it would become (convert to) "text." Similarly if I had an int I'd want to know how that converts to text. If I didn't know what an argument was: https://www.google.com/search?q=what+is+a+function+argument You mentioned that nothing came up about toString, if information on toString was applicable to you then it is likely because your argument being passed was an object (of a class or a struct). Thus the question becomes how does my object convert to text for this write function. To further that, strings are the type of text so if I am familiar with any language I can attempt to be more specific. I just don't understand why you think "arguments in text format" should direct you toward toString. At most I could see std.string.format, but I doubt that would answer the question. I certainly could see reason for the documentation of write to mention toString, but based on the information provided it is hard to say what about "Writes its arguments in text format to the file" is unclear. I feel, " Converts all arguments to strings and catenates those strings to `File' in lexical order of appearance of the arguments." Needlessly complicates communicating the operation performed. But maybe it is of value to most people.
Jul 30 2013
parent reply Manfred Nowak <svv1999 hotmail.com> writes:
Jesse Phillips wrote:
 argument being passed was an object
I see now, that you came to "convert object" because you know about the olution of the task given. Sooily the solution is unknown before hand! Of course my `class' printed out "something" that I didn't want to see. But I still do not see the path in the docs from `write'ing "something" for a `class' to `toString' printing `object's. -manfred
Jul 31 2013
parent "Jesse Phillips" <Jesse.K.Phillips+D gmail.com> writes:
On Wednesday, 31 July 2013 at 08:11:06 UTC, Manfred Nowak wrote:
 I see now, that you came to "convert object" because you know 
 about the [s]olution of the task given. [surely] the solution 
 is unknown before hand!
No I was trying to figure out what the problem was, to figure that out I needed to pull from the solution you found for your problem. Surely you already knew what the problem was before looking for a solution. Again, I don't see any issue with mentioning toString in the docs, I myself couldn't figure out what information you wanted when looking for "arguments in text format" so I'm not surprised a computer couldn't.
Jul 31 2013