#!/usr/bin/perl # -*- mode: cperl; coding: utf-8; -*- use strict; use warnings; use utf8; use lib "/h/hamren/src/post/lib", "."; my $rval = do "common.pm" || die "$0: common.pm failed ($!) [$@]"; #--- Single-line common initializer #--- End of header my $class = "«class»"; my $module = "«module»"; my $AnagramFinder = em("AnagramFinder"); my $LetterReader = em("LetterReader" ); my $Word = em("Word" ); my $ML = em("ML" ); my $OCaml = em("OCaml" ); my $src; #unless ($src = do ("posts/anagram-f-77/commented-source.pl")) { # printf STDERR "couldn't parse file: $@" if $@; # printf STDERR "couldn't do file: $!" unless defined $src; # printf STDERR "couldn't run file: $!" unless $src; # exit; #} $src = scalar eval `cat posts/anagram-ml/commented-source-ml.pl`; post( header(), p(read_main_article("ML")), # p(read_cc_article()), p("This code is basically ML with some of the features of Objective Caml." ), p("There are two modules, $LetterReader, that does what it says,", " and $Word which is similar to the Word classes or modules in other anagram implementations. ", " There is also one class, $AnagramFinder.", " Finally there is the main program. "), p("A few identifiers have a leading underscore followed by a capital letter. ", " This circumvents the rule that prevents these identifiers from starting with an uppercase letter."), p("In ML it is possible, even encouraged, not to specify types for identifiers.", " The compiler does a very good job of deducing types.", " But I find code easier to read if the types are explicit,", " so the code below have many explicit type specification that could have been left out."), h2("Commented source code"), $src, a("end", ""), h2("Full source code"), source_file("./anagram.ml.source"), footer() ); __END__