Name

merge — Merges two lists into one

Synopsis

list merge ( list LIST1 ,
  list LIST2 );
 

Parameters

list LIST1

First List

list LIST2

Second List

Return

list

Description

Interprets two lists as sets and returns a new list that has all elements of the first list and all of the second list. Identical elements are preserved. The order of the elements in the new list is preserved. Elements of l1 are prior to elements from l2. nil as either argument makes the result nil too.

Usage

  merge ([1, 2], [3, 4]) -> [1, 2, 3, 4]
  merge ([1, 2, 3], [2, 3, 4]) -> [1, 2, 3, 2, 3, 4]