This language bar is your friend. Select your favorite languages!

Idiom #117 Get list size

Set n to the number of elements of list x.

Illustration
n = Enum.count(x)
with Ada.Containers.Vectors;
use Ada.Containers;
N : Count_Type := X.Length;
size_t n = sizeof(x)/sizeof(*x);
size_t n = x.size();
int n = x.Length;
using System.Collections.Generic;
int n = x.Count;
auto n = x.length;
1
import std.range.primitives;
n = walkLength(x);
1
N = length(X).
n := len(x)
n = length x
var n = x.length;
int n = x.length;
int n = x.size();
(setf n (length x))
local n = #x
$n = count($x);
n := length(x);
my $N = @x;
n = len(x)
n = x.length
let n = x.len();

val n = x.size
(define n (length x))

Do you know the best way to do this in your language ?
New implementation...

Idiom created by

programming-idioms.org