You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
All functions should emit something, even if the last instruction in any function is pushundef, which would be a marker "This is not supposed to be read!" value.
Then, when statement-level function calls happen, we should emit a call + discard (or a different instruction like sinkcall, or a flag in the Call for the VM).
On the other hand, if a function didn't return, then the VM will read that "undef" value and should error that it was used as a value ("Procedure used as value" or something).
We'll definitely want much, much later to know the prototypes of the functions we call to make sure this doesn't happen, but that's too big a task for now, and I'd rather not add a null/undefined value to the language at all.
The text was updated successfully, but these errors were encountered:
All functions should emit something, even if the last instruction in any function is
pushundef
, which would be a marker "This is not supposed to be read!" value.Then, when statement-level function calls happen, we should emit a
call
+discard
(or a different instruction likesinkcall
, or a flag in theCall
for the VM).On the other hand, if a function didn't return, then the VM will read that "undef" value and should error that it was used as a value ("Procedure used as value" or something).
We'll definitely want much, much later to know the prototypes of the functions we call to make sure this doesn't happen, but that's too big a task for now, and I'd rather not add a null/undefined value to the language at all.
The text was updated successfully, but these errors were encountered: