#LyX 1.1 created this file. For more info see http://www.lyx.org/ \lyxformat 218 \textclass article \begin_preamble \usepackage{html} \end_preamble \language english \inputencoding latin1 \fontscheme times \graphics default \float_placement h \paperfontsize default \spacing single \papersize Default \paperpackage a4 \use_geometry 0 \use_amsmath 0 \paperorientation portrait \secnumdepth 3 \tocdepth 3 \paragraph_separation skip \defskip medskip \quotes_language english \quotes_times 2 \papercolumns 2 \papersides 1 \paperpagestyle fancy \layout Standard \latex latex \backslash bodytext{bgcolor=white text=black} \layout Title Rascal \newline the Advanced Scientific CALculator \newline \latex latex \backslash vspace{.5cm} \latex default Userguide \latex latex \backslash vspace{.5cm} \layout Author Sebastian Ritterbusch \layout Standard \begin_inset LatexCommand \tableofcontents{} \end_inset \layout Section Introduction \layout Standard Rascal is based on an extremely modular approach; depending on the user's needs, various powerful modules can be compiled into the system. Thus Rascal can be a light-weight tool as well as a very powerful computational system. This user documentation is created during compilation and describes the included features. \layout Section Basic Usage \layout Standard Invoking the program leads to a prompt where you can enter expressions. The expressions or definitions are being evaluated as soon you press return. A semicolon at the end suppresses any output. As an example: \layout LyX-Code >5+2 \layout LyX-Code 7 \layout LyX-Code >5+2; \layout LyX-Code > \layout Standard Variables are also supported, where the names are case-sensitive alphabetic letters and may be followed by numbers. An assignment is done using the equal sign: \layout LyX-Code >MyVariable2=7; \layout LyX-Code >MyVariable2*MyVariable2 \layout LyX-Code 49 \layout LyX-Code > \layout Standard Undefined variables are always assumed to be integer zeros. \layout Standard The user can also define functions of one variable ( \begin_inset Formula \( n \) \end_inset -ary functions can be implemented using vectors or matrices as arguments). The names follow the same rules as the names of variables: \layout LyX-Code >MyNiceFunction17(x)=x*x+5*x; \layout LyX-Code >MyNiceFunction17(2) \layout LyX-Code 14 \layout LyX-Code >EvalAt12(F)=F(12); \layout LyX-Code >EvalAt12(sqr) \layout LyX-Code 144 \layout Standard The semicolon at the end of the definition is mandatory and the calling-method is \begin_inset Quotes eld \end_inset call by variable \begin_inset Quotes erd \end_inset , similar to parametric \begin_inset Quotes eld \end_inset #define \begin_inset Quotes erd \end_inset s in C++ with the difference that changes in the operand-variables are not forwarded to the original variable. Of course functions can be nested and invoked with any data-type. If the data-type does not support a certain operation, an error occurs. The last example shows how functions can be used as variables, here the function value of \begin_inset Quotes eld \end_inset square \begin_inset Quotes erd \end_inset at 12 was computed. \layout Standard Conditional expressions can be realized using the C-style \begin_inset Quotes eld \end_inset ?: \begin_inset Quotes erd \end_inset -operator: \layout LyX-Code >5==3?2.3:17 \layout LyX-Code 17 \layout LyX-Code >abs(x)=x>0?x:-x; \layout LyX-Code >abs(-18) \layout LyX-Code 18 \layout LyX-Code >abs(12) \layout LyX-Code 12 \layout LyX-Code > \layout Standard If the condition before the questionmark is true, the first expression is returned, else the second. In contrast to C the result-types of the two alternatives here can be different , also both alternatives are computed before the decision takes place, thus recursions are not possible. \layout Standard You can exit Rascal by entering \begin_inset Quotes eld \end_inset quit \begin_inset Quotes erd \end_inset followed by a return. \layout Standard If Rascal was compiled using the \begin_inset Quotes eld \end_inset libreadline \begin_inset Quotes erd \end_inset , then you may use the cursor-keys to flip back to commands and results from before, as well as benefit of command completition using the \begin_inset Quotes eld \end_inset tab \begin_inset Quotes erd \end_inset -key. \layout Standard Furthermore the different modules predefine functions, which are documented in the following sections. \layout Standard \begin_inset Include \input{value.tex} \end_inset \layout Section Questions? \layout Standard Send questions, ideas, hints and congratulations to \emph on rascal@ritterbusch.de. \layout Section Licence \layout Standard This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. \layout Standard This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. \layout Standard You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. \the_end