- Subject: [slang-users] Stack underflow()
- From: Bernd Eggink <bernd.eggink@xxxxxxxxxx>
- Date: Tue, 10 Dec 2019 00:51:57 +0100
slsh> define f() {}
slsh> () = f();
Stack Underflow Error
I wonder why this is considered an error. If "()=" means "pop anything
left on the stack", isn't "nothing" (in a mathematical sense) also
"anything"?
This could be a problem IMHO if a function may or may not leave data on
the stack, e.g. depending on parameter values. To prevent an error, one
would have to wrap the call in a test of the stack width.
Or must the information about how many values a function leaves on the
stack be understood as part of the contract with the user?
-Bernd
--
http://www.sudrala.de
_______________________________________________
For list information, visit <http://jedsoft.org/slang/mailinglists.html>.
[2019 date index]
[2019 thread index]
[Thread Prev] [Thread Next]
[Date Prev] [Date Next]