Logo

Programming-Idioms

Append the element x to the list s.
New implementation

Be concise.

Be useful.

All contributions dictatorially edited by webmasters to match personal tastes.

Please do not paste any copyright violating material.

Please try to avoid dependencies to third-party libraries and frameworks.

Other implementations
(conj s x)
#include <list>
s.push_back(x);
#include <list>
s.emplace_back(x);
s.Add(x);
s ~= x;
s.add(x);
real, allocatable, dimension(:) :: s

s = [s, x]
s = append(s, x)
xs = s ++ [x]
s = [...s, x];
s.push(x);
s.add(x);
s[#s + 1] = x
table.insert(s, x)
$s[]=$x;
uses classes;
var
  L: TList;
  Item: Pointer;
...
  L.Add(Item);
...
push @s, $x;
s.append(x)
s << x
s.push(x);
(reverse (cons x (reverse s)))
s.Add(x)