@vnen I like it! What is the capture behavior, by the way? Does it capture everything by reference?

@vnen Also, can you type annotate Callables by their parameters and return values?

@jabcross No. I thought about that but it's a bit tricky to enforce.

@vnen Are you going to implement compound types for arrays or dicts? Stuff like [[int]] or {string:[int]}? Cause I imagine the tooling would be mostly the same

@jabcross yes, the captures reference the stack. If the outer function goes out of scope then the captures are copied.

@vnen If the reference is to an array, does the array get copied or does the variable become dangling? I assume the latter

@jabcross it would be the same as if you return an array from a function. The original might go out of scope but you get a copy of that reference, which still lives in the heap.

@vnen Oh yeah, arrays have reference counters. I forgot. Cool!

Sign in to participate in the conversation
Gamedev Mastodon

Mastodon server focused on game development and related topics.