t> THE USE OF QUOTES IN MAPLE
b>
t> There are three types of quotes used in Maple. Each has its separate
t> meaning, and it is very important that you understand how to use each
t> of them.
b>
c1>
t> Double Quotes
b>
t> The double quotes character (") is perhaps the easiest quote to
t> remember. Double quotes recall previous output in a Maple session. One
t> set of double quotes recalls the most recent output, two sets ("")
t> recall the second most previous result, and three sets (""") recall the
t> third most previous output. You cannot go further back than three
t> outputs by using double quotes.
b>
t> The results obtained by double quotes can get a little confusing when
t> they are used within a lengthy procedure programmed in Maple. For this
t> reason examples using double quotes will not work within this tutorial
t> - there are many commands going on behind the scenes between each
t> displayed output. Try using double quotes in your session *after* you
t> leave the tutorial.
b> 
c1>
t> Using double quotes remains very straight-forward when used in a
t> command line mode. Even if you use the colon command terminator (:) to
t> suppress the display of output, the double quotes operator can access
t> that output down the road.
b>
t> The double quotes operator plays the role of a short-term replacement
t> for assignment. In normal use of Maple, if you wish to refer to an
t> output later in a session, you assign that output to some variable
t> name (which allows you to refer to it *any time* later in that session).
b>
c1>
t> Backward Quotes
b>
t> The backward quote operator (`) is used (as seen in a previous section)
t> to enclose strings in Maple. While only strings with special characters
t> (e.g., /, *, !) need backward quotes around them, it is recommended
t> that you get in the habit of using them on all your strings. For more
t> information on strings see the section Numbers and Constants, Strings
t> and Names.
b>
t> Two backward quotes appearing in succession after the beginning of a
t> string parse as a single backward quote. This is to allow you to
t> include that character as part of a string itself. The following
t> examples display this feature as well as some of the available
t> commands for string manipulation and investigation.
b>
c1>
x> `backward``quote`;
x> length(`This is a rather long string, don't you think`);
x> substring(`abcdefghijklmnopqrstuvwxyz`, 15..20);
x> searchtext(`quick`, `The quick, sly fox jumped`);
c1>
t> Forward Quotes
b>
t> Perhaps the most difficult quote to use effectively, the forward quote
t> (') can both cause confusion and eliminate ambiguities. Put simply,
t> enclosing an expression in forward quotes delays evaluation of that
t> expression for one trip through Maple's parser. Another way of thinking
t> of this is that each time the parser encounters an expression enclosed
t> by forward quotes, the *evaluation* that is performed is a stripping
t> away of one layer of these quotes. Therefore if you want to delay
t> evaluation of the expression for two trips through the parser, use two
t> layers of forward quotes.
b>
c1>
x> ''factor(x^2-x-2)'';
x> 'factor(x^2-x-2)';
x> factor(x^2-x-2);
c1>
t> The trick to using forward quotes is understanding when to apply them
t> and what exactly their effect is on an entire calculation. Two
t> common examples are illustrated here. Firstly, forward quotes
t> can be used to unassign a variable that was previously assigned to a
t> value. 
b>
x> x := 3;
x> x := 'x';
x> x;
b>
t> Secondly, forward quotes can be used for clarification within commands
t> that use indices (e.g., sum, product).
b>
x> sum('i^2', 'i'=1..6);
t> Questions
b>
c2>
q> Using backward quotes, create a string that reads: 
q> `Twas the night before Christmas
a> ```Twas the night before Christmas`;
c2>
q> Maple automatically simplifies many well-known functions that are given
q> numerical inputs. Using backward quotes, create an output that reads: 
q> exp(1.0) = 2.718281828
a> `exp(1.0)` = exp(1.0);
eoq>
eof>
