Luke Palmer wrote: > > I'd like to go about implementing [Perl]?LazyArray and LazySequence > pmcs, possibly with a TiedArray (and Infinity) in the interim. I have > a few semantic questions, but first, here's what I have in mind: > > LazySequence: Manages individual lazy sequences like 1..Inf (or > even 1..100_000) > LazyArray: Aggregates multiple lazy things together, along > with an "exceptions list" for things like: > > @a = 1..Inf; > @a[6] = 42; > > First, do these work well as pmcs, or should it be integrated with > PerlArray (I hope not)? Should Infinity be a pmc? > > Any ideas on how these things should be set up at the assembly level? > I was thinking either: > > $P0 = new LazySequence > $P1 = new Infinity > $P0["from"] = 0 > $P0["to"] = $P1 > > or > > $P0 = new LazySequence > $P1 = new Infinity > find_method P0, "set_range" > .arg 0 # Assuming imcc knows the new conventions > .arg $P1 > invokecc > > Finally, what should things like: > > set $I0, $P0 # $P0 contains 1..Inf > > Because integer registers can't well store infinity...
This would probably have the same effect as: $P1 = new Infinity set $I0, $P1 Now, what *that* would do, I dunno... :) Actually, I sortof do -- it should throw an exception of some sort. -- $a=24;split//,240513;s/\B/ => /for@@=qw(ac ab bc ba cb ca );{push(@b,$a),($a-=6)^=1 for 2..$a/6x--$|;print "[EMAIL PROTECTED] ]\n";((6<=($a-=6))?$a+=$_[$a%6]-$a%6:($a=pop @b))&&redo;}