💾 Archived View for idiomdrottning.org › rope-irregex captured on 2023-09-08 at 16:37:43. Gemini links have been rewritten to link to archived content

View Raw

More Information

⬅️ Previous capture (2023-05-24)

-=-=-=-=-=-=-

An adapter between irregex and ropes

This Chicken Scheme extension, rope-irregex, provides two chunkers for irregex’s chunked API compatible with ropes from the ropes egg.

One is called rope-chunker, which is directly compatible with ropes, and the other saves a lot of CPU and memory, it’s called flat-chunker, and you get a rope->flat to wrap your rope with.

In other words, these two are equivalent:

(irregex-search/chunked "ana" rope-chunker (rope "banana"))
(irregex-search/chunked "ana" flat-chunker (rope->flat (rope "banana")))

The second way is faster than the first and also saves memory.

Either way, irregex-match-subchunk will return a flat list of rope leaves.

For source code,

git clone https://idiomdrottning.org/rope-irregex