#include "consts.h"
#include "builtin.h"
#include "exc.h"
#include "gc.h"
#include <cstdio>
#include <cctype>
#include <cstdlib>
using std::stringstream;
extern EmptyList *empty_list;
extern UnspecObj *unspec_obj;
#define EXC_WRONG_ARG_NUM \
throw TokenError(name, RUN_ERR_WRONG_NUM_OF_ARGS)
SpecialOptIf::SpecialOptIf() : SpecialOptObj("if") {}
void SpecialOptIf::prepare(Pair *pc) {
Pair *first, *second, *third;
if (pc->cdr == empty_list) EXC_WRONG_ARG_NUM;
first = TO_PAIR(pc->cdr);
if (first->cdr == empty_list) EXC_WRONG_ARG_NUM;
second = TO_PAIR(first->cdr);
if (second->cdr !