Commit graph

361 commits

Author SHA1 Message Date
Andrei Alexandrescu
5a0134dd10 Fixed 672 broken links 2011-06-09 09:48:53 -05:00
andralex
7b9460ec54 removed unused function 2011-06-06 13:40:26 -05:00
andralex
017c1e847d bugzilla 3785 + improvements 2011-06-06 13:31:09 -05:00
Andrei Alexandrescu
1083bd4e7b One pass through std.range and friends
* Made emplace faster and replaced calls to it to also make them faster.

* Replaced phobos.d in posix.mak with index.d.

* Added version=StdDdoc to documentation build in posix.mak, and replaced uses of D_Ddoc with it.

* Improved documentation target in posix.mak (target dir automatically created).

* Added nice documentation table and cheat sheet at the top of std.algorithm.

* Replaced a few helper structs in std.range and std.algorithm with local structs, which simplify matters a fair amount.

* Added more constraints to functions in std.algorithm (still work in progress).

* Improved error message in std.algorithm.sort in case of failure to sort.

* std.random.dice(1, 10) now works (no need for array notation std.random.dice([1, 10])).

* Fixed documentation bugs and insufficiencies in std.range (still more to do).

* Improved speed of walkLength.

* Simplified retro.

* Simplified and optimized stride. Also folded stride(stride(r, a), b) into stride(r, a * b).

* Added roundRobin to std.range, which as a perk simplified radial.

* Added takeOne and takeNone to std.range.

* Added unsigned to std.traits.
2011-02-27 12:38:49 -06:00
Walter Bright
046e1b36db add source links 2011-02-06 15:46:50 -08:00
Andrei Alexandrescu
1e4610663f Replaced ddoc symbol with the D_Ddoc built-in throughout 2011-01-22 21:36:53 +00:00
Jonathan M Davis
d8488a9865 Phobos has now been changed to use std.datetime. Also, bug# 3848 has been fixed.
std.gregorian, std.date, and std.dateparse have all been marked as
scheduled for deprecation. Everywhere (except for std.file) which was
using std.date is now using std.datetime. std.file is now using
std.datetime but has a number of functions still using d_time but which
are marked as scheduled for deprecation. I tried to give as many as I
could pragmas indicating that they were scheduled for deprecation, but
at the moment, that requires that a function be a templated function, and
I couldn't templatize all of them. So, some functions in std.file are
only marked as scheduled for deprecation in their documentation and will
not give any warning on compilation.

