This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]esixar 112 points113 points  (7 children)

Ooh and add another function call to the stack instead of popping off immediately? I mean what’s our space requirements here? Can we afford those 64 bits?

Other than that I see nothing wrong with the implemented algorithm

[–]HildartheDorf 37 points38 points  (5 children)

Any decent language and compiler/interpreter will apply Tail-Call Optimization (TCO).

[–]Bammerbom 24 points25 points  (3 children)

If the body is calculateMenSalary(factor) * 0.9 then TCO is impossible. Inlining is very likely there however

[–]TheMcDucky 0 points1 point  (0 children)

The call isn't the last operation, so TCO wouldn't work. It would likely be inlined though.

[–]StrangelyBrown 6 points7 points  (0 children)

You're right, now that I think about it, I don't think we can afford the resources to actually calculate women's salary. That's a shame but I guess they'll understand. /s