3 ms·
__FILE__, __LINE__, __FUNCTION__ Yes, there's no default pretty print for structs, but no sane C programmer would ever expect or want that blubber to come avai
by eps 11y ago
__FILE__, __LINE__, __FUNCTION__
Yes, there's no default pretty print for structs, but no sane C programmer would ever expect or want that blubber to come available by default. Mainly because there's very rarely a need to printf-dump anything more than a select variable or a struct field. Different language - different debugging realities.
- bhaak 11y agoThose only act on the currently defined context. Especially __FUNCTION__ is by no means an equivalent to source_location. __FUNCTION__ tells you, in what function you currently are. source_location tells you "in what file has this method of this object been defined". Because of duck typing this is much harder to answer in Ruby. But even in C, because of linking it can be non obvious what function actually gets called.