Commit graph

177 commits

Author SHA1 Message Date
Sebastian Wilzbach
a2c6398332 Automatically add spaces to binary operators (==)
command:

sed -E "s/([[:alnum:]]) == ([[:alnum:]])/\1 == \2/g" -i **/*.d
sed -E "s/([[:alnum:]])== ([[:alnum:]])/\1 == \2/g" -i **/*.d
sed -E "s/([[:alnum:]]) ==([[:alnum:]])/\1 == \2/g" -i **/*.d
2017-02-23 00:57:47 +01:00
Sebastian Wilzbach
425ab667a3 Automatically set the range style from a..b -> a .. b
Commands:

sed -E "s/([[:alnum:]])[.][.]([[:alnum:]])/\1 .. \2/g" -i **/*.d
sed -E "s/([[:alnum:]])[.][.] ([[:alnum:]])/\1 .. \2/g" -i **/*.d
sed -E "s/([[:alnum:]]) [.][.]([[:alnum:]])/\1 .. \2/g" -i **/*.d
2017-02-22 05:37:31 +01:00
Sebastian Wilzbach
805c720595 Unify Phobos by ensuring there's always a space after cast(...)
Command:

sed -E 's/([^"])cast\(([^)]*?)\)([[:alnum:]])/\1cast(\2) \3/g' -i **/*.d
2017-02-21 16:40:20 +01:00
Sebastian Wilzbach
5521541032 Unify assert style to have no spaces between the first brace
Application of:

sed -E "s/assert +\(/assert(/" -i **/*.d
2017-02-21 15:27:15 +01:00
Sebastian Wilzbach
87dec58a41 DStyle: Constraints on declarations should have the same indentation level 2017-02-17 07:36:23 +01:00
Sebastian Wilzbach
9e58ecab2a Fix issue 16079 - memoize should work with arrays and objects 2017-02-16 04:41:09 +01:00
Sebastian Wilzbach
8d5b051235 Provide reference to other common names 2017-02-16 02:57:51 +01:00
Walter Bright
e99a7f6184 std.functional: add overflow checks 2016-07-28 13:29:00 -07:00
Atila Neves
5d5ebb578a Add @system to std.functional unit tests 2016-07-01 11:07:27 +02:00
Atila Neves
dc7fe7e593 Add @safe to some std.functional unit tests 2016-06-29 19:07:07 +02:00
Walter Bright
bde976683e use covariant tests rather than exact ones 2016-06-24 15:44:47 -07:00
Andrei Alexandrescu
75ad1df66d Merge pull request #4379 from joakim-noah/range_imports
std.range and std.functional: use locally-scoped selective imports and document module-scope symbol imports
2016-06-18 04:08:41 -04:00
Sebastian Wilzbach
ec47ac4224 Remove the WEB macro in favor of HTTP
replacement: sed 's/\$(WEB/\$(HTTP/g' -i **/*.d
2016-06-16 00:14:51 +02:00
Joakim
f07fe83ee3 std.functional: use locally-scoped selective imports and document symbols imported at module scope, checked with ddmd 2016-06-04 16:18:28 +05:30
Sebastian Wilzbach
1d34a121e9 apply all-man braces in Phobos
// find common cases
sed -E "s/^(\s*)((if|static if|for|foreach|foreach_reverse|while|unittest|switch|else|version).*)\s*\{$/\1\2\n\1{/" -i **/*.d
// catch else-if
sed -E "s/^(\s*)} (else static if| if|else if|else)(.*)\s*\{$/\1}\n\1\2\3\n\1{/" -i **/*.d
// remove created trailing whitespace
sed -i 's/[ \t]*$//' **/*.d
2016-05-31 13:07:53 +02:00
Sebastian Wilzbach
2dfbc51f17 Standardize whitespace after imports
Unified with:

