View Problem

Define a static list

Define the list [One, Two, Three, Four, Five]
DiskEdit
python
list = ['One', 'Two', 'Three', 'Four', 'Five']
print list
DiskEdit
clojure
(def a '[One Two Three Four Five])
DiskEdit
clojure
(def a (list "One" "Two" "Three" "Four" "Five"))
ExpandDiskEdit
fsharp
let list = ["One"; "Two"; "Three"; "Four"; "Five"]
ExpandDiskEdit
fsharp
let list = (new Generic.LinkedList<string>([|"One"; "Two"; "Three"; "Four"; "Five"|]))
ExpandDiskEdit
fsharp
let list = (new Generic.LinkedList<string>())

list.AddFirst("One") ; list.AddLast("Five") ; list.AddBefore(list.Find("Five"), "Four")
list.AddAfter(list.Find("One"), "Two") ; list.AddAfter(list.Find("Two"), "Three")
ExpandDiskEdit
fsharp
let list = (new Generic.List<string>())

[|"One"; "Two"; "Three"; "Four"; "Five"|] |> Array.iter (fun x -> list.Add(x))
ExpandDiskEdit
cpp C++/CLI .NET 2.0
array<String^>^ input = {"One", "Two", "Three", "Four", "Five"};
Generic::List<String^>^ list = gcnew Generic::List<String^>((Generic::IEnumerable<String^>^) input);
ExpandDiskEdit
cpp C++/CLI .NET 2.0
Generic::List<String^>^ list = gcnew Generic::List<String^>();

list->Add("One");
list->Add("Two");
list->Add("Three");
list->Add("Four");
list->Add("Five");
ExpandDiskEdit
cpp
std::string input[] = {"One", "Two", "Three", "Four", "Five"};
std::list<std::string> list(input, input + 5);
ExpandDiskEdit
cpp
std::list<std::string> list;

list.push_back("One");
list.push_back("Two");
list.push_back("Three");
list.push_back("Four");
list.push_back("Five");
ExpandDiskEdit
cpp C++0x/C++11
list<string> lst = { "One", "Two", "Three", "Four", "Five" };
ExpandDiskEdit
cpp boost
list<string> lst;
lst += "One", "Two", "Three", "Four", "Five";

Submit a new solution for python, clojure, fsharp, or cpp
There are 24 other solutions in additional languages (csharp, erlang, fantom, go ...)