2009-03-19から1日間の記事一覧

思い出したようにformatネタ

format/format4/format6は、内部表現stringのままらしい。Obj.magicで元の文字列を取り出せます。 # let fmt = ("%d" : ('a, 'b, 'c, 'd, 'e, 'f) format6);; val fmt : (int -> 'a, 'b, 'c, 'd, 'd, 'a) format6 = <abstr> # (Obj.magic fmt: string);; - : string</abstr>…

型計算は

まあ↓な感じでできるのでしょうけれど # type 'a num = unit;; type 'a num = unit # let incr ((): 'a num): ('a num) num = ();; val incr : 'a num -> 'a num num = <fun> # let zero: unit num = ();; val zero : unit num = () # let decr ((): 'a num num):</fun>…

めたぷろぐらみんぐ続き

英語版Wikipediaが自分の感覚に近いなあ。 http://twitter.com/kinaba/status/1348408180 ということで英語版Wikipediaを参照。 Metaprogramming is the writing of computer programs that write or manipulate other programs (or themselves) as their da…

肘を閉じて打つということを

Key

今更ながら、初めて理解しました!! たとえば、右手薬指で「.」を打ち、次に右手中指で「K」を打った直後の場合、・肘を開かずに打っていれば、右手人差し指が最短運指距離で打てるのは「J」になる。・肘を開いて打っていれば、右手人差し指が最短運指距離…