[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Safe user-facing pattern matching.
- From: Coda Highland <chighland@...>
- Date: Sun, 23 Apr 2017 10:01:26 -0700
On Sun, Apr 23, 2017 at 9:06 AM, Martin <email@example.com> wrote:
> Concerning pseudocode, how it will handle "(()()" string? Looks like
> it will return "()()" instead of first "()".
Yes. If that's wrong, that's my misunderstanding of the intended
behavior rather than a fundamental issue with the strategy.
> I think this may be fixed by expanding left each turn when <depth> was
> zero at start of turn. Also we should save <lastGoodRight> and
> <lastGoodLeft> each time when <depth> was zero at start of turn.
Yep, that's the way I'd do it too.