束縛オブジェクトBinderをC#で実装してるなり。
↓こんなことができるよーになりますた。
// [C#]
using System;
using System.Collections.Generic;
using Orient; // 東方算体群(仮称)
class Prime {
static bool CanDivide(int x, int y) { return x % y == 0; } // xはyで割り切れる
static void Main(string[] args)
{
int N = 10000;
List<int> primes = new List<int>();
primes.Add(2);
Console.Write("{0,8}", 2);
for ( int i = 3; i < N; i += 2 ) {
// CanDivideの第一引数をiで束縛してSystem.Predicateを作る
if ( !primes.Exists(Function.Bind1stSystemPredicate(CanDivide, i)) ) {
primes.Add(i);
Console.Write("{0,8}", i);
}
Console.WriteLine();
}
}
}
いずれどこぞでお披露目せなあかんかな。WinDevMagかな(^^
# STL.NETまでの'しのぎ'っすねー