LANGUAGE | スカ友 | 俺、関東の国王だけど
VM を作りました (x86 ではない!) + ASM
UIライブラリ(2D)を作りました | 4Dエンジン (画像)
虫は宇宙人です | 人類の品種 | 言葉の起源
日本語は海豚の言葉に由来します | ペンギン(ウルトラマン)
こんな日本語の文字を考案しました(画像) | こんな人工言語を作りました
 1 2 3
0   関東の国王      2019年1月13日 日 14:34
public delegate T _For_FAdd<T>(T a, T b);
public delegate T _For_FElem<I, T>(I i);

public static T For<T>(int from, int to, _For_FAdd<T> fAdd, _For_FElem<int, T> fElem)
   if (from > to)
       throw new Exception();

   T ret = fElem(from);

   for (int i = from + 1; i <= to; i++)
       ret = fAdd(ret, fElem(i));

   return ret;






さらに、もっと複雑なのを考えましょう。文字列同士が ", " で繋がっている、たとえば、ある配列を表す文字列を作成したい場合:
たとえば to_str(x[0]) + "," + to_str(x[1]) + "," +  ... + "," + to_str(x[n-1]) は:


そして、その計算は、冒頭で定義した For を用いれば:
For(0, n-1, (a, b) => a + "," + b, i => to_str(x[i]));


open System.Collections.Generic
open System.Windows.Forms

let For<'T> from to_ (fAdd : 'T -> 'T -> 'T) (fElem : int -> 'T) =
   if from > to_ then raise (new System.Exception())
   let mutable ret = fElem from
   for i = from + 1 to to_ do
       ret <- fAdd ret (fElem i)

let Each<'T, 'R> (X : 'T[]) (f : 'T -> 'R) =
   let Y = Array.create (X.Length) (f (X.[0]))
   for i = 0 to X.Length - 1 do
       Y.[i] <- f (X.[i])

let Each'<'T, 'R> (X : List<'T>) (f : 'T -> 'R) =
   let Y = new List<'R>(X.Count)
   for i = 0 to X.Count - 1 do
       Y.Add (f (X.[i]))

let y = For 0 9 (fun a b -> a + "," + b) (fun i -> i.ToString())
ignore (MessageBox.Show y)

let X = [|1; 2; 3|]
let Y = Each X (fun x -> x * 10)
ignore (MessageBox.Show (Y.[0].ToString() + "," + Y.[1].ToString() + "," + Y.[2].ToString()))

let X' = new List<int>([1; 2; 3])
let Y' = Each' X' (fun x -> x * 10)
ignore (MessageBox.Show (Y'.[0].ToString() + "," + Y'.[1].ToString() + "," + Y'.[2].ToString()))
この記事は 2020年8月4日 火 14:28 に作者によって編集されました
1   関東の国王      2019年2月6日 水 22:17
2   関東の国王      2020年2月29日 土 23:34
3   関東の国王      2020年7月17日 金 14:59
4   xbxilyhmb      2020年10月23日 金 1:06
ある強力なFor関数を紹介いたします(C#バー) - アルファ・ラボ|学術掲示板群
<a href="">axbxilyhmb</a>
5   Footbath      2020年10月28日 水 14:05
6   Product      2020年11月10日 火 2:06
7   Carnival      2020年11月10日 火 4:32
8   A48660      2021年1月7日 木 6:25
<a href="">Free Standing Table Mirror Supplier</a>
<a href="">シャネル財布コピー</a>
9   W7100018      2021年1月10日 日 12:38
10   WAT1414BA0954      2021年1月17日 日 12:14
<a href="">Girija Ferro Alloy</a>
<a href="">スーパーコピータグ?ホイヤー</a>
11   436988I86L08650      2021年1月19日 火 4:17
12   Q1258420      2021年1月20日 水 2:30
<a href="">Floor Cleaning Machine Brush</a>
<a href="">ジャガールクルトマスターコピー</a>
13   supreme      2021年1月21日 木 14:00
I intended to draft you this tiny word to finally say thanks over again relating to the extraordinary tips you've shown at this time. It was really strangely generous of people like you in giving unreservedly all that a few individuals could have marketed as an electronic book to end up making some money on their own, primarily now that you could have done it if you ever decided. These concepts likewise served like a easy way to fully grasp the rest have the identical keenness much like my own to find out a whole lot more concerning this condition. I am sure there are many more fun instances ahead for people who looked over your website.
14   longchamp      2021年1月21日 木 14:01
I actually wanted to write down a small note so as to say thanks to you for these marvelous hints you are writing here. My extended internet search has now been compensated with reliable facts and techniques to share with my good friends. I 'd suppose that most of us visitors are extremely lucky to live in a decent network with  many marvellous professionals with good principles. I feel truly blessed to have encountered your website page and look forward to really more entertaining times reading here. Thanks once more for all the details.
15   yeezys      2021年1月21日 木 14:01
My wife and i felt now relieved  Ervin could finish up his web research with the ideas he had in your blog. It's not at all simplistic to simply be freely giving hints that most people have been selling. We really do know we have got you to be grateful to for that. The entire explanations you have made, the simple blog menu, the relationships you will help instill - it is mostly astonishing, and it's really helping our son and us do think the subject matter is brilliant, and that is particularly indispensable. Thank you for everything!
16   IW378509      2021年1月28日 木 0:31
17   11395F1100062270      2021年1月31日 日 0:42
<a href="">End Dump Trailer Parts</a>
<a href="">ロエベ財布?小物</a>
18   1M1132ZTM505      2021年2月1日 月 0:35
<a href="">Bucket Elevator Conveying Machine</a>
<a href="">スーパーコピープラダ</a>
19   balenciaga      2021年2月9日 火 8:09
I precisely wished to thank you so much yet again. I do not know the things that I could possibly have sorted out in the absence of those basics revealed by you concerning such field. This was an absolute challenging problem for me personally, but understanding this expert strategy you managed the issue took me to jump over contentment. I'm grateful for this service as well as pray you find out what a great job you were putting in teaching many others all through a web site. Probably you have never got to know any of us.
 1 2 3
ヒント: 日本人はもともと中国大陸に住んでいました
名前      編集用パスワード(省略可)    パスワードの記憶
数式 αβγ IPA http:// 画像 B I U
(添付ファイルは にアップロードしてください)