File r37/lisp/csl/html/r37_0184.html artifact 7ac720d9e3 part of check-in 8e196c7117



<A NAME=WS>

<TITLE>WS</TITLE></A>
<b><a href=r37_idx.html>INDEX</a></b><p><p>



<B>WS</B> _ _ _  _ _ _  _ _ _  _ _ _ <B>operator</B><P>
<P>
 
 <P>
<P>
The <em>ws</em> operator alone returns the last result; <em>ws</em> with a 
number argument returns the results of the REDUCE statement executed after 
that numbered prompt. 
 <P> <H3> 
syntax: </H3>
<P>
<P>
<em>ws</em>or <em>ws</em>(&lt;number&gt;) 
<P>
<P>
<P>
&lt;number&gt; must be an integer between 1 and the current REDUCE prompt number
. 
<P>
<P>
 <P> <H3> 
examples: </H3>
<P><PRE><TT></TT></PRE><P>(In the following examples, unlike most others, the nu
mbered 
prompt is shown.)<P><PRE><TT> 

1: df(sin y,y); 

  COS(Y) 


2: ws^2; 

        2
  COS(Y)  


3: df(ws 1,y); 

  -SIN(Y)

</TT></PRE><P> 
<P>
<P>
<em>ws</em>and <em>ws</em><em>(</em>&lt;number&gt;<em>)</em> can be used anywher
e the 
expression they stand for can be used. Calling a number for which no 
result was produced, such as a switch setting, will give an error message. 
<P>
<P>
The current workspace always contains the results of the last REDUCE 
command that produced an expression, even if several input statements 
that do not produce expressions have intervened. For example, if you do 
a differentiation, producing a result expression, then change several 
switches, the operator <em>ws;</em> returns the results of the differentiation. 

The current workspace (<em>ws</em>) can also be used inside files, though the 
numbered workspace contains only the <em>in</em> command that input the file. 
<P>
<P>
There are three history lists kept in your REDUCE session. The first 
stores raw input, suitable for the statement editor. The second stores 
parsed input, ready to execute and accessible by 
<A HREF=r37_0232.html>input</A>. The 
third stores results, when they are produced by statements, which are 
accessible by the <em>ws</em>&lt; n&gt; operator. If your session is very 
long, storage space begins to fill up with these expressions, so it is a 
good idea to end the session once in a while, saving needed expressions to 
files with the 
<A HREF=r37_0133.html>saveas</A> and 
<A HREF=r37_0233.html>out</A> commands. 
<P>
<P>
An error message is given if a reference number has not yet been used. 
<P>
<P>
<P>


REDUCE Historical
REDUCE Sourceforge Project | Historical SVN Repository | GitHub Mirror | SourceHut Mirror | NotABug Mirror | Chisel Mirror | Chisel RSS ]