Interesting, thanks. Looking forward to the screencast as well. :)
On Mon, 19 Sep 2016 08:43:26 +1000
Andrew Sorensen <
dig...@gmail.com> wrote:
> Hi Johannes,
>
> Conceptually your code is spot on, so don't worry, you do understand what
> you're doing :). In fact this really is an Extempore bug as we should be
> providing a reasonable/helpful error msg.
>
> The reason your conceptually spot on code doesn't compile is that at the
> moment xtlang only allows you to use zalloc,halloc and salloc as direct
> bindings in a let. So the following will compile successfully.
>
> (xtmX (let ((ptr:i8* (zalloc 10))) ptr))
>
> Yes, zone memory is automatically freed 'at some point'. Where 'at some
> point' depends on context.
>
> In the case of an expression evaluated by xtmX the zone is freed
> immediately after the expression is evaluated - so in the case above the
> memory addressed by ptr will be invalid as soon as it returns :(
>
> While this seems a bit arbitrary (it is), in practice there are only a few
> rules to keep in mind for zones. Zones, are a bit tricky, so I've decided
> this morning that I'm going to try to make a short screencast today, rather
> than write a long email. Hopefully you'll see a post about a hopefully
> explanatory youtube screencast later today :)
>
> Cheers,
> Andrew.
>
>
>
> On Mon, Sep 19, 2016 at 4:54 AM, Johannes Kroll <
j-k...@gmx.de> wrote:
>
> To unsubscribe from this group and stop receiving emails from it, send an email to