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.
- Clojure
- C++
- C++
- C#
- D
- Dart
- Fortran
- Go
- Haskell
- JS
- JS
- Java
- Lua
- Lua
- PHP
- Pascal
- Perl
- Python
- Ruby
- Rust
- Scheme
- VB
(conj s x)
Works when s is a vector (not a list).
Example:
(conj [1 2 3] 4) => [1 2 3 4]
Example:
(conj [1 2 3] 4) => [1 2 3 4]
s ~= x;
s is a builtin array, which supports the cat assign operator
s.add(x);
real, allocatable, dimension(:) :: s
s = [s, x]
xs = s ++ [x]
This creates a new list xs
s = [...s, x];
s.push(x);
s is an array and x will be inserted at the end.
s[#s + 1] = x
Assuming that s is a contiguous array.
push @s, $x;
(reverse (cons x (reverse s)))
s.Add(x)