> Is there a better way ? Would simple_or_sequence(:x) or whatever(:x) as 
> captures make sense ?

Hei John,

Welcome to this list! We already have logic that makes

   something.maybe

either return something or nil. And

   something.repeat(...)

will return an array either way (even if 0 matches). Now (naively said) 
we need the same thing for

   string.repeat(0)

to return '' (empty string) when no match succeeds.

The implementation idea is that we produce the output the programmer 
probably wants and simplify his transformations at the source. I'll open 
an issue for this - I absolutely want this to be really simple for the 
API user.

regards,
kaspar



Reply via email to