Exemplo n.º 1
0
Arquivo: list.o.c Projeto: hoobaa/mecl
cl_object
cl_copy_list(cl_object x)
{
	cl_object copy;
	if (ecl_unlikely(!LISTP(x))) {
                FEwrong_type_only_arg(ecl_make_fixnum(/*COPY-LIST*/257), x, ecl_make_fixnum(/*LIST*/481));
	}
	copy = ECL_NIL;
	if (!Null(x)) {
		cl_object tail = copy = ecl_list1(CAR(x));
		while (x = ECL_CONS_CDR(x), CONSP(x)) {
			cl_object cons = ecl_list1(ECL_CONS_CAR(x));
			ECL_RPLACD(tail, cons);
			tail = cons;
		}
		ECL_RPLACD(tail, x);
	}
	{
#line 441
		const cl_env_ptr the_env = ecl_process_env();
#line 441
		#line 441
		cl_object __value0 = copy;
#line 441
		the_env->nvalues = 1;
#line 441
		return __value0;
#line 441
	}
;
}
Exemplo n.º 2
0
Arquivo: list.o.c Projeto: hoobaa/mecl
static cl_object
duplicate_pairs(cl_object x)
{
	cl_object p = ECL_CONS_CAR(x);
	if (CONSP(p))
		p = CONS(ECL_CONS_CAR(p), ECL_CONS_CDR(p));
	return ecl_list1(p);
}
Exemplo n.º 3
0
void
ecl_atomic_push(cl_object *slot, cl_object c)
{
        cl_object cons = ecl_list1(c), car;
        do {
                car = (cl_object)AO_load((AO_t*)slot);
                ECL_RPLACD(cons, car);
        } while (!AO_compare_and_swap_full((AO_t*)slot, (AO_t)car, (AO_t)cons));
}
Exemplo n.º 4
0
Arquivo: list.o.c Projeto: hoobaa/mecl
cl_object cl_listX(cl_narg narg, ...)
{
#line 154
// ------------------------------2
#line 154
	const cl_env_ptr the_env = ecl_process_env();
#line 154
	ecl_va_list args;
	ecl_va_start(args, narg, narg, 0);
#line 154
// ------------------------------3

	cl_object head;
#line 157
// ------------------------------4
#line 157
#line 157
	if (ecl_unlikely(narg < 0)) FEwrong_num_arguments(ecl_make_fixnum(482));
#line 157
// ------------------------------5
	if (narg == 0)
		FEwrong_num_arguments(ecl_make_fixnum(/*LIST**/482));
	head = ecl_va_arg(args);
	if (--narg) {
		cl_object tail = head = ecl_list1(head);
		while (--narg) {
			cl_object cons = ecl_list1(ecl_va_arg(args));
			ECL_RPLACD(tail, cons);
			tail = cons;
		}
		ECL_RPLACD(tail, ecl_va_arg(args));
	}
	{
#line 169
		#line 169
		cl_object __value0 = head;
#line 169
		the_env->nvalues = 1;
#line 169
		return __value0;
#line 169
	}

}
Exemplo n.º 5
0
Arquivo: list.o.c Projeto: hoobaa/mecl
cl_object cl_list(cl_narg narg, ...)
{
#line 140
// ------------------------------2
#line 140
	const cl_env_ptr the_env = ecl_process_env();
#line 140
	ecl_va_list args;
	ecl_va_start(args, narg, narg, 0);
#line 140
// ------------------------------3

	cl_object head = ECL_NIL;
#line 143
// ------------------------------4
#line 143
#line 143
	if (ecl_unlikely(narg < 0)) FEwrong_num_arguments(ecl_make_fixnum(481));
#line 143
// ------------------------------5
	if (narg--) {
		cl_object tail = head = ecl_list1(ecl_va_arg(args));
		while (narg--) {
			cl_object cons = ecl_list1(ecl_va_arg(args));
			ECL_RPLACD(tail, cons);
			tail = cons;
		}
	}
	{
#line 151
		#line 151
		cl_object __value0 = head;
#line 151
		the_env->nvalues = 1;
#line 151
		return __value0;
#line 151
	}

}
Exemplo n.º 6
0
Arquivo: list.o.c Projeto: hoobaa/mecl
static cl_object *
append_into(cl_object head, cl_object *tail, cl_object l)
{
	if (!Null(*tail)) {
		/* (APPEND '(1 . 2) 3) */
		FEtype_error_proper_list(head);
	}
	while (CONSP(l)) {
		cl_object cons = ecl_list1(ECL_CONS_CAR(l));
		*tail = cons;
		tail = &ECL_CONS_CDR(cons);
		l = ECL_CONS_CDR(l);
	}
        *tail = l;
	return tail;
}
Exemplo n.º 7
0
/*	optimize speed 3, debug 3, space 0, safety 2                  */
static cl_object L1seq(cl_narg narg, ...)
{
 cl_object T0;
 struct ecl_ihs_frame ihs;
 const cl_object _ecl_debug_env = ECL_NIL;
 const cl_env_ptr cl_env_copy = ecl_process_env();
 cl_object value0;
 ecl_cs_check(cl_env_copy,value0);
 {
  cl_object V1;
  cl_object V2;
  cl_object V3;
  ecl_va_list args; ecl_va_start(args,narg,narg,0);
  {
   ecl_ihs_push(cl_env_copy,&ihs,VV[0],_ecl_debug_env);
   {
    cl_object keyvars[6];
    cl_parse_key(args,3,L1seqkeys,keyvars,NULL,FALSE);
    ecl_va_end(args);
    if (Null(keyvars[3])) {
     V1 = ecl_make_fixnum(0);
    } else {
     V1 = keyvars[0];
    }
    if (Null(keyvars[4])) {
     V2 = ecl_make_fixnum(10);
    } else {
     V2 = keyvars[1];
    }
    if (Null(keyvars[5])) {
     V3 = ecl_make_fixnum(1);
    } else {
     V3 = keyvars[2];
    }
   }
   {
    cl_object V4;                                 /*  I               */
    cl_object V5;
    cl_object V6;
    {
     T0 = cl_realp(V1);
     if (ecl_unlikely(!((T0)!=ECL_NIL)))
         FEwrong_type_argument(ECL_SYM("REAL",703),V1);
     V4 = V1;
    }
    {
     T0 = cl_realp(V2);
     if (ecl_unlikely(!((T0)!=ECL_NIL)))
         FEwrong_type_argument(ECL_SYM("REAL",703),V2);
     V5 = V2;
    }
    {
     T0 = cl_realp(V3);
     if (ecl_unlikely(!((T0)!=ECL_NIL)))
         FEwrong_type_argument(ECL_SYM("REAL",703),V3);
     V6 = V3;
    }
    {
     static const struct ecl_var_debug_info _ecl_descriptors[]={
     {"#:LOOP-STEP-BY1",_ecl_object_loc}
     ,{"#:LOOP-LIMIT0",_ecl_object_loc}
     ,{"COMMON-LISP-USER::I",_ecl_object_loc}};
     const cl_index _ecl_debug_info_raw[]={
     (cl_index)(_ecl_debug_env),(cl_index)(_ecl_descriptors),(cl_index)(&V6),(cl_index)(&V5),(cl_index)(&V4)};
     ecl_def_ct_vector(_ecl_debug_env,ecl_aet_index,_ecl_debug_info_raw,5,,);
     ihs.lex_env = _ecl_debug_env;
     {
      cl_object V7;
      cl_object V8;
      V7 = ecl_list1(ECL_NIL);
      V8 = V7;
      {
       static const struct ecl_var_debug_info _ecl_descriptors[]={
       {"#:LOOP-LIST-TAIL3",_ecl_object_loc}
       ,{"#:LOOP-LIST-HEAD2",_ecl_object_loc}};
       const cl_index _ecl_debug_info_raw[]={
       (cl_index)(_ecl_debug_env),(cl_index)(_ecl_descriptors),(cl_index)(&V8),(cl_index)(&V7)};
       ecl_def_ct_vector(_ecl_debug_env,ecl_aet_index,_ecl_debug_info_raw,4,,);
       ihs.lex_env = _ecl_debug_env;
L12:;
       if (!(ecl_number_compare(V4,V5)>0)) { goto L14; }
       goto L13;
L14:;
       T0 = V8;
       V8 = ecl_list1(V4);
       cl_rplacd(T0, V8);
       V4 = ecl_plus(V4,V6);
       goto L12;
L13:;
       value0 = ecl_cdr(V7);
       cl_env_copy->nvalues = 1;
       ecl_ihs_pop(cl_env_copy);
       return value0;
      }
      ihs.lex_env = _ecl_debug_env;
     }
    }
    ihs.lex_env = _ecl_debug_env;
   }
  }
 }
}