示例#1
0
/* module-functions */
static PyObject*
cons(PyObject *self, PyObject *args)    /* the exposed factory-function */
{
    PyObject *car, *cdr;
    if(!PyArg_ParseTuple(args, "OO", &car, &cdr))
        return 0;
    return (PyObject*)cons_new(car, cdr);
}
示例#2
0
文件: gc.c 项目: chrizel/moelisp
pobject gc_add(pobject object)
{
    if (object && !is_symbol(object) && !(object->flags & 0x20)) {
        gc_list = cons_new(object, gc_list);
        object->flags |= 0x20;
        ++gc_objects;
    }
    return object;
}
示例#3
0
文件: gc.c 项目: neosam/moelisp
pobject gc_add(pobject object)
{
    if (object && (!is_symbol(object)))
        gc_list = cons_new(object, gc_list);
    return object;
}
示例#4
0
文件: value.c 项目: jiribenes/scheme
value_t cons_fn(vm_t *vm, value_t a, value_t b) {
    cons_t *result = cons_new(vm);
    result->car = a;
    result->cdr = b;
    return PTR_VAL(result);
}
示例#5
0
static pobject cons(pobject env, pobject params)
{
    pobject o1 = eval(env, cons_car(params));
    pobject o2 = eval(env, cons_car(cons_cdr(params)));
    return gc_add(cons_new(o1, o2));
}