Apparently C peasants like myself are too low-born to engage directly with the type theory aristocracy, only subtweeting is appropriate ;)
— Andre Weissflog (@FlohOfWoe) January 5, 2024
This guy has a neat cross-platform C library https://github.com/floooh/sokol. The original tweeter is friends with a committee C++ CUTE TWINK who is ruining C by adding dumb features like breaking the auto keyword or nullptr.
Jump in the discussion.
No email address required.
why would
p
be anint**
? i would definitely expect it to be anint*
, withauto
resolving toint
because the RHS is clearly anint*
Jump in the discussion.
No email address required.
The definition of
auto
as the type of the right hand side implies thatauto
isint*
impliesauto*
isint**
. This may not be the common reasoning, but it is a valid interpretation imo. Personally, I thinkauto*
should just be an error. Once you start pattern matching on types, you end up recreating the crazy c++ template type deduction algorithm that forms the basis of type inference in c++.Jump in the discussion.
No email address required.
I'll agree with you there.
I still think it would be wild if
auto*
actually deduced toint**
since that's clearly an error (try dereferencing it twiceauto *x = &y; z = **x;
and watch the world burn) and quite confusing since it's so different fromauto&
.I would go further though and say that changing
auto
in C is stupid, it's not actually necessary in C because C doesn't have complicated types like C++. If you want to use fancy abstractions use C++, it's got excellent support for C interop,Jump in the discussion.
No email address required.
More options
Context
More options
Context
More options
Context