I've seen this implementation of defer a few times now. I really dislike calling this defer (like the keyword in Go) as the given code won't be executed on return.
Pretty.c
91–100 of 227 posts
Re: Pretty.c
#92This should have been invented 50 years ago!
Re: Pretty.c
#93Re: Pretty.c
#94Earlier quoted context omitted.
Today I learned that there exist people who use non-US layouts when coding. That’s spectacular!
How did you think people outside the US learn programming?
setxkbmap us -option ctrl:swapcaps -option compose:rwin
Problem solved. US layout, and with the right Window keys you can compose
European characters.Re: Pretty.c
#95Earlier quoted context omitted.
It uses type dispatch to perform an epsilon comparison: static int pretty_float_equal (float a, float b) { return fabsf(a - b) So it’s https://docs.python.org/library/math.html#math.isclose
This code is incorrect, but I don't blame them. :) Probably one of the most common float-related mistakes, even among people who "know how floats work". FLT_EPSILON is the difference between 1.0 and the next larger float. It's impossible for numbers less than -2.0 or greater than 2.0 to have a difference of FLT_EPSILON, they're spaced too far apart. You really want the acceptable error margin to be relative to the si…
Re: Pretty.c
#96Re: Pretty.c
#97This is terrifying
Re: Pretty.c
#98Evil, yet beautiful. Hats off to you.
Re: Pretty.c
#99This made me immediately think whether MIT Loop of Common Lisp was an inspiration here. Checked the user's profile and sure enough, a lisper!