Eigenpoll : D wish list : Relational class/array algebra
Example 1: Peter is friend of everyone named "Andrew"
Person peter = new Person("Peter",18);
people[name=="Andrew"].friends ~= peter;
Example 2: Do something with people named "Andrew" when they are friend of people greater than 18 and marriend
foreach(Person someone; peope[age>=18 && married].friends[name=="Andrew"]) {
someone.doSomething();
}
Example 3: Do someting with people whose some friends are greater than 18 and called Andrew
foreach( Person someone; people[friends[age>18 && name=="Andrew"].length!=0]) {
someone.doSomething();
}
Example 3: Select people friends of Andrew.
Person andrew;
...
Person[] AndrewFriends = people[FriendsOf(andrew)];
Report this item for cleanup