(int, tuple) trycatch (cell message) impure asm "<{ validate_message_exception CALLDICT }> CONT <{ invalid_message CALLDICT }> CONT 1 2 TRYARGS";
...
...
...
(int, tuple) validate_message (cell message) impure method_id {
(int good, tuple result) = trycatch(message);
return (good, result);
}
that's what I did.
validate_message_exception returns result on success and may throw exception if something goes wrong, and invalid_message just returns the result that is required in case of an invalid message
basically declare two functions, one will be like a TRY block, and another one will be like a CATCH block, and then do TRY/TRYARGS in asm
Aug 13, 2022, 12:38 PM
actually I think I was able to just rename trycatch function to validate_message and get the same result
there was a ready example code for each task in contest, which contained a declared function with required name/return types/args types, I just didn't want to remove it :D
Aug 13, 2022, 12:40 PM