From 61b173e47e4157e784f32fc46a9867fbadc9a53a Mon Sep 17 00:00:00 2001 From: Boris 'billiob' Faure Date: Mon, 1 Nov 2010 22:11:08 +0100 Subject: fix typo in mnesia doc --- lib/mnesia/doc/src/Mnesia_chap2.xmlsrc | 6 ++---- lib/mnesia/doc/src/Mnesia_chap3.xml | 2 +- lib/mnesia/doc/src/mnesia.xml | 2 +- 3 files changed, 4 insertions(+), 6 deletions(-) (limited to 'lib') diff --git a/lib/mnesia/doc/src/Mnesia_chap2.xmlsrc b/lib/mnesia/doc/src/Mnesia_chap2.xmlsrc index 0714c7b645..f263ea4ed2 100644 --- a/lib/mnesia/doc/src/Mnesia_chap2.xmlsrc +++ b/lib/mnesia/doc/src/Mnesia_chap2.xmlsrc @@ -235,9 +235,7 @@ Starting Mnesia. -

Continuing the dialogue with the Erlang shell will produce the following - the following: -

+

Continuing the dialogue with the Erlang shell will produce the following:

 company:init().
         {atomic,ok}
@@ -418,7 +416,7 @@ In_proj
         interchangeably throughout this book. 
         

A Mnesia table is populated by Mnesia records. For example, - the tuple {boss, klacke, bjarne} is an record. The + the tuple {boss, klacke, bjarne} is a record. The second element in this tuple is the key. In order to uniquely identify a table row both the key and the table name is needed. The term object identifier, diff --git a/lib/mnesia/doc/src/Mnesia_chap3.xml b/lib/mnesia/doc/src/Mnesia_chap3.xml index 9a382bcb5a..c3e584123e 100644 --- a/lib/mnesia/doc/src/Mnesia_chap3.xml +++ b/lib/mnesia/doc/src/Mnesia_chap3.xml @@ -132,7 +132,7 @@ function changes the format on all records in table Tab. It applies the argument Fun to all records in the table. Fun shall be a function which - takes an record of the old type, and returns the record of the new + takes a record of the old type, and returns the record of the new type. The table key may not be changed.

-record(old, {key, val}). diff --git a/lib/mnesia/doc/src/mnesia.xml b/lib/mnesia/doc/src/mnesia.xml index 5d3bcf830e..74486b32bd 100644 --- a/lib/mnesia/doc/src/mnesia.xml +++ b/lib/mnesia/doc/src/mnesia.xml @@ -2835,7 +2835,7 @@ raise(Name, Amount) -> write(Tab, Record, LockKind) -> transaction abort | ok - Write an record into the database. + Write a record into the database.

Writes the record Record to the table Tab.

-- cgit v1.2.3 From 0d66208766000c58222b2ba471178fb956fc8f31 Mon Sep 17 00:00:00 2001 From: Boris 'billiob' Faure Date: Mon, 1 Nov 2010 22:13:45 +0100 Subject: remove '\011' from mnesia doc --- lib/mnesia/doc/src/Mnesia_chap2.xmlsrc | 6 +++--- lib/mnesia/doc/src/Mnesia_chap3.xml | 4 ++-- lib/mnesia/doc/src/Mnesia_chap5.xmlsrc | 18 +++++++++--------- lib/mnesia/doc/src/mnesia.xml | 14 +++++++------- 4 files changed, 21 insertions(+), 21 deletions(-) (limited to 'lib') diff --git a/lib/mnesia/doc/src/Mnesia_chap2.xmlsrc b/lib/mnesia/doc/src/Mnesia_chap2.xmlsrc index f263ea4ed2..2e2cc386b7 100644 --- a/lib/mnesia/doc/src/Mnesia_chap2.xmlsrc +++ b/lib/mnesia/doc/src/Mnesia_chap2.xmlsrc @@ -551,7 +551,7 @@ In_proj stored in the database:

