/* (C) Copyright International Business Machines Corporation 23 January */
/* 1990.  All Rights Reserved. */
/*  */
/* See the file USERAGREEMENT distributed with this software for full */
/* terms and conditions of use. */
/* SCCS Info: @(#)listp.c	1.2 3/13/90 */

#include "stdnil.h"
#include "listp.h"


cell *append_f(list1, list2)
cell *list1, *list2;
{
  cell *newlist;
  

  if (list1 is nil)
    return(list2);
  
  if (list2 is nil)
    return(list1);
  
  newlist = list1;
  
  while (cdr(list1) isnt nil)
    list1 = cdr(list1);
  
  cdr(list1) = list2;
  return(newlist);
}


cell *last_f(list)
cell *list;
{
    if (list is nil)
      return(list);

    while (cdr(list) isnt nil)
      list = cdr(list);

    return(list);
}
