Mercerenies / gdlisp

Lisp on the Godot platform
GNU General Public License v3.0
145 stars 1 forks source link

yield completed #136

Closed Mercerenies closed 1 year ago

Mercerenies commented 1 year ago

Apparently yield can yield to a function's completed signal. Did not know that. Investigate and see if our yield* should expand to that form instead.

See https://docs.godotengine.org/en/3.2/classes/class_@gdscript.html#class-gdscript-method-yield

Mercerenies commented 1 year ago

Will not fix. (yield*) and (yield function "completed") serve two different purposes, both of which are useful.

yield* propagates a "controlled" yield. That is, a 0-argument yield expects its caller to resume it. A yield* simply propagates that responsibility up to its own caller. On the other hand, yielding to "completed" indicates that you want to know when the given function has completed due to some other signal. So the latter only really makes sense when yielding away from a function who used the 2-argument yield form.