D Programming Language
Report a bug If you spot a problem with this page, click here to create a Bugzilla issue. Improve this page Quickly fork, edit online, and submit a pull request for this page. Requires a signed-in GitHub account. This works well for small changes. If you'd like to make larger changes you may want to consider using local clone.

# Change Log: 2.029

Download D 2.029
released Apr 19, 2009

#### New/Changed Phobos

- std.algorithm
  - Everything converted to ranges. Big disruption. Algorithms added.
- std.array
  - Range primitives for arrays
  - Appender template
  - insert, replace functions
- std.bitmanip
  - Bitfields of length 0 are defined to be always 0.
  - The read functions for bitfields are const.
- std.contracts
  - enforce accepts const(char)[] instead of string
  - Added enforce overload that invokes a delegate on failure
  - Added assumeSorted template
  - Added structuralCast that implements, well, structural casting (incomplete).
- std.conv
  - Rewrote conversions with constrained templates.
  - Added text() function that transforms everything into text.
- std.date
  - Added a benchmark function that allows for simple timing measurements.
- std.file
  - read, write, append, rename, remove, getSize, getTimes, getAttributes, isfile, isdir, chdir, mkdir, mkdirRecurse, rmdir, listdir, copy, take filename(s) by "in char[]"
  - Added function readText that reads and validates a text file
  - Added function slurp that reads a file into an array of tuples. Example:

        auto a = slurp!(int, double)("filename", "%s, %s");

    Each line in the file looks like e.g. "1, 2.3". slurp returns an array of Tuple!(int, double) with the parsed content.
- std.format
  - Added vector parsing and printing with the specifier "%()". For example, writefln("[%(s; )]", [1, 2, 3][]) writes "[1; 2; 3]". This support is experimental and may be changed in the future.
  - Added a formattedRead function (i.e., scanf that doesn't suck). The implementation is incomplete but common cases are supported.
- std.functional
  - Improved error messages
  - Added configurable parameter names for functions as strings
  - Added Adjoin template
- std.getopt
  - Added support for parameterless delegates
- std.math
  - Intrinsics std.math.yl2x and yl2xp1 added. Improves performance of std.math.log() and similar functions (and they are now pure nothrow).
- std.mmfile
  - Minor cosmetic changes
- std.numeric
  - Added type CustomFloat that allows defining specialized floating-point numbers (e.g. 16-bit floats, positive floats etc.)
  - Added FPTemporary as the best type to store temporary values.
  - Templatized oppositeSigns
  - Added Euclidean distance
  - Added dotProduct
  - Added cosineSimilarity
  - Added normalize
  - Added string kernel functions gapWeightedSimilarity, gapWeightedSimilarityNormalized, gapWeightedSimilarityIncremental.
- std.outbuffer
  - Added a few missing overloads of write()
- std.path
  - getDrive now works with all string types
  - isabs accepts in char[]
  - join accepts variadic in char[]
  - fnmatch works with in char[]
- std.random
  - 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. So now you can write:

        Random r;
        foreach (n; take(100, uniform(0, 100))) { ... }

- std.range (new file)
  - Range manipulation stuff.
- std.regex (new file)
  - Regular expression library with wide char support, simplified interface, better speed etc.
- std.regexp
  - Scheduled for deprecation. Use std.regex instead.
- std.stdio
  - Major breaking changes: introduced the File struct. Now stdin, stdout, stderr are instances of the File struct.
  - Due to bugs in the compiler, the copy constructor and destructor of File are commented out. Walter will look into fixing the issues soon. File should work fine, but you need to close it manually.
  - A byRecord iteration mode makes it pretty easy to iterate structured text files.
  - writef and writefln now require a string as their first argument.
- std.string
  - strip, stripl, stripr, startsWith, endsWith now work with any string type
- std.typecons
  - Added constructors, assignment operator, length, toString, and slice to Tuple.
- std.utf
  - toUTF16z accepts in char[]
- std.variant
  - Added support for Variants that contain vectors and hashes of themselves
- std.c.stdio
  - Added fopen64 and friends

#### New/Changed Features

- Added template function literals

#### Bugs Fixed

- Bugzilla 675: %a format has an out-by-1 bug for denormals
- Bugzilla 2199: Segfault using array operation in function call
- Bugzilla 2203: typeof(class.template.foo) crashes compiler
- Bugzilla 2577: DMD crashes on foreach of undefined identifier
- Bugzilla 2808: 'nothrow' nested functions cannot be parsed
- Bugzilla 2812: sqrt(2.0) is about -2.7341e-53

Copyright © 1999-2016 by Digital Mars ®, All Rights Reserved | Page generated by Ddoc on Sat Feb 27 18:58:39 2016