Version française
Home     About     Download     Resources     Contact us    
Browse thread
substring match like "strstr"
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Chris Hecker <checker@d...>
Subject: Re: substring match like "strstr"

>The file strstr.c is included below for your edification.  I'd argue
>that any Caml version is likely to a be a wee bit easier to
>understand.

Okay, so here's a new challenge:  write the most readable strstr you can in ocaml.  The restriction is you have to actually implement the algorithm, not just call the regex library.  :)

What is the most functional and readable one we can come up with?  And then we'll compare its performance and see if the readable/performance curve is appropriate.  Eijiro's was relatively short and functional, but still not completely transparent.  My imperative one sucks for readability because of all the references and variables.

Chris