Functional Grammar is fun (apparently)
Philip Potter
philip.g.potter at gmail.com
Wed Oct 20 12:27:29 BST 2010
On 19 October 2010 17:27, Nick <oinksocket at letterboxes.org> wrote:
> There's a growing trend for re-writing "99 Prolog Problems" for other languages.
>
> https://prof.ti.bfh.ch/hew1/informatik3/prolog/p-99/
>
> Googling for "ninety nine problems X" where X is your language of interest often
> finds something. e.g.:
>
> https://www.socialtext.net/perl5/index.cgi?99_problems
> http://www.haskell.org/haskellwiki/99_Haskell_exercises
> http://aperiodic.net/phil/scala/s-99/
http://github.com/perl6/perl6-examples/tree/master/99-problems has
some solutions for perl 6.
I'd recommend the arithmetic problems (P31 onwards) or the
miscellaneous problems (P90 onwards) to offer more usefully comparable
solutions between quite widely different languages.
The data-structure-based problems (lists, graphs, trees) have
different meanings and purposes in different languages. This causes
genuine comparison problems for, say, P04 (length of a list) -- in
Perl 5, Perl 6 and Scala standard solutions are "scalar @foo",
"@foo.elems", and "foo.length", but in Prolog, Haskell, Lisp and
friends the point of the exercise is to make an algorithm to manually
count elements in the list, not to just use a builtin to count it for
you; manipulating cons lists is an essential skill in Lispy languages
and requires practice.
Phil
More information about the london.pm
mailing list