2005-10-24から1日間の記事一覧

Perl Contains the Lambda-Calculus

http://perl.plover.com/lambda/ Perl でλ計算。 λ計算のチュートリアルとかもある。

Higher-Order Perl

http://hop.perl.plover.com/ Perl で関数プログラミングの本。 全文が Wiki に載せられる予定らしい。 HOP will be freeMy contract says that after the book is published I can distribute the complete text from my web site. The content of my book …

Perl で fold

sub fold(&@) { my($f, @list) = @_; my $s = shift @list; while ( scalar @list ) { $s = $f->($s, shift @list); } return $s; } my $sum = fold { $_[0] + $_[1] } (1, 2, 3, 4, 5); のようにして使う。 my $mean = 1 / fold { $_[0] + $_[1] } map 1/$_,…