aboutsummaryrefslogtreecommitdiffstats
path: root/lib/stdlib
AgeCommit message (Collapse)Author
2015-12-15stdlib: Remove undocumented function specification syntaxHans Bolinder
The syntax -spec/callback F/A :: FunctionType; has been removed. No deprecation was deemed necessary.
2015-12-14Deprecate the 'random' moduleBjörn Gustavsson
The 'rand' module was introduced in OTP 18 and its use is discouraged. Deprecate it to further discourage its use.
2015-12-11stdlib tests: Replace 'random' with 'rand'Björn Gustavsson
2015-12-07Merge branch 'maint'Björn Gustavsson
* maint: Correct rand:export_seed/0 when there is no prior seed
2015-12-07Merge branch 'bjorn/stdlib/rand-export_seed/OTP-13162' into maintBjörn Gustavsson
* bjorn/stdlib/rand-export_seed/OTP-13162: Correct rand:export_seed/0 when there is no prior seed
2015-12-07Correct rand:export_seed/0 when there is no prior seedBjörn Gustavsson
According to the documentation, rand:export_seed/0 should return 'undefined' if the seed has not been intialized. However, it will create and return a seed. That means that the following code will not work as expected: case rand:export_seed() of undefined -> rand:seen({1,2,3}); _ -> ok end, rand:uniform(Range)
2015-12-07Merge branch 'maint'Hans Bolinder
* maint: doc: Fix some minor issues in Types and Function Specifications erts: Remove CDATA from The Abstract Format document erts: Correct the types section in The Abstract Format document stdlib: Correct pretty-printing of map types stdlib: Pretty-print constraints as 'V :: T' Conflicts: erts/doc/src/absform.xml
2015-12-07stdlib: Correct pretty-printing of map typesHans Bolinder
Add parentheses around annotated type union elements in map pair types. The bug was introduced in Erlang/OTP 18.0.
2015-12-07stdlib: Pretty-print constraints as 'V :: T'Hans Bolinder
Print constraints as 'V :: T' rather than 'is_subtype(V, T)'.
2015-12-04Merge branch 'maint'Björn Gustavsson
* maint: Extend erl_lint:format_error/1 to handle bittype mismatches erl_lint_SUITE: Add smoke test of format_error/1
2015-12-03Extend erl_lint:format_error/1 to handle bittype mismatchesBjörn Gustavsson
erl_lint:format_error/1 would crash with a function error if conflicting types were given. That was most easily noticed in the shell: Eshell V7.0.3 (abort with ^G) 1> <<0/integer-binary>>. *** ERROR: Shell process terminated! *** Noticed-by: Aleksei Magusev
2015-12-03erl_lint_SUITE: Add smoke test of format_error/1Björn Gustavsson
The test suite depended on the compiler to call erl_lint:format_error/1 to ensure that format_error/1 was covered. Unfortunately, though, if format_error/1 crashed the compiler would catch the exception so that the test suite would not notice it. Add a smoke test of format_error/1 that will crash if there is any problem with erl_lint:format_error/1.
2015-11-27Forbid bytes modifier for unsized part of binary generatorAleksei Magusev
This type modifier was missed in 90efeaf21147505b1e8207822e606027f94183cc.
2015-11-27Merge branch 'maint'Hans Bolinder
* maint: stdlib: Fix the shell command rp and pretty-printing
2015-11-27stdlib: Fix the shell command rp and pretty-printingHans Bolinder
The shell command 'rp' prints strings as lists of integers when pretty printing of lists is 'false'.
2015-11-20Merge branch 'maint'Zandra
2015-11-20Merge branch 'riverrun/maint' into maintZandra
* riverrun/maint: Recommend against using crypto:rand_bytes
2015-11-19Merge branch 'bjorn/cleanup'Björn Gustavsson
* bjorn/cleanup: epp: Only flatten the original filename epp: Modernize the internal data structures epp: Eliminate the Type argument from expand_macros/5 epp: Refactor user_predef/2 to share more code epp: Refactor scan_define() epp: Remove vestigial support for packages epp_SUITE: Improve coverage of epp epp_SUITE: Extend smoke and cover test of format_error/1 epp_SUITE: Add test of -extends()
2015-11-18epp: Only flatten the original filenameBjörn Gustavsson
There is no need to flatten filenames using file_name/1 every time the current filename changes. Any filename obtained from a source file will be already flattened. Only the original source filename may need flattening.
2015-11-17epp: Modernize the internal data structuresBjörn Gustavsson
Use maps instead of 'dict'. Remove the {atom,MacroName} wrappers that were used for historical reasons.
2015-11-17epp: Eliminate the Type argument from expand_macros/5Björn Gustavsson
The Type argument is always 'atom', so there is no need for the argument.
2015-11-17epp: Refactor user_predef/2 to share more codeBjörn Gustavsson
2015-11-17epp: Refactor scan_define()Björn Gustavsson
Refactor scan_define() in order to share more between macros without any arguments and macros with arguments.
2015-11-17epp: Remove vestigial support for packagesBjörn Gustavsson
Packages were removed in 34d865a7dfdb33 (R16), but the 'epp' module was forgotten.
2015-11-17epp_SUITE: Improve coverage of eppBjörn Gustavsson
2015-11-17epp_SUITE: Extend smoke and cover test of format_error/1Björn Gustavsson
30a4adb7 added smoke and cover test of format_error/1, but did not catch calls that went through check/2.
2015-11-16epp_SUITE: Add test of -extends()Björn Gustavsson
2015-11-16Merge branch 'sverk/binary-split-bug'Sverker Eriksson
* sverk/binary-split-bug: stdlib: Fix bug in binary:split for empty binary
2015-11-13stdlib: Fix bug in binary:split for empty binarySverker Eriksson
Bug introduced om master branch at b93e9b611056828a and reported in ERL-43.
2015-11-09io: Make a fast code path for i/o requestsBjörn Gustavsson
Unicode support was introduced in R13. The backward compatible code path in 'io' is unlikely to be used in practice. Therefore, make sure that the common case of an i/o server supporting unicode requests is as fast as possible, making sure to get rid of the mathing and re-building of tuples in the current code. Make the backward compatible code path work with a minimum of code.
2015-11-09Merge branch 'maint'Björn-Egil Dahlberg
2015-11-06Recommend against using crypto:rand_bytesDavid Whitlock
2015-11-04Merge branch 'sverk/binary_split_bif'Sverker Eriksson
OTP-13082 * sverk/binary_split_bif: erts: Minor refactor for binary find BIF backend erts: Refactor BIF for binary:match,matches,split erts: Refactor backend of binary:split erts: Replace 0 with THE_NON_VALUE stdlib: Add BIF option 'trim_all' to binary:split/3 stdlib: Add BIF binary:split/2 and binary:split/3 Conflicts: bootstrap/lib/stdlib/ebin/binary.beam
2015-11-04Fix typos and grammarDerek Brown
2015-11-04stdlib: Add BIF binary:split/2 and binary:split/3Andrew Bennett
2015-11-04Merge branch 'maint'Hans Bolinder
* maint: [erl_docgen] Correct documentation [dialyzer] Correct documentation [hipe] Correct documentation [test_server] Correct documentation [tools] Correct documentation [erts] Correct documentation [stdlib] Correct documentation [kernel] Correct documentation Conflicts: lib/stdlib/doc/src/erl_scan.xml
2015-11-04[stdlib] Correct documentationHans Bolinder
Fix mistakes found by 'xmllint'.
2015-11-03Merge branch 'maint'Henrik Nord
2015-11-03Fix spelling error in "characters_to_list"Gary Coulbourne
2015-10-30Merge branch 'bjorn/cuddle-with-tests'Björn Gustavsson
* bjorn/cuddle-with-tests: epp_SUITE: Avoid hard-coding list of macros more than once epp_SUITE: Add smoke and coverage test of format_error/1
2015-10-30Merge branch 'maint'Björn Gustavsson
* maint: beam_lib: Document all_chunks/1 and build_module/1
2015-10-29epp_SUITE: Avoid hard-coding list of macros more than onceBjörn Gustavsson
2015-10-29epp_SUITE: Add smoke and coverage test of format_error/1Björn Gustavsson
2015-10-22beam_lib: Document all_chunks/1 and build_module/1Björn Gustavsson
beam_lib:all_chunks/1 and beam_lib:build_module/1 can be useful for special-purpose stripping, for example to remove the "Line" chunk.
2015-10-13Merge branch 'maint'Henrik Nord
2015-10-13Fixed typo in ets documentationRiccardo
2015-10-08stdlib: Refactor the supervisor module's stateHans Bolinder
The field 'dynamics' in #state{} is a union of two opaque types, which is possibly problematic. Tagging the types should make the code safe for warnings from future versions of Dialyzer.
2015-10-08Update Kernel and STDLIBHans Bolinder
Record field types have been modified due to commit 8ce35b2: "Take out automatic insertion of 'undefined' from typed record fields".
2015-10-08Take out automatic insertion of 'undefined' from typed record fieldsKostis Sagonas
Background ----------- In record fields with a type declaration but without an initializer, the Erlang parser inserted automatically the singleton type 'undefined' to the list of declared types, if that value was not present there. I.e. the record declaration: -record(rec, {f1 :: float(), f2 = 42 :: integer(), f3 :: some_mod:some_typ()}). was translated by the parser to: -record(rec, {f1 :: float() | 'undefined', f2 = 42 :: integer(), f3 :: some_mod:some_typ() | 'undefined'}). The rationale for this was that creation of a "dummy" #rec{} record should not result in a warning from dialyzer that e.g. the implicit initialization of the #rec.f1 field violates its type declaration. Problems --------- This seemingly innocent action has some unforeseen consequences. For starters, there is no way for programmers to declare that e.g. only floats make sense for the f1 field of #rec{} records when there is no `obvious' default initializer for this field. (This also affects tools like PropEr that use these declarations produced by the Erlang parser to generate random instances of records for testing purposes.) It also means that dialyzer does not warn if e.g. an is_atom/1 test or something more exotic like an atom_to_list/1 call is performed on the value of the f1 field. Similarly, there is no way to extend dialyzer to warn if it finds record constructions where f1 is not initialized to some float. Last but not least, it is semantically problematic when the type of the field is an opaque type: creating a union of an opaque and a structured type is very problematic for analysis because it fundamentally breaks the opacity of the term at that point. Change ------- To solve these problems the parser will not automatically insert the 'undefined' value anymore; instead the user has the option to choose the places where this value makes sense (for the field) and where it does not and insert the | 'undefined' there manually. Consequences of this change ---------------------------- This change means that dialyzer will issue a warning for all places where records with uninitialized fields are created and those fields have a declared type that is incompatible with 'undefined' (e.g. float()). This warning can be suppressed easily by adding | 'undefined' to the type of this field. This also adds documentation that the user really intends to create records where this field is uninitialized.
2015-10-08Merge branch 'maint'Zandra