sed -E "s/import\s*([^ ]+)\s*:\s*(.*(,|;))/import \1 : \2/" -i **/*.d
2016-05-29 22:09:56 +02:00
anonymous
764caefa36 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'
2016-05-27 21:32:46 +02:00
Sebastian Wilzbach
18b8abf60a remove the deprecated wiki macros 2016-05-27 05:52:23 +02:00
Sebastian Wilzbach
89a2dd5f11 use mref macro instead of link2 2016-05-16 03:30:08 +03:00
Dmitry Olshansky
e280cb6c62 Merge pull request #4171 from hardliner66/patch-1
Fibonacci should only be calculated for values bigger than 2.
2016-05-08 10:12:11 +04:00
Dmitry Olshansky
56e6d25a2d Merge pull request #4278 from jmdavis/deprecations
Move some deprecations along.
2016-05-05 16:03:05 +04:00
Jonathan M Davis
43227b12c4 Move some deprecations along. 2016-05-05 12:44:06 +02:00
Rhys Parry
b387f5eaf8 Correct typo in memoize summary description
s/re-evalation/re-evaluation/
2016-05-04 15:04:04 -07:00
Steve Biedermann
72dd35bf37 Use one liner as recommended by @lionello 2016-05-01 23:35:42 +02:00
Sebastian Wilzbach
3d67cd228c style fix: space between operators 2016-04-26 22:26:20 +03:00
Steve Biedermann
045e41bde8 Fixed Fibonacci example
The check for n == 0 was missing.
2016-04-11 10:46:49 +02:00
Steve Biedermann
1777e45fb2 Fibonacci should only be calculated for values bigger than 2. In this case, ther should be a less or equal comparison, instead of less than. 2016-04-08 09:23:01 +02:00
Sebastian Wilzbach
66e0dc39c5 convert docstring examples to unittests 2016-03-09 21:22:15 +02:00
Andrei Alexandrescu
7a06e21cc7 Merge pull request #3879 from blm768/adjust_examples
Changed "Examples:" in Ddoc to "Example:"
2015-12-26 09:21:38 -05:00
Benjamin L. Merritt
5f08c058ab Changed "Examples:" in Ddoc to "Example:" 2015-12-17 18:32:41 -08:00
Jack Stouffer
2bce92e19f Include unittest blocks as examples in std.functional 2015-12-17 13:44:10 -05:00
Jonathan M Davis
d34164a2ea Move some deprecations along. 2015-11-26 00:28:38 -08:00
Dragos Carp
d698887729 Remove obsolete TypeTuple references
Replace following names:
std.typetuple      -> std.meta
TypeTuple          -> AliasSeq
ParameterTypeTuple -> Parameters
FieldTypeTuple     -> Fields

std.traits requires more work than search/replace and is left unchanged.
2015-10-13 20:37:44 +02:00
Robert burner Schadek
32d6e23d4e std.variant housekeeping
some bugs where resolved, so some tests could be enabled
remove outcomment code last modifed 2009

another update
2015-08-12 14:15:01 +02:00
Rainer Schuetze
adab223837 remove trailing whitespace, detab, tolf 2015-05-31 11:24:01 +02:00
Walter Bright
d9a9826e55 Revert "Introducing std.meta package" 2015-05-06 14:36:45 -07:00
Dicebot
a76d90c927 Phobos should only mention tuple as std.typecons.Tuple 2015-05-05 22:22:11 +03:00
Dicebot
1c9ae027ef Rename old std.typetuple symbols inside Phobos
staticIndexOf -> indexOf
allSatisfy -> all
anySatisfy -> any
staticMap -> Map
2015-05-05 22:22:11 +03:00
Dicebot
82f54a38d3 TypeTuple -> MetaList inside Phobos 2015-05-05 22:22:11 +03:00
Dicebot
73f773838d import std.typetuple -> import std.meta 2015-05-05 22:22:10 +03:00
Ulrich Kuettler
6f6c6862d6 Add table headers in ddoc function tables 2015-02-21 19:10:51 +01:00
Ulrich Kuettler
d076b6e72b Add a simple table for functions to the functional module
Fine points

Sort table of functions
2015-02-19 23:30:16 +01:00
H. S. Teoh
a43e8d22cd Move 'forward' to std.functional. 2015-02-16 10:54:58 -08:00
k-hara
e7b3d834d7 detab and remove trailing whitespaces 2015-02-10 00:56:40 +09:00
Denis Shelomovskij
3a7044009e Fix property enforcements in std.functional._ctfe* functions. 2015-01-26 11:56:39 +03:00
Rainer Schuetze
e661e59194 do not assume memoize cache initialized before the arguments and the result are actually written 2015-01-24 10:08:47 +01:00
Ilya Yaroshenko
efb880f651 move format to std.format
The reason is to do not import `std.uni` tables, `std.string` and
probably `std.algorithm`. Note that format is used in CTFE code and
`Exception` handing.

 And it is more comfortable to import `format` from `std.format`.

std.format: clean imports (2)

remove import std.math : pow from std.uni

update scope imports in std.algorithm

update scope imports in std.exception

doFormat -> template

update scope imports in std.typecons

update scope imports in std.functional

update scope imports in std.range

update std.conv scope import

std.format: clean imports (2)

remove import std.math : pow from std.uni

update scope imports in std.algorithm

update scope imports in std.exception

doFormat -> template

update scope imports in std.typecons

update scope imports in std.functional

update scope imports in std.range

move sfromat

add public import of sformat

use std.uni
2014-11-18 22:14:28 +03:00
Ilya Yaroshenko
2788715bc5 fix binaryFun
1. Make binaryFun correct for integer comparison.
2. Remove import of half of phobos for 100% cases in phobos.

`sort`, `cmp`, `find`, `startsWith`,  `sum` and other algorithms would
be compiled faster.

fix safeOp

fix safeOPs

Fix new unittest

fix binaryReverseArgs

fix not

fix new code

fix spaces after if

optimization

1. CTFE
2. Runtime (without inlining)

change condition

fix new code

fix safeOp

optimize CTFE

CTFE optimization

immutable -> enum

remove aliases

remove macros

CTFE matching

add debug info && fix not

add spaces

minor fix

added debug example

add debug unittests & fix

fix also and add unittests

fix

typo

if (!__ctfe) assert(false); added

use 01
2014-11-15 19:10:20 +03:00
Martin Nowak
996d8bc5db fixup #2591 - missing attributes for GC.malloc call 2014-11-12 01:04:54 +01:00
Martin Nowak
c12e66a000 improve memoize with size limit
- previous implementation was dropping complete
  hash-table whenever max size was reached

- new implementation simply replaces old values
  in a fixed size hash-table when hashes collide

- use cuckoo hashing for better space usage and to
  reduce collisions of frequently used values
2014-11-05 00:15:10 +01:00