aboutsummaryrefslogtreecommitdiffstats
path: root/lib/stdlib
AgeCommit message (Collapse)Author
2017-02-09Merge pull request #1312 from richcarl/shell-smart-compileBjörn Gustavsson
Extend shell c(...) to find and recompile modules OTP-14190
2017-02-08stdlib: Improve Erlang shell's tab-completion of long namesHans Bolinder
2017-02-08Deprecate filename:find_src/1/2Richard Carlsson
2017-02-07Remove event timer optimizationRaimo Niskanen
Handle the event timer more like other timers and do not optimize the odd case of combining an event timeout with inserting custom events, wich by definition cancels the event timeout.
2017-02-07Clean up timer handlingRaimo Niskanen
2017-02-06Use magic refs for binary compile patternsRickard Green
2017-02-06Use magic refs for compiled match specsRickard Green
2017-02-06Add shell shortcut for recompiling existing modulesRichard Carlsson
This extends the shell function c/1 and c/2 so that if the argument is a module name instead of a file name, it automatically locates the .beam file and the corresponding source file, and then recompiles the module using the same compiler options (plus any options passed to c/2). If compilation fails, the old beam file is preserved. Also adds c(Mod, Opts, Filter), where the Filter argument allows you to remove old compiler options before the new options are added.
2017-02-04Add filelib:find_file/2/3 and filelib:find_source/1/2/3Richard Carlsson
This moves, extends and exports functionality that previously existed only internally in filename:find_src/1/2, adding the ability to automatically substitute file suffixes and use different rules for different suffixes.
2017-02-04Refactor filename:find_src/1Richard Carlsson
2017-02-04Fix broken test for filename:find_src/2Richard Carlsson
2017-02-03Reduce number of loop variables hence code massRaimo Niskanen
2017-02-02Make "~s" fail for Unicode atomsBjörn Gustavsson
26b59dfe67e introduced support for arbitrary Unicode characters in atoms. After that commit, it is possible to print any atom with a "~s" format string: 1> io:format("~s\n", ['спутник']). спутник Note that the same text as a string will fail: 2> io:format("~s\n", ["спутник"]). ** exception error: bad argument in function io:format/3 called as io:format(<0.53.0>,"~s\n", [[1089,1087,1091,1090,1085,1080,1082]]) Being more permissive for atoms is probably beneficial for io:format/2. However, for io_lib:format/2, the new behavior breaks this guarantee in the documentation for io_lib:format/2: If and only if the Unicode translation modifier is used in the format string (that is, ~ts or ~tc), the resulting list can contain characters beyond the ISO Latin-1 character range (that is, numbers > 255). The problem is that you can no longer be sure whether io_lib:format/2 will return an iolist that can be successfully passed to a port or iolist_to_binary/1. We see three solutions: 1. Keep the new behavior. That means that you can get non-iolist data when you use ~s for printing an atom, but a 'badarg' when printing Unicode strings. That is inconsistent, and it delays error detection if the result is passed to a port or iolist_to_binary/1. 2. Always allow Unicode characters for ~s. That would be incompatible, because ~s says that any binary is encoded in latin1, while ~ts says that any binary is encoded in UTF-8. To implement this solution, we could no longer support latin1 binaries; all binaries would have to be encoded in UTF-8. 3. Only allow ~s for atoms where all characters are less than 256. Require ~ts to print atoms such as 'спутник'. We reject solution 1 because it is slightly incompatible and is inconsistent. We reject solution 2 because it too incompatible. Therefore, this commit implements solution 3.
2017-02-02Optimize by using async cancel_timerRaimo Niskanen
2017-02-01Bugfix: callback mode not cached after code changeRaimo Niskanen
Fix lots of internal state updates just before termination that could cause crash reports confused about timers.
2017-02-01Merge branch 'josevalim/atu8-chunk/PR-1078/OTP-14178'Björn Gustavsson
* josevalim/atu8-chunk/PR-1078/OTP-14178: Add new AtU8 beam chunk
2017-01-30Add new AtU8 beam chunkJosé Valim
The new chunk stores atoms encoded in UTF-8. beam_lib has also been modified to handle the new 'utf8_atoms' attribute while the 'atoms' attribute may be a missing chunk from now on. The binary_to_atom/2 BIF can now encode any utf8 binary with up to 255 characters. The list_to_atom/1 BIF can now accept codepoints higher than 255 with up to 255 characters (thanks to Björn Gustavsson).
2017-01-30Implement repeat_state and repeat_state_and_dataRaimo Niskanen
2017-01-25Update test cases for erlang:hash/2 removalBjörn-Egil Dahlberg
2017-01-25stdlib: Produce correct warning for erlang:hash/2Björn-Egil Dahlberg
2017-01-23Correct type checking function for action {next_event,,}Raimo Niskanen
2017-01-20Change arity of type to init_result/1Raimo Niskanen
2017-01-17Merge branch 'maint'Björn-Egil Dahlberg
2017-01-17Merge branch 'egil/cuddle-tests' into maintBjörn-Egil Dahlberg
* egil/cuddle-tests: stdlib: Increase timetrap for rand_SUITE common_test: Increase timetrap for cth_hooks_SUITE compiler: Increase timetrap timeouts for lc_SUITE
2017-01-16Merge pull request #1307 from bjorng/bjorn/asn1/remove-deprecated/OTP-14146Björn Gustavsson
asn1: Remove deprecated functions OTP-14146
2017-01-13asn1: Remove deprecated functionsBjörn Gustavsson
Remove the entire asn1rt module. All functions in it were deprecated in OTP 17. In asn1ct, remove the deprecated functions asn1ct:encode/3 and asn1ct:decode/3. Also remove asn1ct:encode/2, which has not been formally deprecated but is undocumented.
2017-01-13Merge branch 'hasse/stdlib/check_type_constraints/OTP-14070/PR-1214'Hans Bolinder
* hasse/stdlib/check_type_constraints/OTP-14070/PR-1214: stdilb: Check for bad type constraints in function types
2017-01-12Merge branch 'maint'Hans Bolinder
* maint: stdlib: Correct signatures of functions in erl_parse
2017-01-12Merge pull request #1303 from bjorng/bjorn/kernel-stdlib-docBjörn Gustavsson
Kernel/STDLIB: Remove references to OTP R12B and earlier
2017-01-11gen_{server,fsm}.xml: Remove superfluous reference to R12BBjörn Gustavsson
2017-01-11ets: Remove superfluous reference to R11BBjörn Gustavsson
2017-01-10stdlib: Correct signatures of functions in erl_parseHans Bolinder
The signatures of erl_parse:anno_to_term/1 and erl_parse:anno_from_term/1 are corrected. Using these function no longer results in false Dialyzer warnings.
2017-01-10Merge branch 'maint'Hans Bolinder
* maint: stdlib: Allow characters in types and constant patterns
2017-01-10Merge branch 'hasse/stdlib/char_as_integer/ERL-313/OTP-14103' into maintHans Bolinder
* hasse/stdlib/char_as_integer/ERL-313/OTP-14103: stdlib: Allow characters in types and constant patterns
2017-01-05Merge branch 'egil/stdlib/gen_event-start-2/OTP-14123'Björn-Egil Dahlberg
* egil/stdlib/gen_event-start-2/OTP-14123: stdlib: Document gen_event start options stdlib: Test gen_event options stdlib: Refactor gen_event_SUITE stdlib: Remove whitespace error in gen_event_SUITE stdlib: Add start options to gen_event stdlib: Remove whitespace errors in gen_event
2017-01-04stdlib: Document gen_event start optionsBjörn-Egil Dahlberg
2016-12-29stdlib: Test gen_event optionsBjörn-Egil Dahlberg
2016-12-29stdlib: Refactor gen_event_SUITEBjörn-Egil Dahlberg
2016-12-21stdlib: Allow characters in types and constant patternsHans Bolinder
Characters ($char) can be used in constant pattern expressions. They can also be used in types and contracts.
2016-12-20stdlib: Remove whitespace error in gen_event_SUITEBjörn-Egil Dahlberg
2016-12-19Merge branch 'maint'Rickard Green
* maint: Remove faulty release note for these fixes New test cases testing stacktrace from apply on erlang:error() Fix stactrace for apply on error/[1,2], exit/1, or throw/1 Fix stack-trace generated by a traced process Conflicts: erts/emulator/beam/beam_emu.c erts/etc/unix/etp-commands.in
2016-12-19Merge branch 'rickard/stacktrace-bugs' into maintRickard Green
OTP-14055 * rickard/stacktrace-bugs: Remove faulty release note for these fixes New test cases testing stacktrace from apply on erlang:error() Fix stactrace for apply on error/[1,2], exit/1, or throw/1 Fix stack-trace generated by a traced process
2016-12-19Fix stactrace for apply on error/[1,2], exit/1, or throw/1Rickard Green
2016-12-19Add take/2 to all dictionary modulesBjörn Gustavsson
Similar to maps:take/2, add take/2 to the other dictionary modules in STDLIB: orddict:take(Key, Dict) -> {Val,NewDict} | 'error'. dict:take(Key, Dict) -> {Val,NewDict} | 'error'. gb_trees:take(Key, Dict) -> {Val,NewDict}. For gb_trees also add: gb_trees:take_any(Key, Dict) -> {Val,NewDict} | 'error'. gb_trees already has delete() and delete_any(), so we will follow that design pattern. Suggested by Boris Bochkaryov in https://github.com/erlang/otp/pull/1209.
2016-12-16stdlib: Add start options to gen_eventBjörn-Egil Dahlberg
* New gen_event:start/2 and gen_event:start_link/2 * Extend gen_event:start/1 and gen_event:start_link/1 to handle an option list as input. The options to gen_event are the same as to gen_server.
2016-12-16stdlib: Remove whitespace errors in gen_eventBjörn-Egil Dahlberg
2016-12-16Merge branch 'maint'Björn Gustavsson
* maint: Allow escripts with only two lines Add project-wide Emacs settings file
2016-12-16Merge pull request #1275 from pjhades/fix/escriptBjörn Gustavsson
Allow escripts with only two lines OTP-14098
2016-12-14Merge tag 'OTP-19.2'Dan Gudmundsson
=== OTP-19.2 === Changed Applications: - common_test-1.13 - compiler-7.0.3 - crypto-3.7.2 - dialyzer-3.0.3 - edoc-0.8.1 - erl_docgen-0.6.1 - erl_interface-3.9.2 - erts-8.2 - eunit-2.3.2 - hipe-3.15.3 - inets-6.3.4 - kernel-5.1.1 - mnesia-4.14.2 - observer-2.3 - odbc-2.12 - parsetools-2.1.4 - public_key-1.3 - runtime_tools-1.11 - sasl-3.0.2 - ssh-4.4 - ssl-8.1 - stdlib-3.2 - syntax_tools-2.1.1 - tools-2.9 - wx-1.8 Unchanged Applications: - asn1-4.0.4 - cosEvent-2.2.1 - cosEventDomain-1.2.1 - cosFileTransfer-1.2.1 - cosNotification-1.2.2 - cosProperty-1.2.1 - cosTime-1.2.2 - cosTransactions-1.3.2 - debugger-4.2.1 - diameter-1.12.1 - eldap-1.2.2 - et-1.6 - gs-1.6.2 - ic-4.4.2 - jinterface-1.7.1 - megaco-3.18.1 - orber-3.8.2 - os_mon-2.4.1 - otp_mibs-1.1.1 - percept-0.9 - reltool-0.7.2 - snmp-5.2.4 - typer-0.9.11 - xmerl-1.3.12 * tag 'OTP-19.2': Updated OTP version Prepare release Conflicts: OTP_VERSION
2016-12-13Allow escripts with only two linesJing Peng
The current implementation assumes that escripts all have at least three lines. But according to the escript documentation, comments on the second line and emulator flags on the third line are all optional. Thus escripts with only two lines -- shebang on the first line and code on the second line -- will not run. This commit fixes the problem by rearranging the escript header parsing logic, and recognize the escript body on the second line if the header only contains a line of shebang.