Yes, I am not really considering the top-level, I was thinking more of this:

def main =
    let add_x x = lambda y = x + 1 in
    let add_one = add_x 1 in ...

I would consider the whole top-level and program entry point as a closure
to be instantiated in its callers stack.


Keean.



On 11 February 2015 at 18:21, Jonathan S. Shapiro <[email protected]> wrote:

> On Wednesday, February 11, 2015, Keean Schupke <[email protected]> wrote:
>
>> def add_x x = lambda y = x + y
>> x : 'a -> ('a -> 'a)
>>
>> def add_one = add_x 1
>>
>> I don't see the problem. "add_one" is a stack allocated object in the top
>> level context.
>>
>
> Umm... The stack in this context is gone by the time we enter main. I'm
> not quite sure what you are imagining, but I'm sure it will be 
> educational.[image:
> 😄]
>
> Given dynamic libraries and multiple application entry points (as opposed
> to just main), putting top-level allocations on the stack is tricky.
>
> I do agree that in this case the closure object can be allocated as a
> global, though.
>
>
> Jonathan
>
> _______________________________________________
> bitc-dev mailing list
> [email protected]
> http://www.coyotos.org/mailman/listinfo/bitc-dev
>
>
_______________________________________________
bitc-dev mailing list
[email protected]
http://www.coyotos.org/mailman/listinfo/bitc-dev

Reply via email to