www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 20976] New: pipe documentation incorrectly renders part of


          Issue ID: 20976
           Summary: pipe documentation incorrectly renders part of memoize
           Product: D
           Version: D2
          Hardware: All
               URL: http://dlang.org/library/std/functional.html
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P3
         Component: phobos
          Assignee: nobody puremagic.com
          Reporter: john.michael.hall gmail.com

On the dlang site here: https://dlang.org/library/std/functional/pipe.html
the following documentation comment is partially shown and then cut off
strangely. However, this is also the documentation for memoize and not pipe. It
should not be shown at all. 

 * $(LINK2 https://en.wikipedia.org/wiki/Memoization, Memoizes) a function so
 * to avoid repeated computation. The memoization structure is a hash table
keyed by a
 * tuple of the function's arguments. There is a speed gain if the
 * function is repeatedly called with the same arguments and is more
 * expensive than a hash table lookup. For more information on memoization,
refer to $(HTTP
this book chapter).

double transmogrify(int a, string b)
   ... expensive computation ...
alias fastTransmogrify = memoize!transmogrify;
    auto slow = transmogrify(2, "hello");
    auto fast = fastTransmogrify(2, "hello");
    assert(slow == fast);

Jun 25 2020