From e5d4b0bddc75eda1ad3445d7164171c0a6e8bbf6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Fri, 5 Feb 2010 08:33:57 +0000 Subject: OTP-8404: Doc: some corrections and improvements in STDLIB --- lib/compiler/doc/src/compile.xml | 2 +- lib/stdlib/doc/src/epp.xml | 26 ++++++++++++-------------- lib/stdlib/doc/src/erl_lint.xml | 8 ++++---- lib/stdlib/doc/src/erl_parse.xml | 26 ++++++++++++-------------- lib/stdlib/doc/src/file_sorter.xml | 14 ++++++++------ lib/stdlib/doc/src/gb_sets.xml | 8 +++++--- lib/stdlib/doc/src/gb_trees.xml | 8 +++++--- lib/stdlib/doc/src/io.xml | 2 +- lib/stdlib/doc/src/lists.xml | 17 +++++++++-------- lib/stdlib/doc/src/proplists.xml | 9 ++++++--- lib/stdlib/doc/src/sofs.xml | 17 ++++++++++++----- 11 files changed, 75 insertions(+), 62 deletions(-) diff --git a/lib/compiler/doc/src/compile.xml b/lib/compiler/doc/src/compile.xml index daa686bc56..bbd3f1043d 100644 --- a/lib/compiler/doc/src/compile.xml +++ b/lib/compiler/doc/src/compile.xml @@ -732,7 +732,7 @@ pi() -> 3.1416.

A string describing the error is obtained with the following call:

-apply(Module, format_error, ErrorDescriptor) +Module:format_error(ErrorDescriptor) diff --git a/lib/stdlib/doc/src/epp.xml b/lib/stdlib/doc/src/epp.xml index 455d9dc124..e6b48b270a 100644 --- a/lib/stdlib/doc/src/epp.xml +++ b/lib/stdlib/doc/src/epp.xml @@ -4,23 +4,21 @@
- 1996 - 2007 - Ericsson AB, All Rights Reserved + 19962010 + Ericsson AB. All Rights Reserved. - The contents of this file are subject to the Erlang Public License, - Version 1.1, (the "License"); you may not use this file except in - compliance with the License. You should have received a copy of the - Erlang Public License along with this software. If not, it can be - retrieved online at http://www.erlang.org/. + The contents of this file are subject to the Erlang Public License, + Version 1.1, (the "License"); you may not use this file except in + compliance with the License. You should have received a copy of the + Erlang Public License along with this software. If not, it can be + retrieved online at http://www.erlang.org/. - Software distributed under the License is distributed on an "AS IS" - basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See - the License for the specific language governing rights and limitations - under the License. + Software distributed under the License is distributed on an "AS IS" + basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See + the License for the specific language governing rights and limitations + under the License. - The Initial Developer of the Original Code is Ericsson AB. epp @@ -112,7 +110,7 @@

A string which describes the error is obtained with the following call:

-apply(Module, format_error, ErrorDescriptor) + Module:format_error(ErrorDescriptor)
diff --git a/lib/stdlib/doc/src/erl_lint.xml b/lib/stdlib/doc/src/erl_lint.xml index e339f484cc..6a7d37765c 100644 --- a/lib/stdlib/doc/src/erl_lint.xml +++ b/lib/stdlib/doc/src/erl_lint.xml @@ -4,7 +4,7 @@
- 19962009 + 19962010 Ericsson AB. All Rights Reserved. @@ -13,12 +13,12 @@ compliance with the License. You should have received a copy of the Erlang Public License along with this software. If not, it can be retrieved online at http://www.erlang.org/. - + Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License. - + erl_lint @@ -147,7 +147,7 @@

A string which describes the error is obtained with the following call:

