- 追加された行はこの色です。
- 削除された行はこの色です。
#contents
* 型クラスがあるC言語!? [#h5b86e1f]
- [[Jekyll:http://jekyllc.sourceforge.net/index.html]]
>Jekyll is a high-level language that can be losslessly translated to and from readable editable C. This allows it to be used in C projects, with C programmers, C libraries, and C tools.
がしがし書いてください
#comment
#ls(ネタ記録庫)
* Compiling Scheme to JavaScript [#p1b71405]
- http://hop.inria.fr/usr/local/share/hop/weblets/home/articles/scheme2js/article.html
- 夏休み中に、Hopを試してみるつもりです。 -- [[げんま]] &new{2006-08-10 (木) 09:39:32};
- [[http://calculist.blogspot.com/2006/08/compiling-to-javascript.html: Compiling to JavaScript]]いろんな言語で、Javascriptへのコンパイルが模索されているらしい。 -- [[げんま]] &new{2006-08-26 (土) 10:22:24};
- Scheme2jsを使って、テトリスを書いてみました。http://www.geocities.jp/teruakigemma/scheme2js/demo.html -- [[げんま]] &new{2006-09-02 (土) 21:10:45};
- sugeeeeee! -- [[Keigo]] &new{2006-09-04 (月) 16:55:31};
- あれ、IEだとキー入力ができないです。Firefoxでならできてたんです。 -- [[げんま]] &new{2006-09-04 (月) 21:23:40};
- Safari(MacOSX)ではOK。ところで勉強会には来れません? -- [[けいご]] &new{2006-09-04 (月) 21:56:00};
#comment
* Proof are Programs [#fca44cec]
- http://www.radiumsoftware.com/0605.html#060523
- Philip Wadler. [[Proofs are Programs: 19th Century Logic and 21st Century Computing:http://homepages.inf.ed.ac.uk/wadler/papers/frege/frege.pdf]]
- 数理論理学とコンピュータ・プログラムの間には深い関連性がある。この論文では,近代論理学の開祖であるフレーゲの概念記法を出発点として,ゲンツェンの自然演繹 と,チャーチの型付きラムダ計算の二つの流れを追い,最終的にそれらのモデルがカリー・ハワード対応によって同型として対応付けられるところまでを辿る。
* History of Haskell [#z4d010cb]
- http://haskell.org/haskellwiki/History_of_Haskell
- HOPL'07に提出する予定の論文の、ドラフトだそうです。
#comment
* Functional Reactive Programming [#i4d505da]
- http://www.haskell.org/frp/
- LL3での、"Functional Reactive Programming in Scheme"の発表者、 Gregory Cooper氏のホームページ http://www.cs.brown.edu/~greg/
#comment
* roguelike in ocaml [#o7afaf8c]
(今井) http://cristal.inria.fr/%7Eddr/mlrogue/
- おぉーー! -- [[源馬]] &new{2006-07-13 (木) 03:12:06};
#comment
* 尋ね人 [#sdf98c23]
- 場違いな質問で恐縮ですが、ご存じありませんか? 名大の方みたいなんですが。
- http://www.ice.nuie.nagoya-u.ac.jp/~h003149b/lang/index.html -- [[源馬]] &new{2006-07-11 (火) 04:30:06};
- その人、気になりますよね。私と同い年です。元坂部研という噂。ただ、私は情報工学の人間ではなかったので、知りません。末ちゃんなら知ってると思う。 -- 今井
- たくさん興味深いことを書かれているので、続きを読みたい! -- [[源馬]] &new{2006-07-13 (木) 03:18:14};
- 確かに同級生のようです.ただ名前が無いので誰だか分からない。。。 -- [[末次]] &new{2006-08-10 (木) 21:59:55};
- 名字は"水野"だそうです。そこまでなんとか掴みました。 -- [[末次]] &new{2006-08-10 (木) 22:10:37};
- "水野"で坂部研なら水野 清貴君かな? かなり当てずっぽうです.信憑性はありません. -- [[末次]] &new{2006-08-10 (木) 22:13:33};
- 違うよ。そうじゃなくて…僕らがB4の時の坂部研だったはず -- [[けいご]] &new{2006-08-11 (金) 12:07:11};
- M1になってはじめに聞いたのが彼の行方だったのだけど(明らかに先を越されていたから)、確か末ちゃんその時は教えてくれたような… -- [[けいご]] &new{2006-08-11 (金) 12:09:11};
- [[はてなブックマークでもそれなりに人気が:http://b.hatena.ne.jp/entrylist?url=http%3A%2F%2Fwww.ice.nuie.nagoya-u.ac.jp%2F]] -- [[けいご]] &new{2006-08-11 (金) 12:28:46};
#comment
*[[AA折れ線グラフ:http://oss.timedia.co.jp/index.fcgi/kahua-web/show/column/%ba%a3%c6%fc%a4%ce%b0%ec%b9%d4/%a3%b2%a3%b0%a3%b0%a3%b6%c7%af%a3%b3%b7%ee#H-1bpntk8]] [#j83662b2]
>AAで折れ線グラフを書くというお題.
>入力は'R','F','C'の3種類も文字からなる長さ1以上の文字列
>'R'は上昇を表し,折れ線グラフの要素としては '/' (スラッシュ)1文字に対応
>'F'は下降を表し,折れ線グラフの要素としては '?' (バックスラッシュ)1文字に対応
>'C'は変化なしを表し,折れ線グラフの要素としては'_'(アンダスコア)1文字に対応
>たとえば,
$ ./plot RCRFCRFFCCRFFRRCRRCCFRFRFF
>とすると
__
/ ?/?/?
_/?_/? _/ ?
/ ?__/? /
?/
>が出力されるようなスクリプトを書け.
> --nobsun
源馬のSchemeでの回答はこちら。~
http://www.shiro.dreamhost.com/scheme/wiliki/wiliki.cgi?gemma -- [[源馬]] &new{2006-07-01 (土) 12:00:06};
**解答 in Haskell [#nd70223e]
下村です。
無駄に長い上に汚いですけど…。
output str =
let result = graph str
output' :: [String] -> IO ()
output' mat =
if any null mat then return ()
else do if any (' '/=) h then putStrLn h
else return ()
output' t
where
h = map head mat
t = map tail mat
in
output' result
graph :: String -> [String]
graph str =
let
height = (length str) * 2
graph' [] _ = []
graph' (x:xs) pos =
case x of
'R' -> oneline (pos) '/' height : graph' xs (pos-1)
'F' -> oneline (pos+1) '??' height : graph' xs (pos+1)
'C' -> oneline pos '_' height : graph' xs pos
in
graph' str (length str)
-- n番目の文字がcであるような、長さlの文字列を生成する
oneline :: Int -> Char -> Int -> String
oneline _ _ 0 = ""
oneline n c l = (if n==0 then c else ' ') : oneline (n-1) c (l-1)
で、結果は…
Main> output "RCRFCRFFCCRFFRRCRRCCFRFRFF"
__
/ ?/?/?
_/?_/? _/ ?
/ ?__/? /
?/
Main>
**解答 in OCaml [#yc2d1595]
また下村です。OCamlで書き換えたので書いときます。Haskell版より関数とかをちょっと整理しました。あと、文字列はコマンドライン引数で指定するようにしてあります。explodeとimplodeは拡張ライブラリ関数なので、コンパイルするためにはExtLibをインストールする必要があります。
(* <<COMPILE>> "ocamlopt -I +extlib extlib.cmxa lineGraph.ml" *)
open ExtString.String;;
open List;;
exception NotRFC;;
let any = List.fold_left (or) false;;
let graph charlist =
let height = (length charlist) * 2 in
let rec transpose mat = if any (map (fun x -> x=[]) mat)
then []
else map hd mat :: transpose (map tl mat) in
let rec oneline n c l = if l=0
then []
else (if n=0 then c else ' ') :: oneline (n-1) c (l-1) in
let rec graph' charlist pos =
match charlist with
[] -> []
| c::cs -> match c with
'R' -> oneline (pos) '/' height :: graph' cs (pos-1)
| 'F' -> oneline (pos+1) '??' height :: graph' cs (pos+1)
| 'C' -> oneline pos '_' height :: graph' cs pos
| otherwise -> raise NotRFC
in
transpose (graph' charlist (length charlist));;
let output =
try
let result =
map (fun l -> if any (map (fun x -> x<>' ') l)
then implode l ^ "?n" else "")
(graph (explode Sys.argv.(1))) in
let rec output' list = match list with
[] -> ()
| (""::ls) -> output' ls
| (l::ls) -> print_string l;
output' ls in
output' result
with
NotRFC ->
print_string ("Usage : " ^ Sys.argv.(0) ^ " [RFC]*?n")
| Invalid_argument _ ->
print_string ("Usage : " ^ Sys.argv.(0) ^ " [RFC]*?n");;
実行結果は…
mac{sho}% ./a.out RCRFCRFFCCRFFRRCRRCCFRFRFF [~/src/ocaml]
__
/ ?/?/?
_/?_/? _/ ?
/ ?__/? /
?/
mac{sho}% [~/src/ocaml]
- Ocamlがわかってないので、おぼろげにしかわからないです。なんかすごい。今度、教えてください。 -- [[源馬]] &new{2006-07-04 (火) 03:35:28};
#comment
* HaskellでOS。 [#s0a682d7]
http://www.cse.ogi.edu/~hallgren/House/ -- [[源馬]] &new{2006-07-04 (火) 16:16:05};
*The Evolution of a Haskell Programmer [#ga1c48ba]
[[The Evolution of a Haskell Programmer:http://www.willamette.edu/~fruehr/haskell/evolution.html]] かなりハイレベルにバカやってる感じ
- バカだ〜!fold関数使うまではわかるけど、その後が!まだまだまだまだ続くし。 -- [[げんま]] &new{2006-08-12 (土) 10:35:43};
- インタプリタを作って階乗計算させたり,型クラスを使ったテクニックなんかもあるので分かると結構良いかも。 -- [[けいご]] &new{2006-08-12 (土) 15:27:52};
#comment