I had to rename several functions in std.file in order to avoid making
any breaking changes. And since I was already having to mess with
function names, it seemed like a good time to change the names of a
number of the functions in std.file to use proper capitalization
(such as changing isdir to isDir) as has been discussed and overwhelmingly
supported in the newsgroup with regards to std.string. And since I was
making those changes, it seemed like a good time to fix bug# 3848
(functions in std.file don't take symbolic links into account) as well.
So, std.file should now deal with symlinks properly.

The issue which Andrei brought up with +VERSION causing the std.datetime
unit tests to fail on OSX has been fixed as well.
2011-01-19 11:10:18 +00:00
Masahiro Nakagawa
b5058f6875 Fix std.random.XorshiftEngine for 64bit environment 2011-01-10 18:19:12 +00:00
Masahiro Nakagawa
2f7bcb8dce Add max / min properties to Xorshift 2011-01-10 15:56:40 +00:00
Masahiro Nakagawa
951491f8fb Added Xorshift to std.random 2011-01-10 15:27:55 +00:00
Don Clugston
84477a5d3e Move Boost copyright declaration from ddoc to normal comment. Fixes ugly ddoc output. 2010-11-24 19:34:47 +00:00
David Simcha
8331c70969 More 64 fixes for semantic errors that only show up when templates are instantiated via unittests. Now I'm actually serious about Phobos passing semantic analysis, except for a few modules due to weird druntime issues. 2010-11-10 05:25:50 +00:00
Steven Schveighoffer
d8f8b378e5 Removed shared static constructor, it creates a cycle with std.encoding, and the ctor wasn't doing anything anyways (last line which affects the seed was commented out). 2010-11-08 14:27:23 +00:00
David Simcha
497ea8f06b randomShuffle should work with sealed ranges. 2010-09-09 19:52:19 +00:00
Walter Bright
b8ce58ccd1 detab sources 2010-08-23 02:14:45 +00:00
David Simcha
75de9835b4 Bug 2951: std.random.dice() should be templated on proportions. 2010-08-17 03:38:36 +00:00
David Simcha
ebed756055 Range cleanup for std.random. 2010-08-15 03:10:35 +00:00
Andrei Alexandrescu
432e3fdfc8 Replaced std.contracts with std.exception throughout 2010-07-04 22:09:03 +00:00
David Simcha
791ee0460d Bug 4171: std.random.uniform does not work for a range of characters 2010-06-18 01:05:36 +00:00
SHOO
3948396b96 Mark deprecated to unittest 2010-05-23 02:07:56 +00:00
Walter Bright
9b4dcc1c0e invariant => immutable 2010-05-05 22:21:46 +00:00
Masahiro Nakagawa
a288172908 Add @property to length method. 2010-05-04 21:54:00 +00:00
Sean Kelly
9be950356b Converted "static this" to "shared static this" where appropriate. 2010-03-09 03:54:06 +00:00
Andrei Alexandrescu
6902b795c9 Issue 3738 - MinstdRand0 and MinstdRand very poor performance 2010-01-24 23:02:14 +00:00
David Simcha
ff54d867e4 bugzilla 2977: std.random.unpredictableSeed() should use thread ID somewhere 2009-12-01 14:09:48 +00:00
Walter Bright
1b0d9811c3 fix opEquals type 2009-11-22 08:38:36 +00:00
Andrei Alexandrescu
6ecb61207e Added static checks for the parameters of the linear congruential generator 2009-10-26 22:51:14 +00:00
Sean Kelly
747f3cf1e4 Changed Phobos to use the Boost license. Currently, all public domain modules and all licensed modules by Walter, Andrei, Bartosz, and Don have been changed to use this license (excepting std.c, for the moment). Ideally, all Phobos modules will eventually be distributed under this license, which means obtaining permission from a few more authors, deleting, or rewriting some modules.
Removed std.openrj.
2009-09-16 18:19:51 +00:00
Andrei Alexandrescu
0c142994d9 See changelog - bunch of bug fixes and a couple additions for release 2.032 2009-08-31 19:46:33 +00:00
Andrei Alexandrescu
6d696edd0b fixed bug: uniform does not work when passed immutable data 2009-07-11 19:03:41 +00:00
Andrei Alexandrescu
f19d95abd4 added randomSample. 2009-07-04 07:04:29 +00:00
Walter Bright
cf644a325a add shared 2009-05-08 05:00:12 +00:00
Andrei Alexandrescu
935c1ac0da fix for bug 2921 2009-05-03 20:53:23 +00:00
Andrei Alexandrescu
79af28268c doc fix 2009-04-29 21:33:23 +00:00
Andrei Alexandrescu
8b8703107b fixed unlisted bug in MersenneTwister.popFront 2009-04-22 23:30:48 +00:00
Andrei Alexandrescu
a0bb7dda47 undeprecated rand_seed 2009-04-20 15:25:14 +00:00
Andrei Alexandrescu
66635666e6 added uniformDistribution, fixed docs 2009-04-19 17:19:02 +00:00
Andrei Alexandrescu
d763ccf80b readded (as deprecated) functions std.string.toString, std.random.rand_seed, and std.random.random 2009-04-13 20:46:04 +00:00
Andrei Alexandrescu
5cf3d7dd8b Introduced workaround for ddoc bug for std.random 2009-04-13 19:34:15 +00:00
Andrei Alexandrescu
dfef2a7214 Replaced next, retreat, head, and toe with (respectively) popFront, popBack, front, and back 2009-04-13 19:10:58 +00:00
Andrei Alexandrescu
c64411af03 added template constraint to uniform() 2009-04-11 20:39:53 +00:00
Andrei Alexandrescu
0cb5ab45bb * Added RandomCover that covers a given range in a random manner
* Eliminated the old-fashioned random functions
* Defined a default random object that simplifies calls to the random
functions
* Changed generators to obey the range interface.
2009-04-06 17:31:00 +00:00
Sean Kelly
e108928d21 * Modified all std modules to use core.sys.posix in place of std.c.linux.
* Transformed std.c.linux.* into wrappers around core.sys.posix modules where appropriate.
* Added std.c.osx as the OSX equivalent of std.c.linux.
* Added std.c.osx.socket for OSX-specific socket declarations not covered by the Posix spec.
* Altered all makefiles to zip, etc, the new std.c.osx package.
2009-03-26 03:02:32 +00:00
Walter Bright
d57e203dc9 fold in some OSX changes 2009-02-10 02:21:15 +00:00
Sean Kelly
edb5c5003e This commit includes all the changes necessary for Phobos to run against druntime. Here is a sucinct list of the changes made:
* Removed gcstats.  Garbage collector statistics will be avaialable in durintime's 'memory' module.
    * Removed object.d.  This module is replaced by the object.d provided by druntime.
    * Removed std.array.  To trap an array bounds error, import 'exception' from druntime and catch ArrayBoundsException.
    * Removed std.asserterror.  To trap an asertion failure, import 'exception' from druntime and catch AssertException.
    * Removed std.gc.  To interact with the garbage collector, import 'memory' from druntime.
    * Removed std.hiddenfunc.  No equivalent exception is currently exposed by druntime, but if one is exposed it will be called HiddenFuncException and be declared in 'exception'.
    * Removed std.moduleinit.  druntime declares ModuleInfo in object.d, so it is implicitly availble without importing.
    * Removed std.outofmemory.  To trap an out of memory error, import 'exception' from druntime and catch OutOfMemoryException.
    * Removed std.switcherr.  To trap a switch error, import 'exception' from druntime and catch SwitchException.
    * Removed std.synchro.  This functionality will exist within druintime.
    * Removed std.thread.  A Thread class is available within druntime's 'thread' module.  An interface comparison will be provided separately.
    * Removed std.typeinfo.  The classes defined in this package are for runtime use and should not be visible to the user.

The prior version of Phobos has been archived in tags/phobos-2.019 if needed.
2008-10-11 00:56:40 +00:00
Andrei Alexandrescu
f2fa28e033 Fixed fix in unpredictableSeed. 2008-09-11 03:46:11 +00:00
Andrei Alexandrescu
c433c36658 Fixed predictability in unpredictableSeed. 2008-09-11 03:30:45 +00:00
Don Clugston
0082bfa2f2 Fix to allow random to compile with -cov.
Commented out failing unit tests in bigint (seem to be opAssign with integer arguments).
2008-06-30 20:07:05 +00:00
Andrei Alexandrescu
1ae5300f52 * std.algorithm: Changed the map() function so that it deduces the return type
* std.contracts: Added file and line information to enforce. Added errnoEnforce that reads and formats a message according to errno. Added corresponding ErrnoException class.

* std.encoding: For now commented out std.encoding.to. 

* std.file: Fixed bug 2065

* std.format: Fixed bug in raw write for arrays

* std.getopt: Added new option stopOnFirstNonOption. Also automatically expand dubious option groups with embedded in them (useful for shebang scripts)

* std.math: improved integral powers

* std.md5: Improved signature of sum so it takes multiple arrays. Added getDigestString.

* std.path: changed signatures of test functions from bool to int. Implemented rel2abs for Windows. Improved join so that it accepts multiple paths. Got rid of some gotos with the help of scope statements.

* std.process: added getenv and setenv. Improved system() so it returns the exit code correctly on Linux.

* std.random: added the dice function - a handy (possibly biased) dice.

* std.file: added support for opening large files (not yet tested)

* std.utf: added the codeLength function. Got rid of some gotos.
2008-05-06 05:08:52 +00:00
Andrei Alexandrescu
a9c935ee10 * Made unpredictableSeed return different numbers every call (except for rarely-encountered MT scenarios). Added variable name that will take experts millenia to figure out.
* Changed the boundaries syntax from two separate characters '[', ')' to one string "[)" throughout.
2008-03-06 20:18:08 +00:00