Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions std/algorithm/comparison.d
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ import std.range.primitives;
import std.traits;
// FIXME
import std.meta : allSatisfy;
import std.typecons; // : Flag, Tuple, tuple, Yes;
import std.typecons; // : tuple, Tuple, Flag, Yes;

/**
Find $(D value) _among $(D values), returning the 1-based index
Expand Down Expand Up @@ -852,7 +852,7 @@ range of range (of range...) comparisons.
@safe unittest
{
import std.algorithm.comparison : equal;
import std.range : chunks, iota;
import std.range : iota, chunks;
assert(equal!(equal!equal)(
[[[0, 1], [2, 3]], [[4, 5], [6, 7]]],
iota(0, 8).chunks(2).chunks(2)
Expand Down Expand Up @@ -925,7 +925,7 @@ range of range (of range...) comparisons.

@safe pure unittest
{
import std.utf : byChar, byDchar, byWchar;
import std.utf : byChar, byWchar, byDchar;

assert(equal("æøå".byChar, "æøå"));
assert(equal("æøå", "æøå".byChar));
Expand Down
4 changes: 2 additions & 2 deletions std/algorithm/internal.d
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ version(unittest)

package string[] rndstuff(T : string)()
{
import std.random : Random, uniform, unpredictableSeed;
import std.random : Random, unpredictableSeed, uniform;

static Random rnd;
static bool first = true;
Expand All @@ -46,7 +46,7 @@ version(unittest)

package int[] rndstuff(T : int)()
{
import std.random : Random, uniform, unpredictableSeed;
import std.random : Random, unpredictableSeed, uniform;

static Random rnd;
static bool first = true;
Expand Down
4 changes: 2 additions & 2 deletions std/algorithm/iteration.d
Original file line number Diff line number Diff line change
Expand Up @@ -2748,7 +2748,7 @@ if (fun.length >= 1)

alias binfuns = staticMap!(binaryFun, fun);
static if (fun.length > 1)
import std.typecons : isTuple, tuple;
import std.typecons : tuple, isTuple;

/++
No-seed version. The first element of $(D r) is used as the seed's value.
Expand Down Expand Up @@ -3219,7 +3219,7 @@ if (fun.length >= 1)
// Sum all elements with explicit seed
assert(arr.fold!((a, b) => a + b)(6) == 21);

import std.algorithm.comparison : max, min;
import std.algorithm.comparison : min, max;
import std.typecons : tuple;

// Compute minimum and maximum at the same time
Expand Down
10 changes: 5 additions & 5 deletions std/algorithm/mutation.d
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ T2=$(TR $(TDNW $(LREF $1)) $(TD $+))
module std.algorithm.mutation;

import std.range.primitives;
import std.traits : isArray, isBlitAssignable, isNarrowString, isSomeChar, Unqual;
import std.traits : isArray, isBlitAssignable, isNarrowString, Unqual, isSomeChar;
// FIXME
import std.typecons; // : tuple, Tuple;

Expand Down Expand Up @@ -279,7 +279,7 @@ Unicode integrity is not preserved:
{
import std.algorithm.comparison : equal;
import std.conv : text;
import std.random : Random, uniform, unpredictableSeed;
import std.random : Random, unpredictableSeed, uniform;

// a more elaborate test
{
Expand Down Expand Up @@ -845,7 +845,7 @@ See_Also:
void initializeAll(Range)(Range range)
if (isInputRange!Range && hasLvalueElements!Range && hasAssignableElements!Range)
{
import core.stdc.string : memcpy, memset;
import core.stdc.string : memset, memcpy;
import std.traits : hasElaborateAssign, isDynamicArray;

alias T = ElementType!Range;
Expand Down Expand Up @@ -901,7 +901,7 @@ if (is(Range == char[]) || is(Range == wchar[]))
///
@system unittest
{
import core.stdc.stdlib : free, malloc;
import core.stdc.stdlib : malloc, free;

struct S
{
Expand Down Expand Up @@ -2835,7 +2835,7 @@ if (isInputRange!Range && hasLvalueElements!Range && is(typeof(range.front = val
///
nothrow @system unittest
{
import core.stdc.stdlib : free, malloc;
import core.stdc.stdlib : malloc, free;

auto s = (cast(int*) malloc(5 * int.sizeof))[0 .. 5];
uninitializedFill(s, 42);
Expand Down
12 changes: 6 additions & 6 deletions std/algorithm/setops.d
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ module std.algorithm.setops;
import std.range.primitives;

// FIXME
import std.functional; // : binaryFun, unaryFun;
import std.functional; // : unaryFun, binaryFun;
import std.traits;
// FIXME
import std.meta; // : AliasSeq, allSatisfy, anySatisfy, staticMap;
import std.meta; // : AliasSeq, staticMap, allSatisfy, anySatisfy;

import std.algorithm.sorting; // : Merge;
import std.typecons : No;
Expand Down Expand Up @@ -82,13 +82,13 @@ auto cartesianProduct(R1, R2)(R1 range1, R2 range2)
if (!allSatisfy!(isForwardRange, R1, R2) ||
anySatisfy!(isInfinite, R1, R2))
{
import std.algorithm.iteration : joiner, map;
import std.algorithm.iteration : map, joiner;

static if (isInfinite!R1 && isInfinite!R2)
{
static if (isForwardRange!R1 && isForwardRange!R2)
{
import std.range : chain, repeat, sequence, take, zip;
import std.range : zip, repeat, take, chain, sequence;

// This algorithm traverses the cartesian product by alternately
// covering the right and bottom edges of an increasing square area
Expand All @@ -107,13 +107,13 @@ if (!allSatisfy!(isForwardRange, R1, R2) ||
}
else static if (isInputRange!R1 && isForwardRange!R2 && !isInfinite!R2)
{
import std.range : repeat, zip;
import std.range : zip, repeat;
return joiner(map!((ElementType!R1 a) => zip(repeat(a), range2.save))
(range1));
}
else static if (isInputRange!R2 && isForwardRange!R1 && !isInfinite!R1)
{
import std.range : repeat, zip;
import std.range : zip, repeat;
return joiner(map!((ElementType!R2 a) => zip(range1.save, repeat(a)))
(range2));
}
Expand Down
16 changes: 8 additions & 8 deletions std/algorithm/sorting.d
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ void completeSort(alias less = "a < b", SwapStrategy ss = SwapStrategy.unstable,
if (hasLength!(RandomAccessRange2) && hasSlicing!(RandomAccessRange2))
{
import std.algorithm.mutation : bringToFront;
import std.range : assumeSorted, chain;
import std.range : chain, assumeSorted;
// Probably this algorithm can be optimized by using in-place
// merge
auto lhsOriginal = lhs.release();
Expand Down Expand Up @@ -619,7 +619,7 @@ if (isRandomAccessRange!Range && hasLength!Range && hasSlicing!Range)
{
assert(pivot < r.length || r.length == 0 && pivot == 0);
if (r.length <= 1) return 0;
import std.algorithm.mutation : move, swapAt;
import std.algorithm.mutation : swapAt, move;
alias lt = binaryFun!less;

// Pivot at the front
Expand Down Expand Up @@ -1939,7 +1939,7 @@ if (((ss == SwapStrategy.unstable && (hasSwappableElements!Range ||
{
import std.algorithm.internal : rndstuff;
import std.algorithm.mutation : swapRanges;
import std.random : Random, uniform, unpredictableSeed;
import std.random : Random, unpredictableSeed, uniform;
import std.uni : toUpper;

// sort using delegate
Expand Down Expand Up @@ -2038,7 +2038,7 @@ if (((ss == SwapStrategy.unstable && (hasSwappableElements!Range ||

private void quickSortImpl(alias less, Range)(Range r, size_t depth)
{
import std.algorithm.comparison : max, min;
import std.algorithm.comparison : min, max;
import std.algorithm.mutation : swap, swapAt;

alias Elem = ElementType!(Range);
Expand Down Expand Up @@ -2736,7 +2736,7 @@ private template TimSortImpl(alias pred, R)

@safe unittest
{
import std.random : Random, randomShuffle, uniform;
import std.random : Random, uniform, randomShuffle;

// Element type with two fields
static struct E
Expand Down Expand Up @@ -2893,7 +2893,7 @@ schwartzSort(alias transform, alias less = "a < b",
if (isRandomAccessRange!R && hasLength!R)
{
import std.conv : emplace;
import std.range : SortedRange, zip;
import std.range : zip, SortedRange;
import std.string : representation;

alias T = typeof(unaryFun!transform(r.front));
Expand Down Expand Up @@ -3437,7 +3437,7 @@ private T[] randomArray(Flag!"exactSize" flag = No.exactSize, T = int)(
T minValue = 0, T maxValue = 255)
{
import std.algorithm.iteration : map;
import std.random : Random, uniform, unpredictableSeed;
import std.random : unpredictableSeed, Random, uniform;
auto size = flag == Yes.exactSize ? maxSize : uniform(1, maxSize);
return iota(0, size).map!(_ => uniform(minValue, maxValue)).array;
}
Expand Down Expand Up @@ -3698,7 +3698,7 @@ if (isInputRange!(SRange) && isRandomAccessRange!(TRange)

@system unittest
{
import std.random : Random, randomShuffle, uniform, unpredictableSeed;
import std.random : Random, unpredictableSeed, uniform, randomShuffle;
import std.typecons : Yes;

auto r = Random(unpredictableSeed);
Expand Down
4 changes: 2 additions & 2 deletions std/array.d
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ import std.meta;
import std.traits;

import std.range.primitives;
public import std.range.primitives : back, empty, front, popBack, popFront, save;
public import std.range.primitives : save, empty, popFront, popBack, front, back;

/**
* Allocates an array and initializes it with copies of the elements
Expand Down Expand Up @@ -744,7 +744,7 @@ slice, returns that slice. Otherwise, returns the null slice.
auto overlap(T, U)(T[] r1, U[] r2) @trusted pure nothrow
if (is(typeof(r1.ptr < r2.ptr) == bool))
{
import std.algorithm.comparison : max, min;
import std.algorithm.comparison : min, max;
auto b = max(r1.ptr, r2.ptr);
auto e = min(r1.ptr + r1.length, r2.ptr + r2.length);
return b < e ? b[0 .. e - b] : null;
Expand Down
6 changes: 3 additions & 3 deletions std/bigint.d
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ module std.bigint;

import std.conv : ConvException;

private import std.format : FormatException, FormatSpec;
private import std.format : FormatSpec, FormatException;
private import std.internal.math.biguintcore;
private import std.range.primitives;
private import std.traits;
Expand Down Expand Up @@ -674,7 +674,7 @@ public:
///
@system unittest
{
import std.conv : ConvOverflowException, to;
import std.conv : to, ConvOverflowException;
import std.exception : assertThrown;

assert(BigInt("0").to!int == 0);
Expand All @@ -687,7 +687,7 @@ public:

@system unittest
{
import std.conv : ConvOverflowException, to;
import std.conv : to, ConvOverflowException;
import std.exception : assertThrown;

assert(BigInt("-1").to!byte == -1);
Expand Down
4 changes: 2 additions & 2 deletions std/bitmanip.d
Original file line number Diff line number Diff line change
Expand Up @@ -772,7 +772,7 @@ struct BitArray
{
private:

import core.bitop : bsf, bt, btr, bts;
import core.bitop : bts, btr, bsf, bt;
import std.format : FormatSpec;

size_t _len;
Expand Down Expand Up @@ -2052,7 +2052,7 @@ public:
*/
@property auto bitsSet() const nothrow
{
import std.algorithm.iteration : filter, joiner, map;
import std.algorithm.iteration : filter, map, joiner;
import std.range : iota;

return iota(dim).
Expand Down
2 changes: 1 addition & 1 deletion std/c/freebsd/socket.d
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ public import core.sys.posix.netdb;
public import core.sys.posix.netinet.in_ : IPPROTO_IGMP, IPPROTO_GGP,
IPPROTO_PUP, IPPROTO_IDP, IPPROTO_ND,
IPPROTO_MAX, INADDR_LOOPBACK, INADDR_NONE;
public import core.sys.posix.sys.socket : AF_APPLETALK, AF_IPX, MSG_NOSIGNAL, SOCK_RDM;
public import core.sys.posix.sys.socket : AF_APPLETALK, AF_IPX, SOCK_RDM, MSG_NOSIGNAL;
2 changes: 1 addition & 1 deletion std/c/process.d
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ deprecated("Import core.stdc.stdlib or the appropriate core.sys.posix.* modules
module std.c.process;

private import core.stdc.stddef;
public import core.stdc.stdlib : abort, exit, system;
public import core.stdc.stdlib : exit, abort, system;

extern (C):

Expand Down
10 changes: 5 additions & 5 deletions std/complex.d
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ if (isFloatingPoint!T)
Complex!(CommonType!(T, R)) opBinaryRight(string op, R)(R lhs) const
if (op == "^^" && isNumeric!R)
{
import std.math : cos, exp, log, PI, sin;
import std.math : cos, exp, log, sin, PI;
Unqual!(CommonType!(T, R)) ab = void, ar = void;

if (lhs >= 0)
Expand Down Expand Up @@ -370,7 +370,7 @@ if (isFloatingPoint!T)
ref Complex opOpAssign(string op, C)(C z)
if (op == "^^" && is(C R == Complex!R))
{
import std.math : cos, exp, log, sin;
import std.math : exp, log, cos, sin;
immutable r = abs(this);
immutable t = arg(this);
immutable ab = r^^z.re * exp(-t*z.im);
Expand Down Expand Up @@ -799,7 +799,7 @@ Complex!T conj(T)(Complex!T z) @safe pure nothrow @nogc
Complex!(CommonType!(T, U)) fromPolar(T, U)(T modulus, U argument)
@safe pure nothrow @nogc
{
import std.math : cos, sin;
import std.math : sin, cos;
return Complex!(CommonType!(T,U))
(modulus*cos(argument), modulus*sin(argument));
}
Expand All @@ -822,7 +822,7 @@ Complex!(CommonType!(T, U)) fromPolar(T, U)(T modulus, U argument)
*/
Complex!T sin(T)(Complex!T z) @safe pure nothrow @nogc
{
import std.math : coshisinh, expi;
import std.math : expi, coshisinh;
auto cs = expi(z.re);
auto csh = coshisinh(z.im);
return typeof(return)(cs.im * csh.re, cs.re * csh.im);
Expand All @@ -840,7 +840,7 @@ Complex!T sin(T)(Complex!T z) @safe pure nothrow @nogc
/// ditto
Complex!T cos(T)(Complex!T z) @safe pure nothrow @nogc
{
import std.math : coshisinh, expi;
import std.math : expi, coshisinh;
auto cs = expi(z.re);
auto csh = coshisinh(z.im);
return typeof(return)(cs.re * csh.re, - cs.im * csh.im);
Expand Down
4 changes: 2 additions & 2 deletions std/concurrency.d
Original file line number Diff line number Diff line change
Expand Up @@ -2269,7 +2269,7 @@ private
version (unittest)
{
import std.stdio;
import std.typecons : Tuple, tuple;
import std.typecons : tuple, Tuple;

void testfn(Tid tid)
{
Expand Down Expand Up @@ -2410,7 +2410,7 @@ auto ref initOnce(alias var)(lazy typeof(var) init, Mutex mutex)
// check that var is global, can't take address of a TLS variable
static assert(is(typeof({ __gshared p = &var; })),
"var must be 'static shared' or '__gshared'.");
import core.atomic : atomicLoad, atomicStore, MemoryOrder;
import core.atomic : atomicLoad, MemoryOrder, atomicStore;

static shared bool flag;
if (!atomicLoad!(MemoryOrder.acq)(flag))
Expand Down
2 changes: 1 addition & 1 deletion std/container/array.d
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ private struct RangeT(A)
struct Array(T)
if (!is(Unqual!T == bool))
{
import core.stdc.stdlib : free, malloc, realloc;
import core.stdc.stdlib : malloc, realloc, free;
import core.stdc.string : memcpy, memmove, memset;

import core.memory : GC;
Expand Down
2 changes: 1 addition & 1 deletion std/container/dlist.d
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ module std.container.dlist;

// If you want to apply range operations, simply slice it.
import std.algorithm.searching : countUntil;
import std.range : popBackN, popFrontN, walkLength;
import std.range : popFrontN, popBackN, walkLength;

auto sl = DList!int([1, 2, 3, 4, 5]);
assert(countUntil(sl[], 2) == 1);
Expand Down
Loading