mirror of
https://github.com/dlang/phobos.git
synced 2025-04-29 14:40:30 +03:00
XREF -> REF (sed)
Done by: (find . -type f -name "*.d" -print0; \ find . -type f -name "*.dd" -print0) | \ xargs -0 sed -i -r \ 's/\$\(XREF\s+([^(),]*),\s*([^(),]*)\)/$(REF \2, std,\1)/g'
This commit is contained in:
parent
a207b27056
commit
764caefa36
37 changed files with 167 additions and 167 deletions
|
@ -1767,7 +1767,7 @@ the benefit of have better complexity than the $(D AllocateGC.no) option. Howeve
|
|||
this option is only available for ranges whose equality can be determined via each
|
||||
element's $(D toHash) method. If customized equality is needed, then the $(D pred)
|
||||
template parameter can be passed, and the function will automatically switch to
|
||||
the non-allocating algorithm. See $(XREF functional,binaryFun) for more details on
|
||||
the non-allocating algorithm. See $(REF binaryFun, std,functional) for more details on
|
||||
how to define $(D pred).
|
||||
|
||||
Non-allocating forward range option: $(BIGOH n^2)
|
||||
|
|
|
@ -122,7 +122,7 @@ The result is then directly returned when $(D front) is called,
|
|||
rather than re-evaluated.
|
||||
|
||||
This can be a useful function to place in a chain, after functions
|
||||
that have expensive evaluation, as a lazy alternative to $(XREF array,array).
|
||||
that have expensive evaluation, as a lazy alternative to $(REF array, std,array).
|
||||
In particular, it can be placed after a call to $(D map), or before a call
|
||||
to $(D filter).
|
||||
|
||||
|
@ -205,7 +205,7 @@ Tip: $(D cache) is eager when evaluating elements. If calling front on the
|
|||
underlying _range has a side effect, it will be observeable before calling
|
||||
front on the actual cached _range.
|
||||
|
||||
Furthermore, care should be taken composing $(D cache) with $(XREF _range,take).
|
||||
Furthermore, care should be taken composing $(D cache) with $(REF take, std,_range).
|
||||
By placing $(D take) before $(D cache), then $(D cache) will be "aware"
|
||||
of when the _range ends, and correctly stop caching elements when needed.
|
||||
If calling front has no side effect though, placing $(D take) after $(D cache)
|
||||
|
@ -840,13 +840,13 @@ can be avoided by explicitly specifying a predicate lambda with a
|
|||
$(D lazy) parameter.
|
||||
|
||||
$(D each) also supports $(D opApply)-based iterators, so it will work
|
||||
with e.g. $(XREF parallelism, parallel).
|
||||
with e.g. $(REF parallel, std,parallelism).
|
||||
|
||||
Params:
|
||||
pred = predicate to apply to each element of the range
|
||||
r = range or iterable over which each iterates
|
||||
|
||||
See_Also: $(XREF range,tee)
|
||||
See_Also: $(REF tee, std,range)
|
||||
|
||||
*/
|
||||
template each(alias pred = "a")
|
||||
|
@ -1029,7 +1029,7 @@ unittest
|
|||
$(D auto filter(Range)(Range rs) if (isInputRange!(Unqual!Range));)
|
||||
|
||||
Implements the higher order _filter function. The predicate is passed to
|
||||
$(XREF functional,unaryFun), and can either accept a string, or any callable
|
||||
$(REF unaryFun, std,functional), and can either accept a string, or any callable
|
||||
that can be executed via $(D pred(element)).
|
||||
|
||||
Params:
|
||||
|
@ -1232,9 +1232,9 @@ private struct FilterResult(alias pred, Range)
|
|||
* finding the last element in the range that satisfies the filtering
|
||||
* condition (in addition to finding the first one). The advantage is
|
||||
* that the filtered range can be spanned from both directions. Also,
|
||||
* $(XREF range, retro) can be applied against the filtered range.
|
||||
* $(REF retro, std,range) can be applied against the filtered range.
|
||||
*
|
||||
* The predicate is passed to $(XREF functional,unaryFun), and can either
|
||||
* The predicate is passed to $(REF unaryFun, std,functional), and can either
|
||||
* accept a string, or any callable that can be executed via $(D pred(element)).
|
||||
*
|
||||
* Params:
|
||||
|
@ -1325,7 +1325,7 @@ Similarly to $(D uniq), $(D group) produces a range that iterates over unique
|
|||
consecutive elements of the given range. Each element of this range is a tuple
|
||||
of the element and the number of times it is repeated in the original range.
|
||||
Equivalence of elements is assessed by using the predicate $(D pred), which
|
||||
defaults to $(D "a == b"). The predicate is passed to $(XREF functional,binaryFun),
|
||||
defaults to $(D "a == b"). The predicate is passed to $(REF binaryFun, std,functional),
|
||||
and can either accept a string, or any callable that can be executed via
|
||||
$(D pred(element, element)).
|
||||
|
||||
|
@ -1772,8 +1772,8 @@ unittest
|
|||
* Chunks an input range into subranges of equivalent adjacent elements.
|
||||
*
|
||||
* Equivalence is defined by the predicate $(D pred), which can be either
|
||||
* binary, which is passed to $(XREF functional,binaryFun), or unary, which is
|
||||
* passed to $(XREF functional,unaryFun). In the binary form, two _range elements
|
||||
* binary, which is passed to $(REF binaryFun, std,functional), or unary, which is
|
||||
* passed to $(REF unaryFun, std,functional). In the binary form, two _range elements
|
||||
* $(D a) and $(D b) are considered equivalent if $(D pred(a,b)) is true. In
|
||||
* unary form, two elements are considered equivalent if $(D pred(a) == pred(b))
|
||||
* is true.
|
||||
|
@ -2025,7 +2025,7 @@ both outer and inner ranges of $(D RoR) are forward ranges; otherwise it will
|
|||
be only an input range.
|
||||
|
||||
See_also:
|
||||
$(XREF range,chain), which chains a sequence of ranges with compatible elements
|
||||
$(REF chain, std,range), which chains a sequence of ranges with compatible elements
|
||||
into a single range.
|
||||
*/
|
||||
auto joiner(RoR, Separator)(RoR r, Separator sep)
|
||||
|
@ -2626,7 +2626,7 @@ template reduce(fun...) if (fun.length >= 1)
|
|||
/++
|
||||
Seed version. The seed should be a single value if $(D fun) is a
|
||||
single function. If $(D fun) is multiple functions, then $(D seed)
|
||||
should be a $(XREF typecons,Tuple), with one field per function in $(D f).
|
||||
should be a $(REF Tuple, std,typecons), with one field per function in $(D f).
|
||||
|
||||
For convenience, if the seed is const, or has qualified fields, then
|
||||
$(D reduce) will operate on an unqualified copy. If this happens
|
||||
|
@ -2768,7 +2768,7 @@ Sometimes it is very useful to compute multiple aggregates in one pass.
|
|||
One advantage is that the computation is faster because the looping overhead
|
||||
is shared. That's why $(D reduce) accepts multiple functions.
|
||||
If two or more functions are passed, $(D reduce) returns a
|
||||
$(XREF typecons, Tuple) object with one member per passed-in function.
|
||||
$(REF Tuple, std,typecons) object with one member per passed-in function.
|
||||
The number of seeds must be correspondingly increased.
|
||||
*/
|
||||
@safe unittest
|
||||
|
@ -3459,7 +3459,7 @@ Two adjacent separators are considered to surround an empty element in
|
|||
the split range. Use $(D filter!(a => !a.empty)) on the result to compress
|
||||
empty elements.
|
||||
|
||||
The predicate is passed to $(XREF functional,binaryFun), and can either accept
|
||||
The predicate is passed to $(REF binaryFun, std,functional), and can either accept
|
||||
a string, or any callable that can be executed via $(D pred(element, s)).
|
||||
|
||||
If the empty range is given, the result is a range with one empty
|
||||
|
@ -3488,7 +3488,7 @@ Returns:
|
|||
likewise.
|
||||
|
||||
See_Also:
|
||||
$(XREF regex, _splitter) for a version that splits using a regular
|
||||
$(REF _splitter, std,regex) for a version that splits using a regular
|
||||
expression defined separator.
|
||||
*/
|
||||
auto splitter(alias pred = "a == b", Range, Separator)(Range r, Separator s)
|
||||
|
@ -3744,7 +3744,7 @@ if (is(typeof(binaryFun!pred(r.front, s)) : bool)
|
|||
Similar to the previous overload of $(D splitter), except this one uses another
|
||||
range as a separator. This can be used with any narrow string type or sliceable
|
||||
range type, but is most popular with string types. The predicate is passed to
|
||||
$(XREF functional,binaryFun), and can either accept a string, or any callable
|
||||
$(REF binaryFun, std,functional), and can either accept a string, or any callable
|
||||
that can be executed via $(D pred(r.front, s.front)).
|
||||
|
||||
Two adjacent separators are considered to surround an empty element in
|
||||
|
@ -3768,7 +3768,7 @@ Returns:
|
|||
is a forward range or bidirectional range, the returned range will be
|
||||
likewise.
|
||||
|
||||
See_Also: $(XREF regex, _splitter) for a version that splits using a regular
|
||||
See_Also: $(REF _splitter, std,regex) for a version that splits using a regular
|
||||
expression defined separator.
|
||||
*/
|
||||
auto splitter(alias pred = "a == b", Range, Separator)(Range r, Separator s)
|
||||
|
@ -4017,7 +4017,7 @@ if (is(typeof(binaryFun!pred(r.front, s.front)) : bool)
|
|||
|
||||
Similar to the previous overload of $(D splitter), except this one does not use a separator.
|
||||
Instead, the predicate is an unary function on the input range's element type.
|
||||
The $(D isTerminator) predicate is passed to $(XREF functional,unaryFun) and can
|
||||
The $(D isTerminator) predicate is passed to $(REF unaryFun, std,functional) and can
|
||||
either accept a string, or any callable that can be executed via $(D pred(element, s)).
|
||||
|
||||
Two adjacent separators are considered to surround an empty element in
|
||||
|
@ -4037,7 +4037,7 @@ Returns:
|
|||
is a forward range or bidirectional range, the returned range will be
|
||||
likewise.
|
||||
|
||||
See_Also: $(XREF regex, _splitter) for a version that splits using a regular
|
||||
See_Also: $(REF _splitter, std,regex) for a version that splits using a regular
|
||||
expression defined separator.
|
||||
*/
|
||||
auto splitter(alias isTerminator, Range)(Range input)
|
||||
|
@ -4754,7 +4754,7 @@ Lazily iterates unique consecutive elements of the given range (functionality
|
|||
akin to the $(WEB wikipedia.org/wiki/_Uniq, _uniq) system
|
||||
utility). Equivalence of elements is assessed by using the predicate
|
||||
$(D pred), by default $(D "a == b"). The predicate is passed to
|
||||
$(XREF functional,binaryFun), and can either accept a string, or any callable
|
||||
$(REF binaryFun, std,functional), and can either accept a string, or any callable
|
||||
that can be executed via $(D pred(element, element)). If the given range is
|
||||
bidirectional, $(D uniq) also yields a bidirectional range.
|
||||
|
||||
|
|
|
@ -385,7 +385,7 @@ range elements, different types of ranges are accepted:
|
|||
|
||||
/**
|
||||
To _copy at most $(D n) elements from a range, you may want to use
|
||||
$(XREF range, take):
|
||||
$(REF take, std,range):
|
||||
*/
|
||||
@safe unittest
|
||||
{
|
||||
|
@ -412,7 +412,7 @@ use $(LREF filter):
|
|||
}
|
||||
|
||||
/**
|
||||
$(XREF range, retro) can be used to achieve behavior similar to
|
||||
$(REF retro, std,range) can be used to achieve behavior similar to
|
||||
$(WEB sgi.com/tech/stl/copy_backward.html, STL's copy_backward'):
|
||||
*/
|
||||
@safe unittest
|
||||
|
|
|
@ -33,7 +33,7 @@ $(T2 endsWith,
|
|||
$(D endsWith("rocks", "ks")) returns $(D true).)
|
||||
$(T2 find,
|
||||
$(D find("hello world", "or")) returns $(D "orld") using linear search.
|
||||
(For binary search refer to $(XREF range,sortedRange).))
|
||||
(For binary search refer to $(REF sortedRange, std,range).))
|
||||
$(T2 findAdjacent,
|
||||
$(D findAdjacent([1, 2, 3, 3, 4])) returns the subrange starting with
|
||||
two equal adjacent elements, i.e. $(D [3, 3, 4]).)
|
||||
|
@ -398,7 +398,7 @@ $(D takeExactly(r1, n)), where $(D n) is the number of elements in the common
|
|||
prefix of both ranges.
|
||||
|
||||
See_Also:
|
||||
$(XREF range, takeExactly)
|
||||
$(REF takeExactly, std,range)
|
||||
*/
|
||||
auto commonPrefix(alias pred = "a == b", R1, R2)(R1 r1, R2 r2)
|
||||
if (isForwardRange!R1 && isInputRange!R2 &&
|
||||
|
@ -1317,7 +1317,7 @@ pred). Performs $(BIGOH walkLength(haystack)) evaluations of $(D
|
|||
pred).
|
||||
|
||||
To _find the last occurrence of $(D needle) in $(D haystack), call $(D
|
||||
find(retro(haystack), needle)). See $(XREF range, retro).
|
||||
find(retro(haystack), needle)). See $(REF retro, std,range).
|
||||
|
||||
Params:
|
||||
|
||||
|
|
|
@ -72,7 +72,7 @@ Params:
|
|||
otherRanges = Zero or more non-infinite forward ranges
|
||||
|
||||
Returns:
|
||||
A forward range of $(XREF typecons,Tuple) representing elements of the
|
||||
A forward range of $(REF Tuple, std,typecons) representing elements of the
|
||||
cartesian product of the given ranges.
|
||||
*/
|
||||
auto cartesianProduct(R1, R2)(R1 range1, R2 range2)
|
||||
|
|
|
@ -10,7 +10,7 @@ $(T2 completeSort,
|
|||
$(D completeSort(a, b)) leaves $(D a = [6, 10, 15]) and $(D b = [20,
|
||||
30, 40]).
|
||||
The range $(D a) must be sorted prior to the call, and as a result the
|
||||
combination $(D $(XREF range,chain)(a, b)) is sorted.)
|
||||
combination $(D $(REF chain, std,range)(a, b)) is sorted.)
|
||||
$(T2 isPartitioned,
|
||||
$(D isPartitioned!"a < 0"([-1, -2, 1, 0, 2])) returns $(D true) because
|
||||
the predicate is $(D true) for a portion of the range and $(D false)
|
||||
|
@ -594,7 +594,7 @@ Params:
|
|||
pivot = The pivot element.
|
||||
|
||||
Returns:
|
||||
A $(XREF typecons,Tuple) of the three resulting ranges. These ranges are
|
||||
A $(REF Tuple, std,typecons) of the three resulting ranges. These ranges are
|
||||
slices of the original range.
|
||||
|
||||
BUGS: stable $(D partition3) has not been implemented yet.
|
||||
|
@ -1084,12 +1084,12 @@ Sorts a random-access range according to the predicate $(D less). Performs
|
|||
$(BIGOH r.length * log(r.length)) evaluations of $(D less). Stable sorting
|
||||
requires $(D hasAssignableElements!Range) to be true.
|
||||
|
||||
$(D sort) returns a $(XREF range, SortedRange) over the original range, which
|
||||
$(D sort) returns a $(REF SortedRange, std,range) over the original range, which
|
||||
functions that can take advantage of sorted data can then use to know that the
|
||||
range is sorted and adjust accordingly. The $(XREF range, SortedRange) is a
|
||||
range is sorted and adjust accordingly. The $(REF SortedRange, std,range) is a
|
||||
wrapper around the original range, so both it and the original range are sorted,
|
||||
but other functions won't know that the original range has been sorted, whereas
|
||||
they $(I can) know that $(XREF range, SortedRange) has been sorted.
|
||||
they $(I can) know that $(REF SortedRange, std,range) has been sorted.
|
||||
|
||||
The predicate is expected to satisfy certain rules in order for $(D sort) to
|
||||
behave as expected - otherwise, the program may fail on certain inputs (but not
|
||||
|
@ -1099,7 +1099,7 @@ $(D less(a,c)) (transitivity), and, conversely, $(D !less(a,b) && !less(b,c)) to
|
|||
imply $(D !less(a,c)). Note that the default predicate ($(D "a < b")) does not
|
||||
always satisfy these conditions for floating point types, because the expression
|
||||
will always be $(D false) when either $(D a) or $(D b) is NaN.
|
||||
Use $(XREF math, cmp) instead.
|
||||
Use $(REF cmp, std,math) instead.
|
||||
|
||||
If `less` involves expensive computations on the _sort key, it may be
|
||||
worthwhile to use $(LREF schwartzSort) instead.
|
||||
|
@ -1121,10 +1121,10 @@ or more allocations per call. Both algorithms have $(BIGOH n log n) worst-case
|
|||
time complexity.
|
||||
|
||||
See_Also:
|
||||
$(XREF range, assumeSorted)$(BR)
|
||||
$(XREF range, SortedRange)$(BR)
|
||||
$(REF assumeSorted, std,range)$(BR)
|
||||
$(REF SortedRange, std,range)$(BR)
|
||||
$(XREF_PACK algorithm,mutation,SwapStrategy)$(BR)
|
||||
$(XREF functional, binaryFun)
|
||||
$(REF binaryFun, std,functional)
|
||||
*/
|
||||
SortedRange!(Range, less)
|
||||
sort(alias less = "a < b", SwapStrategy ss = SwapStrategy.unstable,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue