I hate enums. I thought they would be type
checked and they are just
I love C but enums suck.
On Sat, Apr 25, 2020 at 12:54:27PM +1000, Rob Pike wrote:
Another debate at the time was caused by a
disagreement between pcc and
regarding enums: are they a type or just a way to
declare constant? I
remember getting annoyed by pcc not letting me declare a constant with
enum and use it as an int. I protested to scj and
dmr and after some
and fro-ing Steve changed pcc to treat them as
Not sure it was the right decision, but C desperately wanted a non-macro
way to define a constant. I'd probably argue the same way today. The
lesson is how propinquity affects progress.
On Sat, Apr 25, 2020 at 12:51 PM Rob Pike <robpike(a)gmail.com> wrote:
> The ability to call a function pointer fp with the syntax fp() rather
> (*fp)() came rather late, I think at
Bjarne's suggestion or example.
> sure it was not in v7 C, as you observe.
> Convenient though the shorthand may be, it always bothered me as
> inconsistent and misleading. (I am pretty sure I used it sometimes
> On Sat, Apr 25, 2020 at 12:48 PM Adam Thornton <athornton(a)gmail.com>
>> On Apr 24, 2020, at 7:37 PM, Charles Anthony <
>> On Fri, Apr 24, 2020 at 7:00 PM Adam Thornton <athornton(a)gmail.com>
>>> This doesn???t like the function pointer.
>>> $ cc -c choparg.c
>>> choparg.c:11: Call of non-function
>> We have a winner!
>> Also, Kartik, dunno where it is on the net, but if you install a v7
>> system, /usr/src/cmd/c
Larry McVoy lm at mcvoy.com