Re: SWITCH question
- Posted by irv Jan 05, 2018
- 2220 views
Could it be that we are looking in the wrong place for the cause of the sig 11 crash? Note that assigning one constant to another fails, while assigning the equivalent literal value to that same constant succeeds:
constant expr = cos(0) ? expr constant val = 1 -- works ? val switch expr do case val then puts(1, "\n result is first stack \n" ) case else puts(1, "\n result is something else \n") end switch
1
1
result is first stack
constant expr = cos(0) ? expr constant val = expr -- fails ? val switch expr do case val then puts(1, "\n result is first stack \n" ) case else puts(1, "\n result is something else \n") end switch
1
1
/home/irv/stk.ex:7
A machine-level exception occurred during execution of this statement (signal 11)
constant expr = cos(0) ? expr constant val = cos(0) -- fails (it's the same, but different!) ? val switch expr do case val then puts(1, "\n result is first stack \n" ) case else puts(1, "\n result is something else \n") end switch
Also fails, same error.