Path: csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!border3.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!border4.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!news.iecc.com!nerds-end From: jgk@panix.com (Joe keane) Newsgroups: comp.compilers Subject: Re: macros, was Looking for volunteers for XL Date: Thu, 15 Dec 2011 15:40:05 +0000 (UTC) Organization: Public Access Networks Corp. Lines: 44 Sender: news@iecc.com Approved: comp.compilers@iecc.com Message-ID: <11-12-023@comp.compilers> References: <11-11-048@comp.compilers> <11-12-002@comp.compilers> <11-12-017@comp.compilers> <11-12-018@comp.compilers> NNTP-Posting-Host: news.iecc.com X-Trace: leila.iecc.com 1324014502 19201 64.57.183.58 (16 Dec 2011 05:48:22 GMT) X-Complaints-To: abuse@iecc.com NNTP-Posting-Date: Fri, 16 Dec 2011 05:48:22 +0000 (UTC) Keywords: macros, design Posted-Date: 16 Dec 2011 00:48:22 EST X-submission-address: compilers@iecc.com X-moderator-address: compilers-request@iecc.com X-FAQ-and-archives: http://compilers.iecc.com Xref: x330-a1.tempe.blueboxinc.net comp.compilers:395 Kaz Kylheku wrote: >Problem is, you're creating something akin to an assembly language, >with instructions that have source and destination operands. So it looks like... an imperative programming language! Some typical code: int f(struct foo *foo) { ... err = foo_get_bar(foo, q, &bar); if (err != 0) ... err = bar_get_box(bar, p, &box); if (err != 0) ... ... err = box_frobnz(box, z, &a); if (err != 0) ... if (soanso) { err = box_grobny(box, y, &b); if (err != 0) ... } ... } The version with macros will look exactly the same, except you can omit the '&', and they're usually upper case. >The need for generating temporary variables has not gone away. I think this is not a big deal, since the value is often then used more than once. Even if not, the code may be more clear, if less concise. [also helps debugging]