File: ch07.html

package info (click to toggle)
genius 1.0.27-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 25,308 kB
  • sloc: ansic: 75,620; xml: 71,565; sh: 4,445; makefile: 1,927; lex: 523; yacc: 298; perl: 54
file content (18 lines) | stat: -rw-r--r-- 3,132 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>Chapter 7. Fortgeschrittene Programmierung mit GEL</title><meta name="generator" content="DocBook XSL Stylesheets Vsnapshot"><link rel="home" href="index.html" title="Genius-Handbuch"><link rel="up" href="index.html" title="Genius-Handbuch"><link rel="prev" href="ch06s09.html" title="Lvalues (linke Werte)"><link rel="next" href="ch07s02.html" title="Übergeordnete Syntax"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 7. Fortgeschrittene Programmierung mit GEL</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ch06s09.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="ch07s02.html">Next</a></td></tr></table><hr></div><div class="chapter"><div class="titlepage"><div><div><h1 class="title"><a name="genius-gel-programming-advanced"></a>Chapter 7. Fortgeschrittene Programmierung mit GEL</h1></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl class="toc"><dt><span class="sect1"><a href="ch07.html#genius-gel-error-handling">Fehlerbehandlung</a></span></dt><dt><span class="sect1"><a href="ch07s02.html">Übergeordnete Syntax</a></span></dt><dt><span class="sect1"><a href="ch07s03.html">Funktionen als Rückgabe</a></span></dt><dt><span class="sect1"><a href="ch07s04.html">Echte lokale Variablen</a></span></dt><dt><span class="sect1"><a href="ch07s05.html">GEL Startprozedur</a></span></dt><dt><span class="sect1"><a href="ch07s06.html">Laden von Programmen</a></span></dt></dl></div><div class="sect1"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="genius-gel-error-handling"></a>Fehlerbehandlung</h2></div></div></div><p lang="en">
If you detect an error in your function, you can bail out of it. For normal
errors, such as wrong types of arguments, you can fail to compute the function
by adding the statement <code class="literal">bailout</code>. If something went
really wrong and you want to completely kill the current computation, you can
use <code class="literal">exception</code>.
      </p><p lang="en">
	For example if you want to check for arguments in your function.  You
could use the following code.
</p><pre lang="en" class="programlisting">function f(M) = (
  if not IsMatrix (M) then (
    error ("M not a matrix!");
    bailout
  );
  ...
)
</pre><p lang="en">
      </p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ch06s09.html">Prev</a> </td><td width="20%" align="center"> </td><td width="40%" align="right"> <a accesskey="n" href="ch07s02.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Lvalues (linke Werte) </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> Übergeordnete Syntax</td></tr></table></div></body></html>