News for hackers. Stuff that matters.
Re:The cost of forsaking C by barrkel on Wednesday October 05, 2016 @03:00PM (#12646724)
The distinction is in the syntax.

    int main()
    {
       foo(bar);
       foo * bar;
    }
If foo is a typedef, these are variable declarations, otherwise the first is a function call and the second multiplication (syntactically). These are different kinds of things that would normally be up to the parser to figure out (rather than semantic analysis later). These are well-known ambiguities relating to typedefs in C (well-known to compiler authors, at any rate).

The situation doesn't come up in Pascal because variables go in the var block (starting with the 'var' keyword) and functions and procedures both start with keywords ('function' and 'procedure').

Re:The cost of forsaking C by Roboprog on Wednesday October 05, 2016 @05:04PM (#12647869)
OK, thanks. I was focusing on the "definition" part, rather than the "usage" part of the types.

It never occurred to me to put variables names inside parens in a declaration when I did C, though. But OF COURSE it's legal obfuscation.

As stated elsewhere, I don't know why C had to screw up Algol's syntax so badly. I guess K&R liked curly braces much more than BEGIN/END, and why stop there, once you get going. Maybe somebody had a love affair with APL???