New implementation

Be concise.

Be useful.

All contributions dictatorially edited by webmasters to match personal tastes.

Please do not paste any copyright violating resource.

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

Other implementations
with Ada.Containers.Vectors;
use Ada.Containers;
X.Reverse_Elements;
int *p1 = x;
int *p2 = x + N-1;

while (p1 < p2)
{
    int temp = *p1;
    *(p1++) = *p2;
    *(p2--) = temp;
}
(reverse x)
#include <algorithm>
std::reverse(begin(x), end(x));
System.Collections.Generic;
x.Reverse();
import std.range;
auto y = x.retro;
import std.algorithm;
reverse(x);
x.reversed.toList()
Enum.reverse(x)
list = [1, 2, 3, 4, 5]
Enum.reverse(list)
lists:reverse(List)
for i, j := 0, len(x)-1; i < j; i, j = i+1, j-1 {
	x[i], x[j] = x[j], x[i]
}
reverse x
x = x.reverse();
import java.util.Collections;
Collections.reverse(x);
import java.util.List;
static <T> void reverse(List<T> x){
	int n = x.size();
	for(int i=0;i<n/2;i++){
		T tmp = x.get(i);
		x.set(i, x.get(n-i-1));
		x.set(n-i-1, tmp);
	}
}
(reverse x)
rev = {}
for i=#x, 1, -1 do
	rev[#rev+1] = x[i]
end

-- in-situ reversal
function reverse(t)
  local n = #t
  local i = 1
  while i < n do
    t[i],t[n] = t[n],t[i]
    i = i + 1
    n = n - 1
  end
end
$x = array_reverse($x, true);
var n,i: integer;
[...]
n:= length(x);
setlength(x, n+1);
for i := 0 to (n div 2)-1 do
	begin
		x[n] := x[i];
		x[i] := x[n-i-1];
		x[n-i-1] := x[n];
	end;
setlength(x, n);
var n,i: integer;
	tmp:TElement;
[...]
n:= length(x);
for i := 0 to (n div 2)-1 do
	begin
		tmp := x[i];
		x[i] := x[n-i-1];
		x[n-i-1] := tmp;
	end;
my @list = ('words', 'of', 'list', 'a', 'reverse');
my @reversed = reverse @list;
x = x[::-1]
x = reversed(x)
x.reverse!
let y: Vec<_> = x.iter().rev().collect();
let mut x = vec![1,2,3];
x.reverse();
val items = List(1, 2, 3, 4, 5)
items.reverse
(reverse x)