In C# I can declare a list declaratively, in other words declare its structure and initialise it at the same time as follows:
var users = new List<User>
{
new User {Name = "tom", Age = 12},
new User {Name = "bill", Age = 23}
};
Ignoring the differences between a List in .Net and a List in Scala (ie, feel free to use a different collection type), is it possible to do something similar in Scala 2.8?
UPDATE
Adapting Thomas' code from below I believe this is the nearest equivalent to the C# code shown:
class User(var name: String = "", var age: Int = 0)
val users = List(
new User(name = "tom", age = 12),
new User(name = "bill", age = 23))
<User>
? Can't C# infer the generic type of List from the "contents"?