From: Richard Kreckel Date: Fri, 8 Mar 2019 21:33:44 +0000 (+0100) Subject: [DOC] Fix examples using deprecated lst initializers. X-Git-Tag: release_1-7-6~5 X-Git-Url: https://www.ginac.de/ginac.git//ginac.git?p=ginac.git;a=commitdiff_plain;h=ec64e556734484ca3c518e6de95b26be61bedee7 [DOC] Fix examples using deprecated lst initializers. --- diff --git a/doc/tutorial/ginac.texi b/doc/tutorial/ginac.texi index ffdfbef5..db78219d 100644 --- a/doc/tutorial/ginac.texi +++ b/doc/tutorial/ginac.texi @@ -1659,8 +1659,7 @@ Lists can be constructed from an initializer list of expressions: @example @{ symbol x("x"), y("y"); - lst l; - l = @{x, 2, y, x+y@}; + lst l = @{x, 2, y, x+y@}; // now, l is a list holding the expressions 'x', '2', 'y', and 'x+y', // in that order ... @@ -1767,9 +1766,8 @@ You can bring the elements of a list into a canonical order with @code{sort()}: @example ... - lst l1, l2; - l1 = x, 2, y, x+y; - l2 = 2, x+y, x, y; + lst l1 = @{x, 2, y, x+y@}; + lst l2 = @{2, x+y, x, y@}; l1.sort(); l2.sort(); // l1 and l2 are now equal @@ -1781,8 +1779,7 @@ elements with @code{unique()}: @example ... - lst l3; - l3 = x, 2, 2, 2, y, x+y, y+x; + lst l3 = @{x, 2, 2, 2, y, x+y, y+x@}; l3.unique(); // l3 is now @{x, 2, y, x+y@} @} @end example @@ -6252,9 +6249,8 @@ let us solve the two equations @code{a*x+b*y==3} and @code{x-y==b}: @example @{ symbol a("a"), b("b"), x("x"), y("y"); - lst eqns, vars; - eqns = a*x+b*y==3, x-y==b; - vars = x, y; + lst eqns = @{a*x+b*y==3, x-y==b@}; + lst vars = @{x, y@}; cout << lsolve(eqns, vars) << endl; // -> @{x==(3+b^2)/(b+a),y==(3-b*a)/(b+a)@} @end example @@ -6781,8 +6777,7 @@ And the stored expressions can be retrieved by their name: @example // ... - lst syms; - syms = x, y; + lst syms = @{x, y@}; ex ex1 = a2.unarchive_ex(syms, "foo"); ex ex2 = a2.unarchive_ex(syms, "the second one");