next up previous
Next: 4.3.3 append Up: 4.3 Car, Cdr Previous: 4.3.1 cons

4.3.2 list


LVAL xlist()
{
  LVAL last,next,val;
  
  /* protect some pointers */
  xlsave1(val);
  
  /* add each argument to the list */
  for (val = NIL; moreargs(); ) {
    
    /* append this argument
       to the end of the list */
    next = consa(nextarg());
    if (val) rplacd(last,next);
    else val = next;
    last = next;
  }
  
  /* restore the stack */
  xlpop();
  
  /* return the list */
  return (val);
}


generated through LaTeX2HTML. M.Inaba 平成18年5月6日