<div>Hi racket folk, lisp neophyte here (just finished HTDP),</div><div><br></div><div>I would like to use Haskell-style strings in my racket, where a string is defined as either '() or (cons character string), and is read from and displayed by values enclosed by double quotes.</div>
<div><br></div><div>i.e: "string" is understood as '(#\s #\t #\r #\i #\n #\g) and '(#\s #\t #\r #\i #\n #\g) is displayed as "string".</div><div><br></div><div>.. so one could do, for example (car "string") => #\s, or (cdr "string") => "tring" etc.</div>
<div><br></div>I've made altered versions of the basic list processing functions that act differently when given strings or lists, so they achieve this, but at the cost of a lot of runtime checks.<div><br></div><div>For a better approach I suspect one would need to deal with the 'reader,' but looking at the documentation, it seems a bit beyond my current understanding. </div>
<div><br></div><div>Has anyone else seen or built a language extension that achieves this, or could anyone point me to some next-step resources that will bring me up to the level where I can understand the reader documentation? Or is my enterprise here misguided?<br clear="all">
<div><br></div><div>Many thanks</div><div><br></div>-- <br>Tim Farland<br><a href="mailto:e%3Atwfarland@gmail.com" target="_blank">e:twfarland@gmail.com</a><br>
</div>