tag:blogger.com,1999:blog-8250580320832498087.post6692456336460967395..comments2023-11-02T09:55:49.284+00:00Comments on Sam Liddicott: Another attempt at try/except/finally in CSam Liddicotthttp://www.blogger.com/profile/03970781114824321762noreply@blogger.comBlogger4125tag:blogger.com,1999:blog-8250580320832498087.post-88115978774149813342013-04-26T16:06:20.020+01:002013-04-26T16:06:20.020+01:00And p99 shows a way to avoid curly braces for the ...And p99 shows a way to avoid curly braces for the switch statement! Use a horribly complicated nested if/else set of blocks that contains the case: directives.<br /><br />These avoid the need for curly braces! As long as it is a single statement, it will do!<br /><br />hah hah hahSam Liddicotthttps://www.blogger.com/profile/03970781114824321762noreply@blogger.comtag:blogger.com,1999:blog-8250580320832498087.post-84812788935376597392013-04-26T15:37:51.810+01:002013-04-26T15:37:51.810+01:00Wow, I found a good implementation here: http://p9...Wow, I found a good implementation here: http://p99.gforge.inria.fr/p99-html/group__try_ga9162d721fecf634c028ab873912c9cd0.html#ga9162d721fecf634c028ab873912c9cd0Sam Liddicotthttps://www.blogger.com/profile/03970781114824321762noreply@blogger.comtag:blogger.com,1999:blog-8250580320832498087.post-12878334778909764412013-04-26T14:09:28.258+01:002013-04-26T14:09:28.258+01:00I think I may find something here to help me, espe...I think I may find something here to help me, especially the C lambda example which may help my earlier difficulties in pre-declaring local functions and so on. <br /><br />http://stackoverflow.com/questions/1772119/c-the-most-useful-user-made-c-macros-in-gcc-also-c99<br /><br />A lamba variable could be it's own cleanup function!Sam Liddicotthttps://www.blogger.com/profile/03970781114824321762noreply@blogger.comtag:blogger.com,1999:blog-8250580320832498087.post-62813803849367950282013-04-26T13:24:26.293+01:002013-04-26T13:24:26.293+01:00One deficiency with try...finally/except is that a...One deficiency with try...finally/except is that any variables local to the try block are lost to the finally/except blocks.<br /><br />It might be nice to introduce an alternative syntax that preserves the try scope for the finally/except cleanup blocksSam Liddicotthttps://www.blogger.com/profile/03970781114824321762noreply@blogger.com