> Another Friday evening, another 105 lines of code.
>
> The two procedures documented below will be in the next release of scsh,
> for all you string hackers and Perl fans out there. I append the text from
> the manual, some examples, and the source (which is about twice as long
> and ugly as it should be, because I'm such a performance freak).
>
> I'd like to see how you convert "9/29/61" dates to "September 29, 1961"
> strings in tcl or Perl...
>
> Please take a look at these procedures. You have a *very* small window to
> influence the design before the release. Now's the time to flame me.
> -Olin
>
>
-------------------------------------------------------------------------------
> (regexp-substitute port match . items) -> string or undefined
>
[snippage]
>
-------------------------------------------------------------------------------
> (regexp-substitute/global port regexp string . items) -> string or
> undefined
>
[snippage]
>
A couple of thoughts.
1) Would it not be more flexible to have items passed as a list, rather than as
a series of arguments. That would make it easier to have it computed
dynamically by the program.
2) I was reading one of the other replies to your post, and there was the
complaint that matches are identified using integers, and that this was a bit
un-Scheme. In the RScheme implementation of regular expressions, the matches
are returned using multiple return values and so can be accessed using the
(bind ...) form. This allows the matches to be bound to variables in a lexical
environment, and accessed like any other variable. This seems a slightly higher
Scheme-ness quotient than integer identifiers; perhaps you could think about
something like this?
Regards
M.Beach
|