Skip to content

Instantly share code, notes, and snippets.

@akanehara
Last active December 14, 2017 17:42
Show Gist options
  • Select an option

  • Save akanehara/3507ed4bcc94339aa1fb to your computer and use it in GitHub Desktop.

Select an option

Save akanehara/3507ed4bcc94339aa1fb to your computer and use it in GitHub Desktop.
『プログラミングの基礎』社内読書会 #0

#『プログラミングの基礎』社内読書会 #0

処理系のインストール

Mac, Linux

http://opam.ocaml.org/doc/Quick_Install.html

Windows / Cygwin

setup.exe から OCaml をパッケージインストール

rlwrap

必須ではありませんがインタプリタが使いやすくなります

Mac

$ brew install rlwrap

Linux

$ sudo apt-get install rlwrap
$ sudo yum -y install rlwrap

Windows / Cygwin

setup.exe から rlwrap をパッケージインストール

つかいかた

$ rlwrap ocaml

エイリアスすればいいとおもいます

alias ocaml='rlwrap ocaml'

動いた?

ヽ(゚ー゚*ヽ)ヽ(*゚ー゚*)ノ(ノ*゚ー゚)ノ

% ocaml
        OCaml version 4.01.0

# 1 + 1;;
- : int = 2
# _

ニホンゴ

本には「漢字コードはEUCを使ってください」とありますが、この読書会ではUTF-8を使いましょう。

$HOME/.ocamlinit を次の内容で保存すればインタプリタで日本語が表示できるようになります。

let printer ppf = Format.fprintf ppf "\"%s\"";;
#install_printer printer;;

読書会のすすめかた

  • 進行役が章のおさらい
    (途中での質問・つっこみ・補足説明OK)

  • 練習問題もくもく

  • 回答みせあいっこ

  • オリジナル練習問題(あれば)

リンク

http://pllab.is.ocha.ac.jp/~asai/book-mov/

http://ocaml.org/learn/tutorials/index.ja.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment