From mboxrd@z Thu Jan 1 00:00:00 1970 From: bakul@bitblocks.com (Bakul Shah) Date: Sun, 14 May 2017 21:54:16 -0700 Subject: [TUHS] C declarations. In-Reply-To: Your message of "Mon, 15 May 2017 14:35:34 +1000." References: <015401d2caa0$79762650$6c6272f0$@ronnatalie.com> <68E8DC0A-D1B8-4FF0-AD26-ACDC57E308AF@pobox.com> <20170511223232.GM4341@mcvoy.com> <015b01d2caa7$c658c020$530a4060$@ronnatalie.com> <20170513012415.GZ4341@mcvoy.com> <025701d2cb92$ec8182a0$c58487e0$@ronnatalie.com> <20170513122050.GF9980@yeono.kjorling.se> <0CF82AC1-E835-4C06-813F-D9EFD2C12290@tfeb.org> <20170513124247.GG9980@yeono.kjorling.se> <57639684-050B-4995-859F-876CAFE4BE9C@serissa.com> <20170514042411.93CCB124AEA4@mail.bitblocks.com> Message-ID: <20170515045416.AF1CF124AEA4@mail.bitblocks.com> On Mon, 15 May 2017 14:35:34 +1000 Dave Horsfall wrote: > On Sat, 13 May 2017, Bakul Shah wrote: > > > int*()* f // f is a ptr to function returning ptr to int > > Nope. > > aneurin% cdecl > Type `help' or `?' for help > explain int*()* f > syntax error > declare f as ptr to function returning ptr to int > int *(*f)() > > (Sigh; "cdecl" really needs to print a "> " prompt or something.) Sorry, I was less than clear. I was just doing a thought experiment about an alternate declaration syntax. Requoting from my email: But if you put the var all the way to the right and read a declaration right to left, it works: Basically suggesting that if all type machinery *preceded* an object declaration (including for functions), we don't need any parentheses and declarations are very easy to understand -- you just read a declaration from right to left. So no need for cdel! Too late for this, of course!