DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

(guile.info.gz) List Modification

Info Catalog (guile.info.gz) Append/Reverse (guile.info.gz) Lists (guile.info.gz) List Searching
 
 22.2.6 List Modification
 ------------------------
 
 The following procedures modify an existing list, either by changing
 elements of the list, or by changing the list structure itself.
 
  -- Scheme Procedure: list-set! list k val
  -- C Function: scm_list_set_x (list, k, val)
      Set the Kth element of LIST to VAL.
 
  -- Scheme Procedure: list-cdr-set! list k val
  -- C Function: scm_list_cdr_set_x (list, k, val)
      Set the Kth cdr of LIST to VAL.
 
  -- Scheme Procedure: delq item lst
  -- C Function: scm_delq (item, lst)
      Return a newly-created copy of LST with elements `eq?' to ITEM
      removed.  This procedure mirrors `memq': `delq' compares elements
      of LST against ITEM with `eq?'.
 
  -- Scheme Procedure: delv item lst
  -- C Function: scm_delv (item, lst)
      Return a newly-created copy of LST with elements `eqv?'  to ITEM
      removed.  This procedure mirrors `memv': `delv' compares elements
      of LST against ITEM with `eqv?'.
 
  -- Scheme Procedure: delete item lst
  -- C Function: scm_delete (item, lst)
      Return a newly-created copy of LST with elements `equal?'  to ITEM
      removed.  This procedure mirrors `member': `delete' compares
      elements of LST against ITEM with `equal?'.
 
  -- Scheme Procedure: delq! item lst
  -- Scheme Procedure: delv! item lst
  -- Scheme Procedure: delete! item lst
  -- C Function: scm_delq_x (item, lst)
  -- C Function: scm_delv_x (item, lst)
  -- C Function: scm_delete_x (item, lst)
      These procedures are destructive versions of `delq', `delv' and
      `delete': they modify the pointers in the existing LST rather than
      creating a new list.  Caveat evaluator: Like other destructive
      list functions, these functions cannot modify the binding of LST,
      and so cannot be used to delete the first element of LST
      destructively.
 
  -- Scheme Procedure: delq1! item lst
  -- C Function: scm_delq1_x (item, lst)
      Like `delq!', but only deletes the first occurrence of ITEM from
      LST.  Tests for equality using `eq?'.  See also `delv1!' and
      `delete1!'.
 
  -- Scheme Procedure: delv1! item lst
  -- C Function: scm_delv1_x (item, lst)
      Like `delv!', but only deletes the first occurrence of ITEM from
      LST.  Tests for equality using `eqv?'.  See also `delq1!' and
      `delete1!'.
 
  -- Scheme Procedure: delete1! item lst
  -- C Function: scm_delete1_x (item, lst)
      Like `delete!', but only deletes the first occurrence of ITEM from
      LST.  Tests for equality using `equal?'.  See also `delq1!' and
      `delv1!'.
 
Info Catalog (guile.info.gz) Append/Reverse (guile.info.gz) Lists (guile.info.gz) List Searching
automatically generated byinfo2html