On Tue, Dec 10, 2002 at 10:37:10PM -0700, Luke Palmer wrote:
> Why use regexen when you can just use junctions?
> 
>     my $foos = 'foo' ~ any(0..9) ~ any(0..9);

At what moment does a junction actually create all of its states?

Hmm...perhaps a clearer way to say that is "At what moment does a
junction allocate memory for, and initialize that memory with, all of
its states?"

I would hope that we could simply store the defining conditions of a
junction without having to generate all possible states at the moment
the junction is declared.  
optimizations.


< MODE="wild speculation" >

I wonder if junctions could support the following:

- lazy generation...when one of the calls (e.g. "any", "one") which
requires that only one value (or one value that satisfies the
condition) be generated, we would not need to generate the whole
list.  I would hope this would be the default, but I'm not assuming
anything. 

- the ability for the programmer to set "limiters" (??better name??)
on the junction, which will specify how the junction should
collapse--e.g. always collapse to the lowest/highest value that hasn't
been supplied yet, or to the lowest/highest unsupplied value that
causes a particular code block to return true, or whatever.

< /MODE >

--Dks

Reply via email to