Re: [svn:perl6-synopsis] r14385 - doc/trunk/design/syn
On 4/27/07, Larry Wall <[EMAIL PROTECTED]> wrote: : Are you sure you want to guarantee left-to-right starting : position order? If there are multiple processors available, and : in a lazy context, it may be preferrable to not guarantee any : order. Then, if one processor that starts at a later position : but which finds a match quickly while another processor starts : earlier but needs to take a lot longer to find its first match, : the lazy processing can start working on the first match found : at the earliest possible time. No, I'm not sure, which is why I put in the conjectures. :-) Right. It's a tricky issue from an implementation standpoint. A backtracking NFA most naturally implements it in left-to-right starting position order, whereas a DFA most naturally implements it in left-to-right *ending* position order. Hmm, do we have lazy sets? Luke
Re: [svn:perl6-synopsis] r14385 - doc/trunk/design/syn
On Fri, Apr 27, 2007 at 03:57:41PM -0400, John Macdonald wrote: : On Fri, Apr 27, 2007 at 08:46:04AM -0700, [EMAIL PROTECTED] wrote: : > +The matches are guaranteed to be returned in left-to-right order with : > +respect to the starting positions. The order within each starting : > +position is not guaranteed and may depend on the nature of both the : > +pattern and the matching engine. (Conjecture: or we could enforce : > +backtracking engine semantics. Or we could guarantee no order at all : > +unless the pattern starts with "::" or some such to suppress DFAish : > +solutions.) : : Are you sure you want to guarantee left-to-right starting : position order? If there are multiple processors available, and : in a lazy context, it may be preferrable to not guarantee any : order. Then, if one processor that starts at a later position : but which finds a match quickly while another processor starts : earlier but needs to take a lot longer to find its first match, : the lazy processing can start working on the first match found : at the earliest possible time. No, I'm not sure, which is why I put in the conjectures. :-) Larry
Re: [svn:perl6-synopsis] r14385 - doc/trunk/design/syn
On Fri, Apr 27, 2007 at 08:46:04AM -0700, [EMAIL PROTECTED] wrote: > +The matches are guaranteed to be returned in left-to-right order with > +respect to the starting positions. The order within each starting > +position is not guaranteed and may depend on the nature of both the > +pattern and the matching engine. (Conjecture: or we could enforce > +backtracking engine semantics. Or we could guarantee no order at all > +unless the pattern starts with "::" or some such to suppress DFAish > +solutions.) Are you sure you want to guarantee left-to-right starting position order? If there are multiple processors available, and in a lazy context, it may be preferrable to not guarantee any order. Then, if one processor that starts at a later position but which finds a match quickly while another processor starts earlier but needs to take a lot longer to find its first match, the lazy processing can start working on the first match found at the earliest possible time. --