3 ms·
Thank you. I wasn't sure if he understood that I was implementing it.
by _RPM 10y ago
Thank you. I wasn't sure if he understood that I was implementing it.
- chrisseaton 10y agoI did, and I think my comment still makes sense in that context. If I give you a list of requirements for a programming language that I want you to implement and it includes 'a function must be able to call any function' then you have recursion. You don't need additional separate requirement for 'and that function may be itself', as long as you've fully implemented the first requirement. In fact you'd need an extra requirement to prevent recursion, not to allow it. That's what I mean by you shouldn't need to consider recursion as a special case.
- _RPM 10y agoThat's a great point. I think there is fundamental flaw in my virtual machine because recursion does not work, but calling other functions from within a function do work.
- deleted 10y ago[deleted]
- winstonewert 10y agoThe fact is, its easier to implement a language without recursion. See early programming languages that didn't. In such a case, you can simply treat the local variables as if they are global variables in the implementation. You've got to do something more complicated if you are going to handle local variables in a recursive case. The fact it is not an additional requirement to allow recursion is irrealevent, what matter is that its extra complexity to handle that case correctly.