IWETHEY v. 0.3.0 | TODO
1,095 registered users | 0 active users | 0 LpH | Statistics
Login | Create New User
IWETHEY Banner

Welcome to IWETHEY!

New Why not include the exception processing in the lambda?
Not sure I understand why the exception processing is not bundled as part of the anonymous function:
\nfun make_foo() {\n   lambda(){ \n      try { \n         raise Error; \n      } catch (Error) {\n         print("Error caught in make_foo!");\n      }\n   }\n}\n
Would the catch not then be lexically scoped within the lambda function? I guess I don't understand what you are trying to. In the current languages, the exception within make_foo would only be trapped if the error were in the creation of the lambda function - not in the invocation.

Also, I gather you still think the continuation point should be based on the point of invocation - not the point of defintion. So do you think the next statement executed after the try-catch in the main block?
\nfun main() {\n  try\n    let foo = make_foo();\n    foo();\n  catch (Error) {\n    print("Error caught in main!");\n  }\n  print("here's where i end up when all is said and done?");\n}\n
New Re: Why not include the exception processing in the lambda?
The exception isn't part of the lambda, since I was trying to come up with the shortest example that illustrated the issue I was talking about. :)


Also, I gather you still think the continuation point should be based on the point of invocation - not the point of defintion. So do you think the next statement executed after the try-catch in the main block?
\nfun main() {\n  try\n    let foo = make_foo();\n    foo();\n  catch (Error) {\n    print("Error caught in main!");\n  }\n  print("here's where i end up when all is said and done?");\n}

I'm not sure what you mean by "continuation point should be based on the point of invocation", but I do want execution to continue normally after the exception is handled (that's kind of the point of an exception, after all!). So your example should print
\nError caught in make_foo!\nhere's where i end up when all is said and done?\n

     Checked Exceptions, Good or Bad - (bluke) - (25)
         Agreed, for the most part. - (admin) - (5)
             Checked Exceptions: A Failed Experiment - (JimWeirich) - (4)
                 Re: Checked Exceptions: A Failed Experiment - (admin) - (3)
                     Re: Checked Exceptions: A Failed Experiment - (JimWeirich) - (2)
                         Note the quotes: "ought" to. - (admin) - (1)
                             Thanks - (JimWeirich)
         Bad of course - (tuberculosis)
         Hey look - I got a new sig out of that article - (tuberculosis) - (1)
             Buahahah. -NT - (admin)
         Designers should ALWAYS look for pushback - (ben_tilly) - (15)
             OT: I didn't picture you reading Cato stuff. :-) - (Another Scott) - (5)
                 I don't generally - (ben_tilly) - (4)
                     I can't offer an opinion. - (Another Scott) - (3)
                         Cato's been mucking around since the '60s at least - (Ashton) - (2)
                             Re: Cato's been mucking around since the '60s at least - (neelk) - (1)
                                 Re: Cato's been mucking around since the '60s at least - (Ashton)
             Re: Designers should ALWAYS look for pushback - (neelk) - (8)
                 How do you do "meta" flow of control? - (ben_tilly) - (7)
                     Another possible solution to exceptions... - (ChrisR) - (6)
                         Not appropriate for the situation being discussed - (ben_tilly) - (5)
                             Actually I'm mostly interested in what... - (ChrisR) - (4)
                                 What my thinking on this is... - (ben_tilly)
                                 Re: Actually I'm mostly interested in what... - (neelk) - (2)
                                     Why not include the exception processing in the lambda? - (ChrisR) - (1)
                                         Re: Why not include the exception processing in the lambda? - (neelk)

No, your ass does that all on its own.
61 ms