Diff of /ref_c_conditions.xml [2541a5] .. [5d2657] Maximize Restore

  Switch to unified view

a/ref_c_conditions.xml b/ref_c_conditions.xml
...
...
6
<book xmlns="http://docbook.org/ns/docbook" version="5.0" xml:lang="en">
6
<book xmlns="http://docbook.org/ns/docbook" version="5.0" xml:lang="en">
7
<chapter>
7
<chapter>
8
<title>Conditions</title>
8
<title>Conditions</title>
9
<section xml:id="ansi.conditions.c-dict">
9
<section xml:id="ansi.conditions.c-dict">
10
<title>C Reference</title>
10
<title>C Reference</title>
11
  <refentry xml:id="ECL_HANDLER_CASE">
12
    <refnamediv>
13
      <refname><function>ECL_HANDLER_CASE</function></refname>
14
      <refpurpose>C macro for <ulink url="&clhs;m_hand_1.htm"><symbol>handler-case</symbol></ulink></refpurpose>
15
    </refnamediv>
16
17
    <refsynopsisdiv>
18
      <synopsis><code><function>ECL_HANDLER_CASE_BEGIN</function>(env,names) {</code></synopsis>
19
      <synopsis><code>} <function>ECL_HANDLER_CASE(n,condition) {</function> {</code></synopsis>
20
      <synopsis><code>} <function>ECL_HANDLER_CASE_END</function>;</code></synopsis>
21
    </refsynopsisdiv>
22
23
    <refsect1>
24
      <title>Description</title>
25
26
      <para><function>ECL_HANDLER_CASE_BEGIN</function> runs a block of C code with a set of error handlers bound to the names given by the list <replaceable>names</replaceable>. The subsequent <function>ECL_HANDLER_CASE</function> statements specify what to do when the <replaceable>n</replaceable>-th type of conditions is found, where <replaceable>n</replaceable> is an integer denoting the position of the name in the list <replaceable>names</replaceable>.</para>
27
28
      <para>When a condition is signaled, &ECL; scans the list of signal handlers, looking for matches based on <symbol>typep</symbol>. If the match with the highest precedence belongs to the list <replaceable>names</replaceable>, &ECL; will perform a non-local transfer of control to the appropriate <function>ECL_HANDLER_CASE</function>, passing it a <replaceable>condition</replaceable> object as unique argument.</para>
29
30
      <para>The following example shows how to establish a handler for <symbol>ERROR</symbol> conditions. Note how the first value to <function>ECL_HANDLER_CASE</function> matches the position of the restart name in the list:</para>
31
      <programlisting>
32
cl_object error = ecl_make_symbol("ERROR","CL");
33
ECL_RESTART_BEGIN(the_env, ecl_list1(error)) {
34
   /* This form is evaluated with bound handlers */
35
   output = cl_eval(1, form);
36
} ECL_HANDLER_CASE(1, condition) {
37
   /* This code is executed when an error happens */
38
   /* We just return the error that took place */
39
   output = condition;
40
} ECL_RESTART_END;
41
      </programlisting>
42
    </refsect1>
43
  </refentry>
44
11
  <refentry xml:id="ECL_RESTART_CASE">
45
  <refentry xml:id="ECL_RESTART_CASE">
12
    <refnamediv>
46
    <refnamediv>
13
      <refname><function>ECL_RESTART_CASE</function></refname>
47
      <refname><function>ECL_RESTART_CASE</function></refname>
14
      <refpurpose>C macro for <ulink url="&clhs;m_rst_ca.htm"><symbol>restart-case</symbol></ulink></refpurpose>
48
      <refpurpose>C macro for <ulink url="&clhs;m_rst_ca.htm"><symbol>restart-case</symbol></ulink></refpurpose>
15
    </refnamediv>
49
    </refnamediv>
...
...
78
<member><code>cl_object cl_error(cl_narg narg, cl_object datum, ...)</code></member>
112
<member><code>cl_object cl_error(cl_narg narg, cl_object datum, ...)</code></member>
79
113
80
<member><ulink url="&clhs;f_find_r.htm"><symbol>find-restart</symbol></ulink></member>
114
<member><ulink url="&clhs;f_find_r.htm"><symbol>find-restart</symbol></ulink></member>
81
<member><code>cl_object cl_find_restart(cl_narg narg, cl_object identifier, ...)</code></member>
115
<member><code>cl_object cl_find_restart(cl_narg narg, cl_object identifier, ...)</code></member>
82
116
117
<member><ulink url="&clhs;m_hand_1.htm"><symbol>handler-case</symbol></ulink></member>
118
<member><link linkend="ECL_HANDLER_CASE"><function>ECL_HANDLER_CASE</function></link> macro</member>
119
83
<member><ulink url="&clhs;f_invali.htm"><symbol>invalid-method-error</symbol></ulink></member>
120
<member><ulink url="&clhs;f_invali.htm"><symbol>invalid-method-error</symbol></ulink></member>
84
<member><code>&OCL;</code></member>
121
<member><code>&OCL;</code></member>
85
122
86
<member><ulink url="&clhs;f_invoke.htm"><symbol>invoke-debugger</symbol></ulink></member>
123
<member><ulink url="&clhs;f_invoke.htm"><symbol>invoke-debugger</symbol></ulink></member>
87
<member><code>cl_object cl_invoke_debugger(cl_object condition)</code></member>
124
<member><code>cl_object cl_invoke_debugger(cl_object condition)</code></member>