Boost C++ Libraries: Ticket #6596: Docs bug in boost_1_49_0_beta1/doc/html/boost/algorithm/find_head.html https://svn.boost.org/trac10/ticket/6596 <p> There is a typo in the description: </p> <blockquote> <p> ... whole input <em>if</em> considered to be the head. </p> </blockquote> <p> The word <em>if</em> should be <em>is</em>. </p> <p> In fact the whole description could be made clearer. I suggest the following: </p> <p> <em>Get the first 'N' elements of the range 'input'. If 'input' is less than 'N' elements long, return the whole range.</em> </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/6596 Trac 1.4.3 anonymous Thu, 23 Feb 2012 08:26:13 GMT owner, component changed https://svn.boost.org/trac10/ticket/6596#comment:1 https://svn.boost.org/trac10/ticket/6596#comment:1 <ul> <li><strong>owner</strong> changed from <span class="trac-author">Matias Capeletto</span> to <span class="trac-author">Marshall Clow</span> </li> <li><strong>component</strong> <span class="trac-field-old">Documentation</span> → <span class="trac-field-new">algorithm</span> </li> </ul> Ticket Marshall Clow Thu, 23 Feb 2012 19:36:32 GMT status, milestone changed https://svn.boost.org/trac10/ticket/6596#comment:2 https://svn.boost.org/trac10/ticket/6596#comment:2 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">assigned</span> </li> <li><strong>milestone</strong> <span class="trac-field-old">To Be Determined</span> → <span class="trac-field-new">Boost 1.50.0</span> </li> </ul> <p> Thanks for the bug report. </p> <p> At first I really liked your suggestion, but when I looked more closely, I noticed that both <code>find_head</code> and <code>find_tail</code> can take negative length parameters (<code>N</code>) which mean return <code>length(input)+N</code> , so I think that the statement "If 'input' is less than 'N' elements long" is not correct. </p> <p> I checked in the minimal change (if/is), and will think about a better way to word this. </p> Ticket Marshall Clow Thu, 23 Feb 2012 19:36:48 GMT <link>https://svn.boost.org/trac10/ticket/6596#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/6596#comment:3</guid> <description> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/77101" title="Fix typos; Refs #6596">[77101]</a>) Fix typos; Refs <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/6596" title="#6596: Bugs: Docs bug in boost_1_49_0_beta1/doc/html/boost/algorithm/find_head.html (closed: fixed)">#6596</a> </p> </description> <category>Ticket</category> </item> <item> <author>Michael J Smith <emmenjay@…></author> <pubDate>Thu, 23 Feb 2012 21:18:49 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/6596#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/6596#comment:4</guid> <description> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/6596#comment:2" title="Comment 2">marshall</a>: </p> <blockquote class="citation"> <p> Thanks for the bug report. </p> <p> At first I really liked your suggestion, but when I looked more closely, I noticed that both <code>find_head</code> and <code>find_tail</code> can take negative length parameters (<code>N</code>) which mean return <code>length(input)+N</code> , so I think that the statement "If 'input' is less than 'N' elements long" is not correct. </p> <p> I checked in the minimal change (if/is), and will think about a better way to word this. </p> </blockquote> <p> Oops. Post in haste, repent at leisure. </p> <p> How about this: </p> <p> For 'N' &gt;= 0: Get the first 'N' elements of the input range. If 'N' is greater than the length of the input range, return the whole input range. </p> <p> For 'N' &lt; 0: Get the first size(input) + 'N' elements. </p> <p> e.g. </p> <pre class="wiki"> string s = "Algorithm"; FindHead(s, 3); // returns "Alg" FindHead(s, 42); // returns "Algorithm" FindHead(s, -3); // returns "Algori" </pre><p> </p> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Fri, 24 Feb 2012 21:32:02 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/6596#comment:5 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/6596#comment:5</guid> <description> <p> I'm looking at the page some more, and I see: </p> <pre class="wiki">Description: Get the head of the input. Head is a prefix of the string of the given size. If the input is shorter then required, whole input is considered to be the head. ... Parameters: Input:An input string N: Length of the head For N&gt;=0, at most N characters are extracted. For N&lt;0, size(Input)-|N| characters are extracted. </pre><p> I think adding "at most" before "size(Input)" needs to be done. As for the description, I think putting the length semantics there is a duplication. </p> <p> Hmm. </p> </description> <category>Ticket</category> </item> <item> <author>Michael J Smith <emmenjay@…></author> <pubDate>Sat, 25 Feb 2012 04:40:22 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/6596#comment:6 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/6596#comment:6</guid> <description> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/6596#comment:5" title="Comment 5">anonymous</a>: </p> <blockquote class="citation"> <p> As for the description, I think putting the length semantics there is a duplication. </p> </blockquote> <p> <br /> </p> <p> You may be right. Let me give you some context. I've just started messing with Boost and had no idea what find_head() did. I brought up the docs and looked at the prototype, then read the description. I had to puzzle over the description for a couple of minutes to figure out what it meant. I figured that there might be a clearer way of saying it. <br /> </p> <p> Talking of a "string" in the description is potentially confusing as the input range doesn't have to be a string.<br /> </p> <p> In that context, "prefix" is not entirely clear. </p> <p> I guess I'd like to see a phrase containing something like "the first 'N' elements of the input range" in there somewhere. </p> <p> Thoughts? </p> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Mon, 27 Feb 2012 20:29:07 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/6596#comment:7 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/6596#comment:7</guid> <description> <blockquote class="citation"> <p> I guess I'd like to see a phrase containing something like "the first 'N' elements of the input range" in there somewhere. </p> </blockquote> <p> I specifically don't want to say that - because it isn't true (in general). </p> <p> It is true only when N is &gt;= 0 and &lt; length of the input sequence. </p> <p> What I was trying to say in my earlier comment (about duplication) is that the semantics for positive and negative values of N are right there on the page - but not in the description. </p> <p> I'm not opposed to changing the description; I just want to find something better. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Marshall Clow</dc:creator> <pubDate>Mon, 27 Feb 2012 20:41:01 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/6596#comment:8 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/6596#comment:8</guid> <description> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/77130" title="Another doc fix; Refs #6596">[77130]</a>) Another doc fix; Refs <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/6596" title="#6596: Bugs: Docs bug in boost_1_49_0_beta1/doc/html/boost/algorithm/find_head.html (closed: fixed)">#6596</a> </p> </description> <category>Ticket</category> </item> <item> <author>Michael J Smith <emmenjay@…></author> <pubDate>Mon, 27 Feb 2012 22:02:02 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/6596#comment:9 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/6596#comment:9</guid> <description> <p> Replying to <a class="ticket" href="https://svn.boost.org/trac10/ticket/6596#comment:7" title="Comment 7">anonymous</a>: </p> <blockquote class="citation"> <p> I'm not opposed to changing the description; I just want to find something better. </p> </blockquote> <p> I fear that I may be turning into a pest and that's not my intention. I'm just tossing up some ideas for your consideration, I'm not strongly attached to any particular position. </p> <p> Your point about duplication is well made so I won't say more about that. </p> <p> What do you think about my point about the terms "string" and "prefix"? Do you think they may be misleading, given the flexibility of the "input range" to contain other data types, or do you see "string" input ranges as being the main event? </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Marshall Clow</dc:creator> <pubDate>Wed, 23 May 2012 16:25:51 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/6596#comment:10 https://svn.boost.org/trac10/ticket/6596#comment:10 <ul> <li><strong>status</strong> <span class="trac-field-old">assigned</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/78557" title="Merged changes for Boost.Algorithm to release; Fixes #6596; Fixes ...">[78557]</a>) Merged changes for Boost.Algorithm to release; Fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/6596" title="#6596: Bugs: Docs bug in boost_1_49_0_beta1/doc/html/boost/algorithm/find_head.html (closed: fixed)">#6596</a>; Fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/6689" title="#6689: Bugs: For String Algo's trim, documentation is misleading. (closed: fixed)">#6689</a>; Fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/3215" title="#3215: Feature Requests: Clamp function (closed: fixed)">#3215</a>; Fixes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/6840" title="#6840: Bugs: Mistake in Boost 1.49 String Algorithm Documentation (closed: fixed)">#6840</a> </p> Ticket