Hi Caolan,

thanks for the egg, much needed addition (though I would like to see
it in the posix module rather than a separate egg). I used to
workaround (the lack of) it through ##sys#glob->regexp which is
another function I would like to be explicitly supported in core.

A few suggestions if you care:

1) Return the actual path rather than #t

(filter
  string?
  (map (lambda (x)
         (fnmatch "[^b].scm" x)) '("a.scm" "b.scm" "c.scm")))

=> ("a.scm" "c.scm")

2) Add Windows support through the very similar win32 function PathMatchSpecEx

3) Drop the utf8 requirement

Regards,
Michele

On Sun, Jul 27, 2014 at 12:54 PM, Caolan McMahon
<caolan.mcma...@gmail.com> wrote:
> I've just written some bindings to fnmatch(3), which provides
> shell-style wildcard pattern matching for filenames. Much like `glob`
> from the posix module, only it matches two strings, returning a
> boolean rather than descending directories and returning a list of
> matching filenames.
>
> https://github.com/caolan/chicken-fnmatch
>
> This is fairly trivial, but doesn't appear to be available anywhere
> else on the egg index. If someone could add it I'd appreciate it.
>
> Thanks,
>
> Caolan
>
> _______________________________________________
> Chicken-users mailing list
> Chicken-users@nongnu.org
> https://lists.nongnu.org/mailman/listinfo/chicken-users

_______________________________________________
Chicken-users mailing list
Chicken-users@nongnu.org
https://lists.nongnu.org/mailman/listinfo/chicken-users

Reply via email to