Logo

Programming-Idioms

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

Idiom #243 Print list

Print the contents of the list or array a on the standard output.

#include <algorithm>
#include <iostream>
#include <iterator>
std::copy(a.begin(), a.end(), std::ostream_iterator<int>(std::cout, "\n"));
a.ForEach(Console.WriteLine);
Console.WriteLine( string.Join(", ", a) );
print(a);
Enum.each(a, &IO.inspect/1)
write (*,*) a
import "fmt"
fmt.Println(a)
print a
console.log(a);
console.table(a);
import java.util.List;
System.out.println(a);
import java.util.Arrays;
System.out.println(Arrays.toString(a));
print(table.concat(a,", "))
print_r($a)
for el in a do writeln(el);
print "@items\n";
print join(', ', @items) . "\n";
print(a)
puts a.join(", ")
puts a
puts a * ", "
println!("{:?}", a)
(write a)

New implementation...