Hi all,

I noticed that chicken.irregex was missing from core-libraries-reorg,
and when looking more closely I saw that the module was exporting quite
a few procedures that expose internal details of the irregex
representation which are undocumented and might change at any moment.
So here's a patch to only export those identifiers that are actually
in the official documentation.

Cheers,
Peter
From 6774d6f104bb1dc1b99b72734274f720af26e043 Mon Sep 17 00:00:00 2001
From: Peter Bex <pe...@more-magic.net>
Date: Mon, 8 May 2017 19:41:05 +0200
Subject: [PATCH] Only export documented procedures from chicken.irregex

The chicken.irregex module exported lots of internal procedures that
are useless or even dangerous, like irregex-flags and
irregex-dfa/search.  This is confusing and results in an environment
with more identifiers than one would expect.
---
 irregex.scm | 38 +++++++++++++++++++++++++-------------
 1 file changed, 25 insertions(+), 13 deletions(-)

diff --git a/irregex.scm b/irregex.scm
index 2726ee3..aa7114a 100644
--- a/irregex.scm
+++ b/irregex.scm
@@ -31,19 +31,31 @@
   (fixnum))
 
 (module chicken.irregex
-  (irregex irregex-apply-match irregex-dfa irregex-dfa/search
-   irregex-extract irregex-flags irregex-fold irregex-fold/chunked
-   irregex-lengths irregex-match irregex-match? irregex-match-data?
-   irregex-match-end-chunk irregex-match-end-index irregex-match-names
-   irregex-match-num-submatches irregex-match-start-chunk
-   irregex-match-start-index irregex-match-subchunk
-   irregex-match-substring irregex-match-valid-index?
-   irregex-match/chunked irregex-names irregex-new-matches irregex-nfa
-   irregex-num-submatches irregex-opt irregex-quote irregex-replace
-   irregex-replace/all irregex-reset-matches! irregex-search
-   irregex-search/chunked irregex-search/matches irregex-split irregex?
-   make-irregex-chunker maybe-string->sre sre->irregex sre->string
-   string->irregex string->sre)
+    (;; Constructors, accessors and predicates
+     irregex irregex? string->sre maybe-string->sre sre->irregex
+     irregex-names irregex-num-submatches string->irregex
+
+     ;; Chunking constructor
+     make-irregex-chunker
+
+     ;; Main API
+     irregex-extract irregex-fold irregex-match irregex-match?
+     irregex-search irregex-split irregex-replace irregex-replace/all
+
+     ;; Chunked main API
+     irregex-fold/chunked irregex-match/chunked irregex-search/chunked
+
+     ;; Match extraction API
+     irregex-match-data? irregex-match-names
+     irregex-match-start-index irregex-match-end-index
+     irregex-match-num-submatches irregex-match-substring
+     irregex-match-valid-index?
+
+     ;; Chunked match API
+     irregex-match-start-chunk irregex-match-subchunk
+
+     ;; Utilities
+     sre->string irregex-opt irregex-quote)
 
 (import scheme chicken)
 
-- 
2.1.4

Attachment: signature.asc
Description: Digital signature

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

Reply via email to