=================================================================== RCS file: /home/cvs/OpenXM_contrib2/asir2000/builtin/list.c,v retrieving revision 1.2 retrieving revision 1.5 diff -u -p -r1.2 -r1.5 --- OpenXM_contrib2/asir2000/builtin/list.c 2000/08/21 08:31:20 1.2 +++ OpenXM_contrib2/asir2000/builtin/list.c 2003/01/16 16:20:12 1.5 @@ -23,7 +23,7 @@ * shall be made on your publication or presentation in any form of the * results obtained by use of the SOFTWARE. * (4) In the event that you modify the SOFTWARE, you shall notify FLL by - * e-mail at risa-admin@flab.fujitsu.co.jp of the detailed specification + * e-mail at risa-admin@sec.flab.fujitsu.co.jp of the detailed specification * for such modification or the source code of the modified part of the * SOFTWARE. * @@ -45,18 +45,19 @@ * DEVELOPER SHALL HAVE NO LIABILITY IN CONNECTION WITH THE USE, * PERFORMANCE OR NON-PERFORMANCE OF THE SOFTWARE. * - * $OpenXM: OpenXM_contrib2/asir2000/builtin/list.c,v 1.1.1.1 1999/12/03 07:39:07 noro Exp $ + * $OpenXM: OpenXM_contrib2/asir2000/builtin/list.c,v 1.4 2003/01/16 04:44:19 saito Exp $ */ #include "ca.h" #include "parse.h" -void Pcar(), Pcdr(), Pcons(), Pappend(), Preverse(), Plength(); +void Pcar(), Pcdr(), Pcons(), Pappend(), Pconcat(), Preverse(), Plength(); struct ftab list_tab[] = { {"car",Pcar,1}, {"cdr",Pcdr,1}, {"cons",Pcons,2}, {"append",Pappend,2}, + {"concat",Pconcat,2}, {"reverse",Preverse,1}, {"length",Plength,1}, {0,0,0}, @@ -110,6 +111,26 @@ LIST *rp; } NEXT(t) = BDY((LIST)ARG1(arg)); MKLIST(*rp,t0); + } +} + +void Pconcat(arg,rp) +NODE arg; +LIST *rp; +{ + NODE a1,a2,n; + + asir_assert(ARG0(arg),O_LIST,"concat"); + asir_assert(ARG1(arg),O_LIST,"concat"); + a1 = (LIST)ARG0(arg); + if ( !a1 ) + *rp = (LIST)ARG1(arg); + else { + for ( n = a1; n; n = NEXT(n) ) { + a2 = n; + } + NEXT(a2) = BDY((LIST)ARG1(arg)); + *rp = (LIST)a1; } }