Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
taeber
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
3 ms
·
1.
▲
by
taeber
5y ago
I'm glad you suggested that, because one of the first comparisons I drew in my article[1] about the "with"-syntax was how it looks like a for-loop. If you are interested, I did provide a few macros[2], but as another commente
2.
▲
by
taeber
5y ago
I like the idea of automatic resource cleanup in C and was excited when I read the headline, but I agree with others that the proposed syntax doesn't seem very C-like. I previously shared a "with" statement idea on HN that I
3.
▲
by
taeber
6y ago
Yes you can. I did mention GCC's cleanup attribute along with MSVC's try-finally construct. Another user was kind enough to even provide an example in their GitHub issue: https://github.com/taeber/cwith/i
4.
▲
by
taeber
6y ago
Thank you! I'd much prefer to not have to use macros, but I tried to make the with/withif mimic what I wish was a real C statement.
5.
▲
Show HN: Automatic cleanup in C using with-statements
(github.com)
28 points
by
taeber
6y ago
|
7 comments