2 ms·
If the system were elegant it wouldn't be quite so wildly inconsistent between prefix and suffix notation. "Middle-out" is not elegant. I mean, I've been writi
by pjc50 10y ago
If the system were elegant it wouldn't be quite so wildly inconsistent between prefix and suffix notation. "Middle-out" is not elegant.
I mean, I've been writing C for 20 years and would still prefer to break down a declaration with intermediate typedefs rather than write "pointer to function taking array of pointers to int-returning functions taking a void pointer, which returns a pointer to int-returning function taking a void pointer". If you can write that as a declaration right first time you can give yourself a serious pat on the back.
- wruza 10y agoChallenge accepted, no cheating, no references, just editor and me. Hope that I got it right: int (*(*p)(int (*[])(void *)))(void *); The process: ?which-returns (*p)( ?taking ) ? (*p)( int (*[])(void *) ) int (*(*p)( int (*[])(void *) ))(void *) Testing with cdecl.org [1]: declare p as pointer to function [taking] (array of pointer to function (pointer to void) returning int) [, which] returning pointer to function (pointer to void) returning int F-yeah. Can I has my pat? Seriously, it is not so hard if you used each component at least 100 times. That's few years of practice of non-hiding behind typedefs. You can't learn if you don't practice. (I'm not arguing that this should not be decomposed.) [1] http://cdecl.ridiculousfish.com/?q=int+%28*%28*p%29%28int+%28*%5B%5D%29%28void+*%29%29%29%28void+*%29 http://cdecl.ridiculousfish.com/?q=int+%28*%28*p%29%28int+%2...