-\011  mnesia:select(employee, [{#employee{sex = female, name = '$1', _ = '_'},[], ['$1']}]).
+mnesia:select(employee, [{#employee{sex = female, name = '$1', _ = '_'},[], ['$1']}]).
         

Select must always run within an activity such as a transaction. To be able to call from the shell we might @@ -585,8 +585,8 @@ In_proj

           Q = qlc:q([E#employee.name || E  mnesia:table(employee),
-\011                                E#employee.sex == female]),
-\011  qlc:e(Q),
+                                E#employee.sex == female]),
+          qlc:e(Q),
         

Accessing mnesia tables from a QLC list comprehension must always be done within a transaction. Consider the following diff --git a/lib/mnesia/doc/src/Mnesia_chap3.xml b/lib/mnesia/doc/src/Mnesia_chap3.xml index c3e584123e..2db9af9cf7 100644 --- a/lib/mnesia/doc/src/Mnesia_chap3.xml +++ b/lib/mnesia/doc/src/Mnesia_chap3.xml @@ -418,8 +418,8 @@ skeppet %erl -sname b -mnesia dir '"/ldisc/scratch/Mnesia.company"'set and bag:

  f() -> F =  fun() ->
-\011      mnesia:write({foo, 1, 2}), mnesia:write({foo, 1, 3}),
-\011      mnesia:read({foo, 1}) end, mnesia:transaction(F).             
+ mnesia:write({foo, 1, 2}), mnesia:write({foo, 1, 3}), + mnesia:read({foo, 1}) end, mnesia:transaction(F).

This transaction will return the list [{foo,1,3}] if the foo table is of type set. However, list [{foo,1,2}, {foo,1,3}] will return if the table is diff --git a/lib/mnesia/doc/src/Mnesia_chap5.xmlsrc b/lib/mnesia/doc/src/Mnesia_chap5.xmlsrc index 1c7e3662e1..30a8991465 100644 --- a/lib/mnesia/doc/src/Mnesia_chap5.xmlsrc +++ b/lib/mnesia/doc/src/Mnesia_chap5.xmlsrc @@ -335,7 +335,7 @@ ok explicitly be set at table creation. The default is 0, but if n_disc_copies and n_disc_only_copies also are 0, - n_ram_copies\011will default be set to 1. + n_ram_copies will default be set to 1.

{n_disc_copies, Int} @@ -408,7 +408,7 @@ ok (a@sam)4> SecProps = [{foreign_key, {prim_dict, sec_val}}]. [{foreign_key,{prim_dict,sec_val}}] (a@sam)5> mnesia:create_table(sec_dict, -\011 [{frag_properties, SecProps}, + [{frag_properties, SecProps}, (a@sam)5> {attributes, [sec_key, sec_val]}]). {atomic,ok} (a@sam)6> Write = fun(Rec) -> mnesia:write(Rec) end. @@ -418,23 +418,23 @@ ok (a@sam)8> SecKey = 42. 42 (a@sam)9> mnesia:activity(sync_dirty, Write, -\011\011 [{prim_dict, PrimKey, -11}], mnesia_frag). + [{prim_dict, PrimKey, -11}], mnesia_frag). ok (a@sam)10> mnesia:activity(sync_dirty, Write, -\011\011 [{sec_dict, SecKey, PrimKey}], mnesia_frag). + [{sec_dict, SecKey, PrimKey}], mnesia_frag). ok (a@sam)11> mnesia:change_table_frag(prim_dict, {add_frag, [node()]}). {atomic,ok} (a@sam)12> SecRead = fun(PrimKey, SecKey) -> -\011\011 mnesia:read({sec_dict, PrimKey}, SecKey, read) end. + mnesia:read({sec_dict, PrimKey}, SecKey, read) end. #Fun (a@sam)13> mnesia:activity(transaction, SecRead, -\011\011 [PrimKey, SecKey], mnesia_frag). + [PrimKey, SecKey], mnesia_frag). [{sec_dict,42,11}] (a@sam)14> Info = fun(Tab, Item) -> mnesia:table_info(Tab, Item) end. #Fun (a@sam)15> mnesia:activity(sync_dirty, Info, -\011\011 [prim_dict, frag_size], mnesia_frag). + [prim_dict, frag_size], mnesia_frag). [{prim_dict,0}, {prim_dict_frag2,0}, {prim_dict_frag3,0}, @@ -444,7 +444,7 @@ ok {prim_dict_frag7,0}, {prim_dict_frag8,0}] (a@sam)16> mnesia:activity(sync_dirty, Info, -\011\011 [sec_dict, frag_size], mnesia_frag). + [sec_dict, frag_size], mnesia_frag). [{sec_dict,0}, {sec_dict_frag2,0}, {sec_dict_frag3,0}, @@ -1051,7 +1051,7 @@ ok ActivityID will be received. Note that this event may still be received even if no table events with a corresponding ActivityID were received, depending on the tables to which the receiving process is subscribed.

-

Dirty operations always only contain one update and thus no activity event is sent.

+

Dirty operations always only contain one update and thus no activity event is sent.

diff --git a/lib/mnesia/doc/src/mnesia.xml b/lib/mnesia/doc/src/mnesia.xml index 74486b32bd..30adc0f071 100644 --- a/lib/mnesia/doc/src/mnesia.xml +++ b/lib/mnesia/doc/src/mnesia.xml @@ -799,7 +799,7 @@ mnesia:change_table_copy_type(person, node(), disc_copies)

{local_content, Bool}, where Bool must be - either true or false. The default value is false.\011

+ either true or false. The default value is false.

For example, the following call creates the person table @@ -1067,7 +1067,7 @@ mnesia:create_table(person, mnesia:dirty_next/2 but returns the previous object in Erlang term order for the ordered_set table type. For all other table types, mnesia:dirty_next/2 and - mnesia:dirty_prev/2 are synonyms.\011

+ mnesia:dirty_prev/2 are synonyms.

@@ -1702,7 +1702,7 @@ mnesia:create_table(person, mnesia:next/2 but returns the previous object in Erlang term order for the ordered_set table type. For all other table types, mnesia:next/2 and - mnesia:prev/2 are synonyms.\011

+ mnesia:prev/2 are synonyms.

@@ -1891,10 +1891,10 @@ mnesia:create_table(person,

For example to find the names of all male persons with an age over 30 in table Tab do:

-\011 MatchHead = #person{name='$1', sex=male, age='$2', _='_'}, -\011 Guard = {'>', '$2', 30}, -\011 Result = '$1', -\011 mnesia:select(Tab,[{MatchHead, [Guard], [Result]}]), +MatchHead = #person{name='$1', sex=male, age='$2', _='_'}, +Guard = {'>', '$2', 30}, +Result = '$1', +mnesia:select(Tab,[{MatchHead, [Guard], [Result]}]),
-- cgit v1.2.3 From 4e0a65b564d9ce015ad375fe3ccee864d6b8a93f Mon Sep 17 00:00:00 2001 From: Boris 'billiob' Faure Date: Mon, 1 Nov 2010 22:17:30 +0100 Subject: doc: "works like" instead of "works as" + missing like --- lib/mnesia/doc/src/Mnesia_chap4.xmlsrc | 4 ++-- lib/mnesia/doc/src/mnesia.xml | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'lib') diff --git a/lib/mnesia/doc/src/Mnesia_chap4.xmlsrc b/lib/mnesia/doc/src/Mnesia_chap4.xmlsrc index 7d89c1b0dd..6e8055326b 100644 --- a/lib/mnesia/doc/src/Mnesia_chap4.xmlsrc +++ b/lib/mnesia/doc/src/Mnesia_chap4.xmlsrc @@ -514,13 +514,13 @@ The behavior is undefined if any process perform a write of the table itself. This is an implementation detail, but remember the dirty functions are low level functions. - mnesia:dirty_last(Tab) This function works exactly as + mnesia:dirty_last(Tab) This function works exactly like mnesia:dirty_first/1 but returns the last object in Erlang term order for the ordered_set table type. For all other table types, mnesia:dirty_first/1 and mnesia:dirty_last/1 are synonyms. - mnesia:dirty_prev(Tab, Key) This function works exactly as + mnesia:dirty_prev(Tab, Key) This function works exactly like mnesia:dirty_next/2 but returns the previous object in Erlang term order for the ordered_set table type. For all other table types, mnesia:dirty_next/2 and diff --git a/lib/mnesia/doc/src/mnesia.xml b/lib/mnesia/doc/src/mnesia.xml index 30adc0f071..16e78ea0af 100644 --- a/lib/mnesia/doc/src/mnesia.xml +++ b/lib/mnesia/doc/src/mnesia.xml @@ -1022,7 +1022,7 @@ mnesia:create_table(person, dirty_last(Tab) -> Key | exit({aborted, Reason}) Return the key for the last record in a table. -

This function works exactly +

This function works exactly like mnesia:dirty_first/1 but returns the last object in Erlang term order for the ordered_set table type. For all other table types, mnesia:dirty_first/1 and @@ -1063,7 +1063,7 @@ mnesia:create_table(person, dirty_prev(Tab, Key) -> Key | exit({aborted, Reason}) Return the previous key in a table. -

This function works exactly +

This function works exactly like mnesia:dirty_next/2 but returns the previous object in Erlang term order for the ordered_set table type. For all other table types, mnesia:dirty_next/2 and @@ -1334,7 +1334,7 @@ mnesia:create_table(person, foldr(Function, Acc, Table) -> NewAcc | transaction abort Call Function for each record in Table -

This function works exactly as +

This function works exactly like foldl/3 but iterates the table in the opposite order for the ordered_set table type. For all other table types, foldr/3 and @@ -1512,14 +1512,14 @@ mnesia:create_table(person, Check if code is running in a transaction.

When this function is executed inside a transaction context - it returns true, otherwise false.

+ it returns true, otherwise false.

last(Tab) -> Key | transaction abort Return the key for the last record in a table. -

This function works exactly +

This function works exactly like mnesia:first/1 but returns the last object in Erlang term order for the ordered_set table type. For all other table types, mnesia:first/1 and @@ -1698,7 +1698,7 @@ mnesia:create_table(person, prev(Tab, Key) -> Key | transaction abort Return the previous key in a table. -

This function works exactly +

This function works exactly like mnesia:next/2 but returns the previous object in Erlang term order for the ordered_set table type. For all other table types, mnesia:next/2 and -- cgit v1.2.3