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.
39
if (endp(form) || endp(MMcdr(form)))
40
FEtoo_few_argumentsF(form);
41
if (!endp(MMcddr(form)) && !endp(MMcdddr(form)))
42
FEtoo_many_argumentsF(form);
44
if (vs_base[0] == Cnil)
45
if (endp(MMcddr(form))) {
46
vs_top = vs_base = top;
59
FFN(Fcond)(object args)
68
if (type_of(clause) != t_cons)
69
FEerror("~S is an illegal COND clause.",1,clause);
71
if (vs_base[0] != Cnil) {
72
conseq = MMcdr(clause);
77
while (!endp(conseq)) {
80
conseq = MMcdr(conseq);
87
vs_base = vs_top = top;
92
FFN(Fcase)(object arg)
101
FEtoo_few_argumentsF(arg);
108
if (type_of(clause) != t_cons)
109
FEerror("~S is an illegal CASE clause.",1,clause);
111
conseq = MMcdr(clause);
112
if (type_of(key) == t_cons)
114
if (eql(MMcar(key),top[0]))
117
} while (!endp(key));
118
else if (key == Cnil)
120
else if (key == Ct || key == sLotherwise || eql(key,top[0]))
124
vs_base = vs_top = top;
130
vs_base = vs_top = top;
136
conseq = MMcdr(conseq);
137
} while (!endp(conseq));
142
FFN(Fwhen)(object form)
145
object *top = vs_top;
148
FEtoo_few_argumentsF(form);
150
if (vs_base[0] == Cnil) {
151
vs_base = vs_top = top;
156
vs_base = vs_top = top;
163
} while (!endp(form));
168
FFN(Funless)(object form)
171
object *top = vs_top;
174
FEtoo_few_argumentsF(form);
176
if (vs_base[0] == Cnil) {
180
vs_base = vs_top = top;
187
} while (!endp(form));
189
vs_base = vs_top = top;
195
gcl_init_conditional(void)
197
make_special_form("IF",Fif);
198
make_special_form("COND",Fcond);
199
make_special_form("CASE",Fcase);
200
make_special_form("WHEN",Fwhen);
201
make_special_form("UNLESS",Funless);
203
sLotherwise = make_ordinary("OTHERWISE");
204
enter_mark_origin(&sLotherwise);