Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

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

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.