On Wed, Aug 13, 2008 at 11:07 PM, Assaf Arkin <[EMAIL PROTECTED]> wrote:
>
> If it's just an issue of Ruby recursion eating up the stack, why not
> change the algorithm so it's iterative using a proper stack to
> push/pop prerequisites?

right, and do it without recursion (i.e., don't start from the top
task, asking it to push its prerequisites and then ask them to push
their prerequisites).

>
> Creating a tree of prerequisites before invoking a single task would
> change the way you use Rake, I'm one of the people who's code would
> get affected.

the only thing that will be affected is if you have a task that
overrides the 'invoke_prerequisites' so that it takes into account the
results of 'execute' of those prerequisites (someone mentioned in this
thread a task that he wants to get executed if one of its
prerequisites succeeded). note there's a distinction between 'invoke'
and 'execute'.

other than such scenario, i don't think any code will be affected. all
tasks will be 'invoked'. their invocation will be to return their
prerequisites which can be very dynamic, overriden by tasks etc. then,
the resulting list will be iterated and executed. any dynamic
prerequisites code, other than one that examines the execution result,
will work as before

and as i mentioned there are other benefits besides avoiding stack
overflow, mainly, the ability to utilize several cores/cpus without
thrashing the machine and being able to stop the whole execution on
errors.

ittay

>
> Assaf
>
>
>>
>> --
>> -- Jim Weirich
>> -- [EMAIL PROTECTED]
>>
>> _______________________________________________
>> Rake-devel mailing list
>> [email protected]
>> http://rubyforge.org/mailman/listinfo/rake-devel
>>
> _______________________________________________
> Rake-devel mailing list
> [email protected]
> http://rubyforge.org/mailman/listinfo/rake-devel
>
_______________________________________________
Rake-devel mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/rake-devel

Reply via email to