5 ms·
Paging walter bright
by IncreasePosts 4mo ago
Paging walter bright
- glouwbug 4mo agoC's biggest mistake. But in other news most don't know that a[3] == 3[a]
- throwaway27448 4mo agoEven more irrelevant than the array type
- parlortricks 4mo agoI didn't understand why a[3] == 3[a], but i found this stackoverflow that explains it. https://stackoverflow.com/a/16163840 https://stackoverflow.com/a/16163840 In C a[i] is converted to *(a+i) internally. i[a] is converted to *(i+a). Array names also act as pointers in c. so (a+i) or (i+a) give an address (using pointer arithmetic) that is dereferenced using
- parlortricks 4mo agoIn C a[i] is converted to *(a+i) internally. i[a] is converted to *(i+a). Array names also act as pointers in c. so (a+i) or (i+a) give an address (using pointer arithmetic) that is dereferenced using *
- glouwbug 4mo agohttps://www.digitalmars.com/articles/C-biggest-mistake.html https://www.digitalmars.com/articles/C-biggest-mistake.html
- WalterBright 4mo agoAt your service! D fixed it, and I'm sorry C users have suffered as the array-to-pointer decay blasted their kingdom. Fixing it in C is easy and should be the #1 priority.
- aa-jv 4mo agoAt this point, C's #1 priority is not breaking things in existing implementations, though, Walter...
- WalterBright 4mo agoMy proposal does not break existing code. https://www.digitalmars.com/articles/C-biggest-mistake.html https://www.digitalmars.com/articles/C-biggest-mistake.html
- aa-jv 4mo agoYes it does: >All it needs is a little new syntax
- bmn__ 4mo agoYou seem to be under the impression that adding new syntax necessarily breaks existing code. But that just isn't true. If you can't fathom how it's done, then look at the use VERSION statement in Perl.
- aa-jv 4mo agoIt doesn't just break existing code, it breaks existing tooling for checking syntax .. (Perl is hardly a decent model.)
- bmn__ 4mo agoThis answer that is both so stupendously confident and wrong is only possible if you in actuality decided to not read and understand how this problem is solved in Perl.