-apply(Module, format_error, ErrorDescriptor) + Module:format_error(ErrorDescriptor)
diff --git a/lib/stdlib/doc/src/erl_parse.xml b/lib/stdlib/doc/src/erl_parse.xml index 739fde7a40..ae8a8afd5c 100644 --- a/lib/stdlib/doc/src/erl_parse.xml +++ b/lib/stdlib/doc/src/erl_parse.xml @@ -4,23 +4,21 @@
- 1996 - 2007 - Ericsson AB, All Rights Reserved + 19962010 + Ericsson AB. All Rights Reserved. - The contents of this file are subject to the Erlang Public License, - Version 1.1, (the "License"); you may not use this file except in - compliance with the License. You should have received a copy of the - Erlang Public License along with this software. If not, it can be - retrieved online at http://www.erlang.org/. + The contents of this file are subject to the Erlang Public License, + Version 1.1, (the "License"); you may not use this file except in + compliance with the License. You should have received a copy of the + Erlang Public License along with this software. If not, it can be + retrieved online at http://www.erlang.org/. - Software distributed under the License is distributed on an "AS IS" - basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See - the License for the specific language governing rights and limitations - under the License. + Software distributed under the License is distributed on an "AS IS" + basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See + the License for the specific language governing rights and limitations + under the License. - The Initial Developer of the Original Code is Ericsson AB. erl_parse @@ -188,7 +186,7 @@

A string which describes the error is obtained with the following call:

-apply(Module, format_error, ErrorDescriptor) + Module:format_error(ErrorDescriptor)
diff --git a/lib/stdlib/doc/src/file_sorter.xml b/lib/stdlib/doc/src/file_sorter.xml index b3f4da294c..ccb32659a0 100644 --- a/lib/stdlib/doc/src/file_sorter.xml +++ b/lib/stdlib/doc/src/file_sorter.xml @@ -4,7 +4,7 @@
- 20012009 + 20012010 Ericsson AB. All Rights Reserved. @@ -13,12 +13,12 @@ compliance with the License. You should have received a copy of the Erlang Public License along with this software. If not, it can be retrieved online at http://www.erlang.org/. - + Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License. - + file_sorter @@ -83,13 +83,15 @@ An ordering function is antisymmetric, transitive and total. Fun(A, B) should return true if A comes before B in the ordering, false otherwise. + An example of a typical ordering function is less than or equal + to, =</2. Using an ordering function will slow down the sort considerably. The keysort, keymerge and keycheck functions do not accept ordering functions. {unique, bool()}. When sorting or merging files, - only the first of a sequence of terms that compare equal is - output if this option is set to true. The default + only the first of a sequence of terms that compare equal (==) + is output if this option is set to true. The default value is false which implies that all terms that compare equal are output. When checking files for sortedness, a check that no pair of consecutive terms @@ -301,7 +303,7 @@ Value = Term

Sorts tuples on files. The sort is performed on the element(s) mentioned in KeyPos. If two tuples - compare equal on one element, next element according to + compare equal (==) on one element, next element according to KeyPos is compared. The sort is stable.

keysort(N, FileName) is equivalent to diff --git a/lib/stdlib/doc/src/gb_sets.xml b/lib/stdlib/doc/src/gb_sets.xml index accec623b9..60d8bcbfa3 100644 --- a/lib/stdlib/doc/src/gb_sets.xml +++ b/lib/stdlib/doc/src/gb_sets.xml @@ -4,7 +4,7 @@

- 20012009 + 20012010 Ericsson AB. All Rights Reserved. @@ -13,12 +13,12 @@ compliance with the License. You should have received a copy of the Erlang Public License along with this software. If not, it can be retrieved online at http://www.erlang.org/. - + Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License. - + gb_sets @@ -34,6 +34,8 @@ General Balanced Trees. This can be much more efficient than using ordered lists, for larger sets, but depends on the application.

+

This module considers two elements as different if and only if + they do not compare equal (==).

diff --git a/lib/stdlib/doc/src/gb_trees.xml b/lib/stdlib/doc/src/gb_trees.xml index 2bf18138c0..94f40c28bd 100644 --- a/lib/stdlib/doc/src/gb_trees.xml +++ b/lib/stdlib/doc/src/gb_trees.xml @@ -4,7 +4,7 @@
- 20012009 + 20012010 Ericsson AB. All Rights Reserved. @@ -13,12 +13,12 @@ compliance with the License. You should have received a copy of the Erlang Public License along with this software. If not, it can be retrieved online at http://www.erlang.org/. - + Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License. - + gb_trees @@ -34,6 +34,8 @@ Balanced Trees. These have no storage overhead compared to unbalanced binary trees, and their performance is in general better than AVL trees.

+

This module considers two keys as different if and only if + they do not compare equal (==).

