/**********************************************************************
 
	Copyright (C) 2003 Hirohisa MORI <joshua@nichibun.ac.jp>
 
	This program is free software; you can redistribute it 
	and/or modify it under the terms of the GLOBALBASE 
	Library General Public License (G-LGPL) as published by 

	http://www.globalbase.org/
 
	This program is distributed in the hope that it will be 
	useful, but WITHOUT ANY WARRANTY; without even the 
	implied warranty of MERCHANTABILITY or FITNESS FOR A 
	PARTICULAR PURPOSE.

**********************************************************************/



#include	"xl.h"
#include	"memory_routine.h"

/*

int car_type,cdr_type;


void
cons_test(XL_SEXP * p,char * msg)
{
XL_SEXP * n;
	if ( p == 0 )
		return;
	if ( p->h.type != XLT_PAIR )
		return;
	if ( ((int)p->pair.car) & 1 )
		er_panic(msg);
	if ( ((int)p->pair.cdr) & 1 )
		er_panic(msg);
	if ( p->pair.car )
		car_type = p->pair.car->h.type;
	if ( p->pair.cdr )
		cdr_type = p->pair.cdr->h.type;
}
*/

XL_SEXP *
cons(XL_SEXP * a,XL_SEXP * b)
{
XL_PAIR * p;
	p = &get_sexp_inh(0,XLT_PAIR,a)->pair;
	p->car = a;
	p->cdr = b;


	if ( p->h.file == 0 && b ) {
		p->h.file = b->h.file;
		p->h.line = b->h.line;
	}
	return (XL_SEXP*)p;
}



XL_SEXP *
cons_inh_2(XL_SEXP * a,XL_SEXP * b)
{
XL_PAIR * p;
	p = &get_sexp_inh(0,XLT_PAIR,b)->pair;
	p->car = a;
	p->cdr = b;


	return (XL_SEXP*)p;
}


