sole-elementGBBopen Toolssorted-maphashsplitting-butlastGoTo Top

splitting-butlast   list &optional n => result-list, tail[Function]

Purpose
Return all but the last n elements of list and, as a second value, the tail containing those last n elements.

Package   :gbbopen-tools

Module   :gbbopen-tools

Arguments and values

list     A proper list or a dotted list
n     A non-negative integer (default is 1)
result-list     A proper list
tail     A proper list or a dotted list

Returns
Two values:

Examples

  > (splitting-butlast '(a b c d e))
  (a b c d)
  (e)
  > (splitting-butlast '(a b c d e) 3)
  (a b)
  (c d e)
  > (splitting-butlast '(a b . c))
  (a)
  (b . c)
  >


The GBBopen Project


sole-elementGBBopen Toolssorted-maphashsplitting-butlastGoTo Top