Ellery Newcomer:
> How DO you define the signature of a function that returns itself?
You may need a language with a type system more powerful than D type system
(like Scala?).
> And FYI, dmd handles your particular example recursively just fine. But
> you probably know that.
I don't understa
Hello Ellery,
BCS wrote:
Hello Ellery,
bearophile wrote:
I'm trying to convert to D2 the following (quite simplified up)
Python code, that implements a trampoline to run tail-call
functions with no stack overflow:
[...]
How DO you define the signature of a function that returns itself?
BCS wrote:
> Hello Ellery,
>
>> bearophile wrote:
>>
>>> I'm trying to convert to D2 the following (quite simplified up)
>>> Python code, that implements a trampoline to run tail-call functions
>>> with no stack overflow:
> [...]
>>
>> How DO you define the signature of a function that returns its
Hello Ellery,
bearophile wrote:
I'm trying to convert to D2 the following (quite simplified up)
Python code, that implements a trampoline to run tail-call functions
with no stack overflow:
[...]
How DO you define the signature of a function that returns itself?
Last I checked, you can't.
bearophile wrote:
> I'm trying to convert to D2 the following (quite simplified up) Python code,
> that implements a trampoline to run tail-call functions with no stack
> overflow:
>
> # Python code
> # *args means almost all the arguments
> def trampoline(fun, *args):
> thunk = lambda : fun
I'm trying to convert to D2 the following (quite simplified up) Python code,
that implements a trampoline to run tail-call functions with no stack overflow:
# Python code
# *args means almost all the arguments
def trampoline(fun, *args):
thunk = lambda : fun(*args)
while True:
(th