On Thursday, 24 July 2014 at 14:59:16 UTC, Darren wrote:
It does seem that's the case. Which is odd, as I thought that
DMD and LDC did TCO. Not in this case obviously.
DMD doesn't do it with the :? operator:
https://issues.dlang.org/show_bug.cgi?id=3713
On Thursday, 24 July 2014 at 14:59:16 UTC, Darren wrote:
On Thursday, 24 July 2014 at 14:39:12 UTC, H. S. Teoh via
Digitalmars-d-learn wrote:
On Thu, Jul 24, 2014 at 01:14:40PM +, Darren via
Digitalmars-d-learn wrote:
I have the following code in fac.d (modified from the
factorial
examples
On Thursday, 24 July 2014 at 14:39:12 UTC, H. S. Teoh via
Digitalmars-d-learn wrote:
On Thu, Jul 24, 2014 at 01:14:40PM +, Darren via
Digitalmars-d-learn wrote:
I have the following code in fac.d (modified from the factorial
examples on RosettaCode):
#!/usr/bin/rdmd
import std.bigint;
pure
On Thu, Jul 24, 2014 at 01:14:40PM +, Darren via Digitalmars-d-learn wrote:
> I have the following code in fac.d (modified from the factorial
> examples on RosettaCode):
>
> #!/usr/bin/rdmd
> import std.bigint;
>
> pure BigInt factorial(BigInt n) {
> static pure BigInt inner(BigInt n, Big
I have the following code in fac.d (modified from the factorial
examples on RosettaCode):
#!/usr/bin/rdmd
import std.bigint;
pure BigInt factorial(BigInt n) {
static pure BigInt inner(BigInt n, BigInt acc) {
return n == 0 ? acc : inner(n - 1, acc * n);
}
return inner(n, BigI