August 08, 2005 Does D support tail recursion? | ||||
---|---|---|---|---|
| ||||
Hi, In some ML languages like Ocaml the compiler detects tail-recursions and automatically changes it to a while loop before assembling into machine code. Does D have this tail-recursion-optimization too? -Jerry |
August 08, 2005 Re: Does D support tail recursion? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Jerry | "Jerry" <Jerry_member@pathlink.com> wrote in message news:dd8dro$7l9$1@digitaldaemon.com... > Hi, > In some ML languages like Ocaml the compiler detects tail-recursions and > automatically changes it to a while loop before assembling into machine > code. > Does D have this tail-recursion-optimization too? > > -Jerry D the language doesn't say if a given compiler should or shouldn't detect tail recursion. The dmd compiler doesn't. I think the gdc compiler does - but I haven't actually checked. |
Copyright © 1999-2021 by the D Language Foundation