View Problem

Define a static list

Define the list [One, Two, Three, Four, Five]
ExpandDiskEdit
ruby
list = ['One', 'Two', 'Three', 'Four', 'Five']
ExpandDiskEdit
ruby
list = %w(One Two Three Four Five)
DiskEdit
csharp
IList<string> list = new string[]{"One","Two","Three","Four","Five"};
DiskEdit
clojure
(def a '[One Two Three Four Five])
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";
ExpandDiskEdit
fantom
list := ["One", "Two", "Three", "Four", "Five"]

Submit a new solution for ruby, csharp, clojure, cpp ...
There are 25 other solutions in additional languages (erlang, fsharp, go, groovy ...)