diff --git a/lib/stdlib/doc/src/io.xml b/lib/stdlib/doc/src/io.xml index 6f9d979c9a..efbb1fc078 100644 --- a/lib/stdlib/doc/src/io.xml +++ b/lib/stdlib/doc/src/io.xml @@ -1021,7 +1021,7 @@ Error: error 11

A string which describes the error is obtained with the following call:

-apply(Module, format_error, ErrorDescriptor) +Module:format_error(ErrorDescriptor)
diff --git a/lib/stdlib/doc/src/lists.xml b/lib/stdlib/doc/src/lists.xml index 39fc05420d..855a7e0244 100644 --- a/lib/stdlib/doc/src/lists.xml +++ b/lib/stdlib/doc/src/lists.xml @@ -4,7 +4,7 @@
- 19962009 + 19962010 Ericsson AB. All Rights Reserved. @@ -13,12 +13,12 @@ compliance with the License. You should have received a copy of the Erlang Public License along with this software. If not, it can be retrieved online at http://www.erlang.org/. - + Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License. - + lists @@ -30,15 +30,16 @@ lists List Processing Functions -

This module contains functions for list processing. The functions - are organized in two groups: those in the first group perform a - particular operation on one or more lists, whereas those in the - second group are higher-order functions, using a fun as argument - to perform an operation on one list.

+

This module contains functions for list processing.

+

Unless otherwise stated, all functions assume that position numbering starts at 1. That is, the first element of a list is at position 1.

+

Two terms T1 and T2 compare equal if + T1 == T2 evaluates to true. They match + if T1 =:= T2 evaluates to true.

+

Whenever an ordering function F is expected as argument, it is assumed that the diff --git a/lib/stdlib/doc/src/proplists.xml b/lib/stdlib/doc/src/proplists.xml index a218dcf1fe..9f1c5b24ad 100644 --- a/lib/stdlib/doc/src/proplists.xml +++ b/lib/stdlib/doc/src/proplists.xml @@ -4,7 +4,7 @@

- 20022009 + 20022010 Ericsson AB. All Rights Reserved. @@ -13,12 +13,12 @@ compliance with the License. You should have received a copy of the Erlang Public License along with this software. If not, it can be retrieved online at http://www.erlang.org/. - + Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License. - + proplists @@ -44,6 +44,9 @@ such as options passed to a function where a user may specify options overriding the default settings, object properties, annotations, etc.

+

Two keys are considered equal if they match (=:=). In other + words, numbers are compared literally rather than by value, so that, + for instance, 1 and 1.0 are different keys.

diff --git a/lib/stdlib/doc/src/sofs.xml b/lib/stdlib/doc/src/sofs.xml index ac434ec5b7..8c8ae51262 100644 --- a/lib/stdlib/doc/src/sofs.xml +++ b/lib/stdlib/doc/src/sofs.xml @@ -4,7 +4,7 @@
- 20012009 + 20012010 Ericsson AB. All Rights Reserved. @@ -13,12 +13,12 @@ compliance with the License. You should have received a copy of the Erlang Public License along with this software. If not, it can be retrieved online at http://www.erlang.org/. - + Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License. - + sofs @@ -311,7 +311,7 @@ applying Fun to the type of the given set), and that Fun does nothing but selecting, duplicating or rearranging parts of the elements. Specifying a SetFun as an integer I is equivalent to - specifying {external, fun(X) -> element(I, X)}, + specifying {external, fun(X) -> element(I, X) end}, but is to be preferred since it makes it possible to handle this case even more efficiently. Examples of SetFuns:

@@ -336,6 +336,7 @@ fun(S) -> sofs:partition(1, S) end
       badarg, bad_function, or type_mismatch
       message when given badly formed arguments or sets the types of
       which are not compatible.

+

When comparing external sets the operator ==/2 is used.

Types

 anyset() = - an unordered, ordered or atomic set -
@@ -1108,7 +1109,13 @@ type() = - a type - 

Returns true if the AnySet1 and AnySet2 are equal, false - otherwise.

+ otherwise. This example shows that ==/2 is used when + comparing sets for equality:

+
+1> S1 = sofs:set([1.0]),
+S2 = sofs:set([1]),
+sofs:is_equal(S1, S2).
+true
-- cgit v1.2.3