aboutsummaryrefslogtreecommitdiffstats
path: root/lib/stdlib
AgeCommit message (Collapse)Author
2010-04-23Merge branch 'ta/nested-records' into devErlang/OTP
* ta/nested-records: Document R14 paren-less record access/update Support nested record field access without parentheses OTP-8597 ta/nested-records Nested records can now be accessed without parenthesis. See the Reference Manual for examples. (Thanks to YAMASHINA Hio and Tuncer Ayaz.)
2010-04-21Merge branch 'ms/re_infinite_loop' into devErlang/OTP
* ms/re_infinite_loop: Add testcase for infinite loop problem caused by reset of match_call_count re: Fix non-termination for a certain regular expression OTP-8589 Pcre may hang on a special regexp A bug in re that could cause certain regular expression matches never to terminate is corrected. (Thanks to Michael Santos and Gordon Guthrie.)
2010-04-21Removed deprecated functions and moduleNiclas Eklund
2010-04-20Support nested record field access without parenthesesTuncer Ayaz
Original patch from YAMASHINA Hio posted to erlang-patches@ on Tue Jun 12 11:27:53 CEST 2007: http://www.erlang.org/pipermail/erlang-patches/2007-June/000182.html http://fleur.hio.jp/pub/erlang/record2.patch Only had to do minor changes to port the patch to the current R14A development tree. Also added compiler/record_SUITE:nested_access/2 to test nested record access with or without parentheses. With this change the following will work. -record(nrec0, {name = <<"nested0">>}). -record(nrec1, {name = <<"nested1">>, nrec0=#nrec0{}}). -record(nrec2, {name = <<"nested2">>, nrec1=#nrec1{}}). nested_access() -> N0 = #nrec0{}, N1 = #nrec1{}, N2 = #nrec2{}, <<"nested0">> = N0#nrec0.name, <<"nested1">> = N1#nrec1.name, <<"nested2">> = N2#nrec2.name, <<"nested0">> = N1#nrec1.nrec0#nrec0.name, <<"nested0">> = N2#nrec2.nrec1#nrec1.nrec0#nrec0.name, <<"nested1">> = N2#nrec2.nrec1#nrec1.name, <<"nested0">> = ((N2#nrec2.nrec1)#nrec1.nrec0)#nrec0.name, N1a = N2#nrec2.nrec1#nrec1{name = <<"nested1a">>}, <<"nested1a">> = N1a#nrec1.name, N2a = N2#nrec2.nrec1#nrec1.nrec0#nrec0{name = <<"nested0a">>}, N2b = ((N2#nrec2.nrec1)#nrec1.nrec0)#nrec0{name = <<"nested0a">>}, <<"nested0a">> = N2a#nrec0.name, N2a = N2b, ok. Signed-off-by: Tuncer Ayaz <[email protected]>
2010-04-20Add testcase for infinite loop problem caused by reset of match_call_countPatrik Nyblom
2010-04-19Merge branch 'bg/deprecations' into devErlang/OTP
* bg/deprecations: test suites: Remove incidental use of deprecated concat_binary/1 Postpone removal of concat_binary/1 Remove deprecated lists:flat_length/1 OTP-8584 bg/deprecations
2010-04-19OTP-8567 The word 'spec' is no longer reserved.Hans Bolinder
The function erl_scan:reserved_word/1 no longer returns true when given the word spec. This bug was introduced in STDLIB-1.15.3 (R12B-3).
2010-04-15Merge branch 'ms/pcre-compile-workspace-overrun' into devErlang/OTP
* ms/pcre-compile-workspace-overrun: re_SUITE: Add pcre_compile_workspace_overflow/1 MacOS X: Boost default stack size Fix check for compile workspace overflow OTP-8539 ms/pcre-compile-workspace-overrun
2010-04-14Fix spec for ets:to_dets/2Kostis Sagonas
2010-04-14Merge branch 'ks/stdlib' into devErlang/OTP
* ks/stdlib: erl_parse.yrl: Add missing operator in type declaration stdlib: Add types and specs stdlib: Use fun object instead of {M,F} tuple ets: Cleanup as suggested by tidier OTP-8576 ks/stdlib
2010-04-14re_SUITE: Add pcre_compile_workspace_overflow/1Björn Gustavsson
2010-04-13ets docs: Correct return type for ets:to_dets/2Björn Gustavsson
2010-04-13erl_parse.yrl: Add missing operator in type declarationKostis Sagonas
2010-04-13stdlib: Add types and specsKostis Sagonas
2010-04-13stdlib: Use fun object instead of {M,F} tupleKostis Sagonas
2010-04-13ets: Cleanup as suggested by tidierKostis Sagonas
2010-04-09OTP-8562 Closing right parenthesis in macro definitions is mandatory.Hans Bolinder
When defining macros the closing right parenthesis before the dot is now mandatory.
2010-04-08Postpone removal of concat_binary/1Björn Gustavsson
concat_binary/1 has long been documented as not recommended, but was formally deprecated as late as in R13B04. Since that gives very little time to notice and act on the deprecation, postpone the removal to R15.
2010-04-08Remove deprecated lists:flat_length/1Björn Gustavsson
Remove lists:flat_length/1 which has never been documented or supported. It has been deprecated since R13A.
2010-03-30erl_parse: Remove more stray 'cond' supportBjörn Gustavsson
Unfortunately, commit 1e2ecf8c492b6d499880b8676e3c1fe0c5793103 removed all cond support except for two lines.
2010-03-26Fix spelling: "loose" is not a verbMagnus Henoch
"Lose" means not "not win", but "loose" means "not tight". Change "loose" to "lose" where appropriate.
2010-03-17OTP-8522 Avoid duplicated 'undefined' in record field typesHans Bolinder
The Erlang parser no longer duplicates the singleton type undefined in the type of record fields without initial value.
2010-03-17Merge branch 'hawk/escript-add-create-and-extract' into devErlang/OTP
* hawk/escript-add-create-and-extract: Add type info for record fields Remove the undocumented function escript:foldl/3 Make reltool independent of the function escript:foldl/3 Add functions to create and extract escripts Add function zip:foldl/3 to iterate over zip archives OTP-8521 hawk/escript-add-create-and-extract Added function zip:foldl/3 to iterate over zip archives. Added functions to create and extract escripts. See escript:create/2 and escript:extract/2. The undocumented function escript:foldl/3 has been removed. The same functionality can be achieved with the more flexible functions escript:extract/2 and zip:foldl/3. Record fields has been annotated with type info. Source files as been adapted to fit within 80 chars and trailing whitespace hasd been removed.
2010-03-16Remove the undocumented function escript:foldl/3Håkan Mattsson
It is possible to obtain the same effect with the functions escript:extract/2 and zip:fold/3. See escript_SUITE:escript_foldl/3 for a complete emulation of the old escript:foldl/3 function.
2010-03-16Add functions to create and extract escriptsHåkan Mattsson
Both reltool and rebar needs to parse escripts. They are currently using an undocumented function called escript:foldl/3. It folds a function over all files in the body of an escript. If the body contains source code the function compiles it and the gives debug compiled beam code to the fold fun. If the body is an archive the fun is applied for all files in the archive. Instead of making the undocumented function public, the new functions escript:create/2 and escript:extract/2 has been introduced. Together with the new zip:foldl/3 function they have the same functionality as escript:foldl/3 in a more flexible and generic way. escript:foldl/3 should be removed as soon as reltool and rebar has been adopted to use the new functions. The simplest way for reltool and rebar to do this is to just copy the code from escript_SUITE:escript_foldl/3, which happens to provide a future compatible implementation of an emulated escript:foldl/3 function. I was quite hesitant when I introduced the compile_source option. It feels that it does not belong there but the alternative felt worse. The rationale for the compile_source option is that it is a bit cumbersome to compile the source code, as the source in most cases is partial. In order to do compile the source you need to know about some internals in escript. Without compile_source I think that these internals should be documented. Further you need to duplicate parts of the code. Without the compile_source option you need to first parse the source to forms, using an undocumented function in epp with an extended format of predefined macros which also is undocumented. Then you need to investigate the forms to see if you need to add an export form for main. When that is done you can run the rest of the compiler passes as usual. It is not so much code (60 lines or so) to write, but I do not want to urge people to write it. I actually wrote the code (see escript_SUITE:escript_foldl/3) before I decided to introduce the compile_source option.
2010-03-16Add function zip:foldl/3 to iterate over zip archivesHåkan Mattsson
This is the public interface of prim_zip:open/3, which has been used in earlier releases by both erl_prim_loader and escript. The new function can be used as a replacement for the undocumented function escript:foldl/3 that is likely to be removed without further notice. The error handling of prim_zip:open/3 (and prim_zip:foldl/3) has been improved in order to better suite a public interface. For example it could happen that a file or a zlib port could be left open in some errors cases. The documentation of the FileSpec parameter to zip:create/3 has been updated to show that file info can be explicitly specified. A FileSpec may contain {Filename, binary(), #file_info{}} elements. The function zip:create/3 was already prepared to partly support this, but now after a few minor fixes it is fully supported.
2010-03-16Merge branch 'ml/documentation_apostrophe_fix' into devErlang/OTP
* ml/documentation_apostrophe_fix: Correct grammatical problems in conjunction with 'its' Change all incorrect occurrences of it's to its OTP-8523 ml/documentation_apostrophe_fix
2010-03-16Change all incorrect occurrences of it's to itsMatthias Lang
The documentation (*.xml) in the otp tree has a common grammatical problem, "it's" and "its" are often interchanged. That is annoying for some readers. This commit consists entirely of "it's" -> "its" changes. I went through every .xml file in the tree. If there are any remaining bugs of this type, it's because I missed them, not because I didn't look.
2010-03-16Remove stray code supporting 'cond'Björn Gustavsson
'cond' is an experimental feature that was never completed.
2010-03-16Remove stray code supporting constant/1Björn Gustavsson
The guard test constant/1 was removed in R13B.
2010-03-15Update copyright headersBjörn Gustavsson
2010-03-10Fix a crash when using an undefined record name as a typeKostis Sagonas
2010-03-09OTP-8503 stdlib: records with no fields is considered typed by eppHans Bolinder
The empty record (no fields) is now considered typed. It is more consistent than before; the base case is the logical one. A record is typed iff all its fields are typed. A record is tagged 'typed' iff it is typed.
2010-03-09OTP-8501 stdlib: erl_pp no longer quotes atoms in typesHans Bolinder
The erlang pretty printer (erl_pp) no longer quotes atoms in types.
2010-03-09Merge branch 'ks/types' into devErlang/OTP
* ks/types: file.hrl: Move out type declarations kernel: Add types and specs OTP-8494 ks/types
2010-03-07file.hrl: Move out type declarationsKostis Sagonas
Having various type declarations in the file.hrl file was once upon a time necessary since the system could not really handle remote types. Now it can and these declarations should not be there but appear in file.erl instead. This means that files that need to use these types can refer to them using a remote type reference, and not having to include file.hrl - at least not for this reason.
2010-03-02OTP-8473 stdlib: erl_pp bugfix abstract type 'fun'Hans Bolinder
The abstract type 'fun' could not be printed. This bug has been fixed.
2010-03-02OTP-8470 stdlib: epp bugHans Bolinder
The Erlang code preprocessor (epp) sent extra messages on the form {eof,Location} to the client when parsing the file attribute. This bug, introduced in R11B, has been fixed.
2010-02-24Update version for R14ARickard Green
2010-02-22Fix escript:foldl/3 for beam and archive filesTuncer Ayaz
escript:foldl/3 was not completely adapted to the changes introduced in 6af2ac91005276add18b1c9bbf4c8fe4f8c6e040. A partial fix has already been applied by Hakan Mattson in 4ec4a06edb5baaa0af2840943230c4a0be3a93cf. Signed-off-by: Tuncer Ayaz <[email protected]>
2010-02-19Update release notesBjörn-Egil Dahlberg
2010-02-15Fixed a case_clause error in the internal function escript:foldl/3.Håkan Mattsson
2010-02-12Merge branch 'bd/doc-fixes' into ccase/r13b04_devErlang/OTP
* bd/doc-fixes: Fix minor documentation errors
2010-02-12Merge branch 'ms/pcre-security' into ccase/r13b04_devErlang/OTP
* ms/pcre-security: Fix CVE-2008-2371 (outer level option with alternatives caused crash). OTP-8438 The re module: A regular expression with an option change at the start of a pattern that had top-level alternatives could cause overwriting and/or a crash. (Thanks to Michael Santos.)
2010-02-12Merge branch 'jn/supervisor_child_count_only' into ccase/r13b04_devErlang/OTP
* jn/supervisor_child_count_only: Add count_children/1 to supervisor.erl to determine the number of OTP-8436 Added supervisor:count_children/1 to count the number of children being managed without the memory impact of which_children/1. (Thanks to Jay Nelson.)
2010-02-12Merge branch 'ks/stdlib-cleanups' into ccase/r13b04_devErlang/OTP
* ks/stdlib-cleanups: stdlib: clean up as suggested by tidier OTP-8435: ks/stdlib-cleanups
2010-02-11Fix CVE-2008-2371 (outer level option with alternatives caused crash).Michael Santos
The patch is from: http://vcs.pcre.org/viewvc?revision=360&view=revision Test case: re:compile(<<"(?i)[\xc3\xa9\xc3\xbd]|[\xc3\xa9\xc3\xbdA]">>, [unicode]). An option change at the start of a pattern that had top-level alternatives could cause overwriting and/or a crash. This potential security problem was recorded as CVE-2008-2371.
2010-02-10OTP-8434 Improved handling of typed records in escriptsHåkan Mattsson
2010-02-10Add count_children/1 to supervisor.erl to determine the number ofJay Nelson
children being managed without the memory impact of which_children/1 The function which_children/1 returns a list of the child processes currently being supervised, but it has the penalty of creating a new list thereby consuming more memory. In low memory situations it is often desirable to know which supervisor may have generated many processes, but the act of discovering the culprit should not cause the node to crash (or worse a different node if the kernel kills one randomly). The new function count_children/1 can give an indication of which supervisor is taxing resources the most without adding to the burden. Rather than creating a new list, it walks the supervisor's internal children structure using an accumulator function so that any used memory can be incrementally collected yet the resulting count can still be obtained. The return result of count_children/1 is a property list of counts containing: - {specs, Total_Num_Child_Specs} - {active, Num_Active_Child_Processes_Of_Supervisor_Or_Worker_Type} - {supervisors, Num_Supervisor_Type_Children_Including_Dead_Processes} - {workers, Num_Worker_Type_Children_Including_Dead_Processes} This patch was made in response to mailing list discussions of the problem diagnosing heavily taxed production systems. I cannot find the original request, but http://www.erlang.org/cgi-bin/ezmlm-cgi/4/35060 is my original post of the patch.
2010-02-10OTP-8418 user.erl (used in oldshell) is updated to handle unicode inPatrik Nyblom
prompt strings (io:get_line/{1,2}). io_lib is also updated to format prompts with the 't' modifier (i.e. ~ts instead of ~s).