Пример #1
0
 environment(const cells & parms, const cells & args, environment * outer)
 : outer_(outer)
 {
     cellit a = args.begin();
     for (cellit p = parms.begin(); p != parms.end(); ++p)
         env_[p->val] = *a++;
 }
Пример #2
0
cell proc_less_equal(const cells & c)
{
    long n(atol(c[0].val.c_str()));
    for (cellit i = c.begin()+1; i != c.end(); ++i)
        if (n > atol(i->val.c_str()))
            return false_sym;
    return true_sym;
}
Пример #3
0
cell proc_sub(const cells & c)
{
    long n(atol(c[0].val.c_str()));
    for (cellit i = c.begin()+1; i != c.end(); ++i) n -= atol(i->val.c_str());
    return cell(Number, str(n));
}
Пример #4
0
cell proc_mul(const cells & c)
{
    long n(1);
    for (cellit i = c.begin(); i != c.end(); ++i) n *= atol(i->val.c_str());
    return cell(Number, str(n));
}