F#で試してみた
F#つーかOCamlつーかどっちでもいいけどどっちも全然わからねー。
書くの大変すぎる。つーかOCamlがハイライトに対応してるのがおどろき。
#light open System open System.Windows.Forms open Printf type Form1 = inherit Form as base new () as this = { } then this.Text <- "Form1" this.Name <- this.Text this.SuspendLayout() let button1 = new Button() button1.Text <- "button1" button1.Name <- button1.Text button1.UseVisualStyleBackColor <- true button1.Click.Add(fun e -> printf "click!\n") this.Controls.Add(button1) this.ResumeLayout() override this.Dispose(disposing) = printf("dispose\n") base.Dispose(disposing) #if COMPILED [<STAThread>] do Application.EnableVisualStyles() Application.SetCompatibleTextRenderingDefault(false) Application.Run(new Form1()) #endif
んで、これも動きますね。IronRubyだけoverrideが無理なんだな。
か、無理じゃなくてやり方の問題なのか。