This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use strict; | |
use warnings; | |
use utf8; | |
foreach my $item (keys %ENV) { | |
print "$item => $ENV{$item}\n"; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use strict; | |
use warnings; | |
use utf8; | |
use Data::Dumper; | |
use Text::CSV_XS; | |
binmode STDOUT, ":utf8"; | |
my $csv = Text::CSV_XS->new({binary=>1}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Dashのチートシートを作成するファイルの書き方メモ・翻訳 | |
# 元サンプルコード https://github.com/Kapeli/cheatset#readme | |
cheatsheet do | |
title 'サンプル' # リストに表示される名前 | |
docset_file_name 'Sample' # ファイル名 | |
keyword 'sample' # キーワード | |
introduction 'イカしたチートシート'# MarkdownやHTMLでも可 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ brew install ocaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# "あ" ;; | |
- : string = "\164\162" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
LANG=en_US.ISO8859-1 ocaml | |
OCaml version 4.02.1 | |
# "あ" ;; | |
- : string = "あ" | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(* --- 問題2.1 --- *) | |
# 7 - 3 * 4 ;; | |
- : int = -5 | |
(* 乗除算の順序は交換可能だが整数型なので *) | |
(* 7 / 2 は 3と評価ので,以下の2式の結果は異なる *) | |
# 7 / 2 * 2 ;; | |
- : int = 6 | |
# 7 * 2 / 2 ;; | |
- : int = 7 | |
(* --- 問題2.2 --- *) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 1.0 /. infinity ;; | |
- : float = 0. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(* --- 問題3.1 --- *) | |
# let e = 2.7182 ;; | |
val e : float = 2.7182 | |
# let positive = e > 0.0 ;; | |
val positive : bool = true | |
# let seconds_of_day = 60 * 60 * 24 ;; | |
val seconds_of_day : int = 86400 | |
(* みょうがだにと読む *) | |
(* 著者が所属するお茶の水女子大学に近いからか *) | |
# let name = "茗荷谷駅" ;; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# let t1 x = x + 1 ;; | |
val t1 : int -> int = <fun> | |
# let t2 x = x + 2 ;; | |
val t2 : int -> int = <fun> | |
# let t3 x = x + 3 ;; | |
val t3 : int -> int = <fun> | |
# t1 t2 t3 5 ;; | |
Error: This function has type int -> int | |
It is applied to too many arguments; maybe you forgot a `;'. | |
# t1 (t2 (t3 5)) ;; |
OlderNewer