2
Copyright (C) 1994 M. Hagiya, W. Schelter, T. Yuasa
4
This file is part of GNU Common Lisp, herein referred to as GCL
6
GCL is free software; you can redistribute it and/or modify it under
7
the terms of the GNU LIBRARY GENERAL PUBLIC LICENSE as published by
8
the Free Software Foundation; either version 2, or (at your option)
11
GCL is distributed in the hope that it will be useful, but WITHOUT
12
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
14
License for more details.
16
You should have received a copy of the GNU Library General Public License
17
along with GCL; see the file COPYING. If not, write to the Free Software
18
Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
26
dynamic non-local exit
32
FFN(Fcatch)(VOL object args)
38
FEtoo_few_argumentsF(args);
42
frs_push(FRS_CATCH, vs_base[0]);
50
DEFUN_NEW("ERROR-SET",object,fSerror_set,SI
51
,1,1,NONE,OO,OO,OO,OO,(volatile object x0),
52
"Evaluates the FORM in the null environment. If the evaluation \
53
of the FORM has successfully completed, SI:ERROR-SET returns NIL as the first \
54
value and the result of the evaluation as the rest of the values. If, in the \
55
course of the evaluation, a non-local jump from the FORM is atempted, \
56
SI:ERROR-SET traps the jump and returns the corresponding jump tag as its \
60
object *old_lex = lex_env;
64
frs_push(FRS_CATCHALL, Cnil);
80
{int i = fcall.nvalues;
81
if (i+1>=sizeof(fcall.values)/sizeof(*fcall.values))
82
FEerror("Too many function call values",0);
84
{ fcall.values[i+1] = fcall.values[i];
87
fcall.values[1] = x0;}
92
FFN(Funwind_protect)(VOL object args)
98
FEtoo_few_argumentsF(args);
99
frs_push(FRS_PROTECT, Cnil);
101
object tag = nlj_tag;
102
frame_ptr fr = nlj_fr;
106
while(vs_base<value_top) {
116
if (vs_top == vs_base) vs_base[0] = Cnil;
124
while(vs_base<value_top) {
132
if (vs_top == vs_base) vs_base[0] = Cnil;
137
FFN(Fthrow)(object args)
140
object *top = vs_top;
143
if (endp(args) || endp(MMcdr(args)))
144
FEtoo_few_argumentsF(args);
145
if (!endp(MMcddr(args)))
146
FEtoo_many_argumentsF(args);
151
fr = frs_sch_catch(tag);
153
FEerror("~S is an undefined tag.", 1, tag);
162
make_special_form("CATCH", Fcatch);
163
make_special_form("UNWIND-PROTECT", Funwind_protect);
164
make_special_form("THROW", Fthrow);