[Self-interest] Block Question

Luke McNeil lukemcneil61 at gmail.com
Thu Nov 11 03:29:41 UTC 2021


On Mon, Nov 8, 2021 at 3:21 PM Jecel Assumpcao Jr <jecel at merlintec.com>
wrote:

> An alternative, adopted by Self, is to simply declare this to be an
> error - the one you saw. You are allowed to use blocks created in B as
> long as its stack frame is still around. When B returns we just throw
> all its stuff away (pop the stack) and too bad if any blocks needed it.
>

Yes, thanks for the thorough response. That explains why code like this
will throw this error "(| a = (| | b value). b = (| | [1]) |) a". By the
time method A gets the block back from B and sends it value, B has already
returned.

I am still specifically confused on cases like this, however - "(| x = [2]
|) x value". This case throws the error. It is not clear to me, in this
case, which method has returned making the block that x points to no longer
usable. (Maybe my confusion is in how data slots are assigned their values.)

Something similar to this is "(| x = (| | [2]) |) x value". This throws the
same error. This one makes sense to me though, as the block is made in the
x method which has returned by the time value is sent to it.

Thanks again for the responses.

-Luke
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.selflanguage.org/pipermail/self-interest/attachments/20211110/d9242e5e/attachment.html>


More information about the Self-interest mailing list