chicken-hackers
[Top][All Lists]
Advanced

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

Re: [Chicken-hackers] [PATCH] Move some low-hanging fruit from posix.scm


From: Evan Hanson
Subject: Re: [Chicken-hackers] [PATCH] Move some low-hanging fruit from posix.scm to file.scm
Date: Sun, 2 Jul 2017 12:20:45 +1200

Looks good, pushed. Thanks Peter!

On 2017-06-14 22:14, Peter Bex wrote:
What should we do with ##sys#glob->regex?  I think it's useful
enough to expose to the user, which conveniently allows us to get
rid of the ##sys# prefix too.  But in which unit does it belong
the most?  Personally, I think file might make more sense, as
it's strictly not an irregex procedure, and it belongs with "glob".

On the other hand, it doesn't actually hit the file system; it's an
abstract operation over data-structures only, without any side effects.

I think it should stay in irregex. Glob patterns are generally useful,
and the procedure actually returns a regexp or SRE, so making it part of
the library that deals with those data types makes sense to me.

In fact, if we're going to expose it, I think it would be best to drop
the flag that changes its return type and make the procedure *always*
return an SRE. This is more flexible, matches the existing conversion
procedures like "string->sre" nicely, and the other behaviour is just
one `irregex` call away. Here's a patch that does this, let me know what
you think.

Cheers,

Evan

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]