[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: "rx"



On Wed, Oct 16, 2013 at 11:48:32AM +1300, Evan Hanson wrote:
> The shift from "regexp" to "rx" partway through the API feels clumsy. To
> me, it signals a difference in meaning where AFAICT there isn't one.

Yeah, it bothered me as well, but I was unable to put a finger on the
exact problem and kept going back and fro about this issue.

> IMHO, the `rx-match` record type should rather be called "regexp-match",
> or simply "match".

Match would be acceptable.  If another module used match-blabla or match?,
it can always be renamed or prefixed through the module system.  OTOH, a
module, in general, shouldn't require or encourage gratuitous renaming.
Ideally, just importing several modules should rarely require the user to
perform manual renaming or prefixing of stuff.

> This would align the rx-* procedures with the rest of
> the API in clarity of names. (I recognize the collision on
> `regexp-match?`, but that procedure could instead be called
> "regexp-occurs?" or somesuch, which I'd argue is more descriptive
> anyway.)

+1

> I like irregex's example here, with its nice, explicit "irregex-match-"
> prefixes.

The main problem with irregex, as has been complained about out by
several people, is that it takes verbosity to an extreme.  This is
kind of annoying, as it pushes code to the right side of the screen way
too quickly, requiring additional care for indentation.

> (Sorry for what some might consider bikeshedding, but I do think good
> names matter.)

I agree whole-heartedly!

> P.S. Unrelatedly, I agree re: `<-` replacing `=>`.

See my other post :)

Cheers,
Peter
-- 
http://www.more-magic.net