aboutsummaryrefslogtreecommitdiffstats
path: root/lib/stdlib
AgeCommit message (Collapse)Author
2013-02-13Clean up and simplify the inner matching loopBjörn Gustavsson
Use list comprehensions and 'orelse' to make the code more concise. Rename wildcard_5/2 to match_part/2 to make it clearer what it does. If the pattern always matches, don't test it in every iteration of the loop.
2013-02-13Only sort the result list once, just before returningBjörn Gustavsson
There does not seem to be any advantage of sorting the result of file:list_dir/1 directly. Disadvantages are that we'll need to be careful to keep the result sorted, and that we could waste time sorting filenames that the pattern matching will discard anyway.
2013-02-13Replace filename:join/2 with '++'Björn Gustavsson
Under controlled circumstances (and we are in control of the circumstances), filename:join/2 can be replaced with '++'. '++' is faster because it is implmented in C, does not need to look at the list elements it copies, and does not need to copy its right operand.
2013-02-13Rethink the filelib:wildcard() functionsBjörn Gustavsson
Commit 70b5e24c9498225fadc08d19503269c8aad851bf broke filelib:wildcard(Pattern, "."). Over the years, the logic for filelib:wilcard() has become a mess of special cases. Probably because of premature optimization, filelib:wildcard(Pattern) and filelib:wildcard(Pattern, Cwd) are handled differently. They can be consolidated if we use a "." as the default Cwd argument. We can also simplify things by compiling the Cwd argument into the wildcard. We did not that in the initial implementation because it used to be possible to pre-compile a wildcard and pass it to filelib:wildcard/{1,2}. Since that is no longer possible, there is no point in keeping the compiled wildcard "portable" (not dependent on the Cwd argument).
2013-02-13Don't redefine error/1Björn Gustavsson
It is confusing. Rename our own exception-generating function to badpattern/1.
2013-02-13Don't allow binaries as the Cwd argument for filelib:wildcard()Björn Gustavsson
filelib:wildcard() will no longer support "raw filenames", so it makes no sense for it to accept a binary Cwd argument.
2013-02-13Don't handle binaries from file:list_dir/1Björn Gustavsson
In R16B, file:list_dir/1 will never return binaries.
2013-02-13Strengthen test suiteBjörn Gustavsson
2013-02-13Make the file:filename() type more restrictiveBjörn Gustavsson
The recommended type for filenames is a list of characters (which may be Unicode characters greater than 255). Change the file:filename() to reflect that. For the filename module we still need a type that can be either a string or a binary, so we need to introduce the type file:filename_all().
2013-02-12c: Remove handling of binaries in return from file:list_dir/1Björn Gustavsson
file:list_dir/1 will no longer return binaries.
2013-02-11[stdlib] Fix a bug concerning pretty printing and UnicodeHans Bolinder
Binaries were pretty printed too often.
2013-02-11Make Unicode correctionsHans Bolinder
2013-02-11Merge branch 'bjorn/remove-tuple-funs/OTP-10170'Björn Gustavsson
* bjorn/remove-tuple-funs/OTP-10170: erl_eval: Don't allow evaluation of {M,F} in the shell
2013-02-10erl_eval: Don't allow evaluation of {M,F} in the shellBjörn Gustavsson
Tuples funs were removed in de7e01c958ff7c9e6da4034a53567a30a4ae5792, but it was still possible to evaluate tuple funs in the shell.
2013-02-10[stdlib] Remove the undocumented 'unicode' option from the scannerHans Bolinder
2013-02-08stdlib: Try fix fluctuating test cases in ets_SUITESverker Eriksson
by removing slave node creation and instead create remote pids, ports and refs synthetically using binary_to_term. Memory leak checks were sometimes failing due to mutating system ETS tables caused by slave node communication.
2013-02-07[stdlib] Fix a bug that could cause the Erlang shell to loopHans Bolinder
2013-02-07[stdlib] Fix bugs in eval_bitsHans Bolinder
Unicode related.
2013-02-06Merge branch 'bjorn/stdlib/erl_lint-coverage'Björn Gustavsson
* bjorn/stdlib/erl_lint-coverage: Test calling deprecated or removed functions Test deprecating list_to_atom/1 to cover more code Cover binary syntax errors and warnings Remove unused error message {bittype_mismatch,_,_,_} Remove unused error message for importing an auto-imported BIF Remove the error message for future reserved keyword Test a few more kinds of illegal guard expressions Remove error handling for calling a BIF that is not auto-imported Provoke basic semantic errors to improve test coverage
2013-02-04Update version numbersBjörn-Egil Dahlberg
2013-01-31Test calling deprecated or removed functionsBjörn Gustavsson
2013-01-31Test deprecating list_to_atom/1 to cover more codeBjörn Gustavsson
2013-01-31Cover binary syntax errors and warningsBjörn Gustavsson
2013-01-31Remove unused error message {bittype_mismatch,_,_,_}Björn Gustavsson
2013-01-31Remove unused error message for importing an auto-imported BIFBjörn Gustavsson
2013-01-31Remove the error message for future reserved keywordBjörn Gustavsson
There are currently no keywords reserved for the future.
2013-01-31Test a few more kinds of illegal guard expressionsBjörn Gustavsson
2013-01-31Remove error handling for calling a BIF that is not auto-importedBjörn Gustavsson
All guards BIFs are auto-imported. That can be verified like this: [] = [{F,A} || {erlang,F,A} <- erlang:system_info(snifs), erl_internal:guard_bif(F, A), not erl_internal:bif(F, A)] Therefore, calling a guard BIF in a guard without a module name is always allowed (provided that there is not a local function or an import with the same name), and therefore we can remove the error reporting code. But keep an assertion so that we will find out if any non-auto-imported guard BIFs are added in the future.
2013-01-31Provoke basic semantic errors to improve test coverageBjörn Gustavsson
2013-01-29Prepare releaseOTP_R16A_RELEASE_CANDIDATEErlang/OTP
2013-01-28Merge branch 'sverk/ets-write_concurrency-locks'Sverker Eriksson
* sverk/ets-write_concurrency-locks: erts,stdlib: Increase number of locks for write_concurrency OTP-10787
2013-01-26Merge branch 'bjorn/remove-tuple-funs/OTP-10170'Björn Gustavsson
* bjorn/remove-tuple-funs/OTP-10170: erl_lint: Removes vestiges of tuple fun support
2013-01-26Merge branch 'bjorn/remove-packages/OTP-10348'Björn Gustavsson
* bjorn/remove-packages/OTP-10348: erl_lint: Remove vestiges of package support shell: Remove vestiges of package support
2013-01-25Update copyright yearsBjörn-Egil Dahlberg
2013-01-25Merge branch 'hb/stdlib/fix_qlc_suite/OTP-10771'Hans Bolinder
* hb/stdlib/fix_qlc_suite/OTP-10771: [stdlib] Fix minor issue with qlc_SUITE
2013-01-25erl_lint: Remove vestiges of package supportBjörn Gustavsson
1c1649481025236cad29a7ee3cbd8f552757b2b6 dropped support for packages in erl_lint, but did not remove the error message for {bad_module_name,M}.
2013-01-25shell: Remove vestiges of package supportBjörn Gustavsson
Remove the which/1 command which provides no useful information for a non-package module. Remove references to the deleted commands import/1, import_all/1, use/1, and use_all/1 (removed in f31ee362c3421922518). Remove code that handles {module,_} in bindings.
2013-01-25erl_lint: Removes vestiges of tuple fun supportBjörn Gustavsson
The warnings for deprecated tuple funs were removed in de7e01c958ff7c9e6da4034a53567a30a4ae5792.
2013-01-25[stdlib] Remove documentation of ~tpHans Bolinder
There seems to be a need for a more elaborate solution when it comes to recognizing printable Unicode characters. The ~tp syntax is experimental, and may be removed in R16B.
2013-01-25Remove one use of iolist_size/1 in io_lib_pretty.erlHans Bolinder
In order to simplify the testing of Unicode atoms a minor adjustment has been made in io_lib_pretty. Unicode atoms will not be introduced until R18 but it may come in handy to be able to pretty-print such atoms in R16. This update affects ~p only; ~w already works.
2013-01-25Add a new function proc_lib:format/2 which takes encodingHans Bolinder
2013-01-25Export the type erl_scan:token()Hans Bolinder
The type erl_parse:token() used to be a two-tuple, but it can also be a three-tuple.
2013-01-25Make adjustments for UnicodeHans Bolinder
2013-01-25[stdlib] Change default of erl_scan's unicode optionHans Bolinder
The value of the undocumented unicode option is very limited. The option will most likely be removed completely soon.
2013-01-25Correct recently introduced Unicode related type errorsHans Bolinder
2013-01-25[stdlib] Introduce new functions epp:read_encoding_from_binary/1,2Hans Bolinder
2013-01-25Extend char() to Unicode charactersHans Bolinder
The code related to the introduction of unicode_string() and unicode_char() has been removed. The types char() and string() have been extended to include Unicode characters. In fact char() was changed some time ago; this commit is about cleaning up the documentation and introduce better names for some functions.
2013-01-25[stdlib] Fix a contract bugHans Bolinder
Also minor corrections of the docs of io(3)
2013-01-25[stdlib] Update the Unicode examples in STDLIB User's GuideHans Bolinder
2013-01-25[stdlib] Remove documentation of Unicode functions in io_libHans Bolinder
The documentation of some Unicode functions in io_lib was committed by mistake.