Hi,
Luke Palmer wrote:
>> ...which makes me wonder if it'd be good|cool|whatever to not only
>> have lazy lists, but also lazy *values*...: :))
>
> Then every expression that referenced lazy values would be lazy in
> terms
> of them. And once you want to print X digits of the lazy answer, you
> have to go back through the lazy values and caluclate to what
> precision
> you need them.
this is (to a lesser extend) necessary for lazy arrays, too, isn't it?
my @nums = (1...);
my @foo = @nums.map:{ ... }; #1
my @bar = @foo .map:{ ... }; #2
my @baz = @bar .map:{ ... }; #3
# no map body executed
say @nums[0..10];
# map bodies of #1, #2, and #3 executed
> This is a job for a sophisticated mathematics library,
> not for standard Perl. Perl (5 even) is powerful enough to implement
> such a thing as a module.
Of course. IIRC, even Haskell doesn't support that out-of-the-box ;).
--Ingo
--
Linux, the choice of a GNU | Perfection is reached, not when there is no
generation on a dual AMD | longer anything to add, but when there is
Athlon! | no longer anything to take away.