Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
| From | "Morten W. Petersen" <morphex@gmail.com> |
|---|---|
| Newsgroups | comp.lang.c |
| Subject | Re: configure() -- a new C compiler preprocessor and code injection proposal |
| Date | 2015-08-31 19:24 +0200 |
| Organization | Aioe.org NNTP Server |
| Message-ID | <ms22ja$26f$1@speranza.aioe.org> (permalink) |
| References | (2 earlier) <mrccng$lj5$1@dont-email.me> <mrce7m$i1p$1@speranza.aioe.org> <mrcejj$t3k$1@dont-email.me> <mrcgki$noa$1@speranza.aioe.org> <lnmvxhzodm.fsf@kst-u.example.com> |
On 23.08.2015 23:27, Keith Thompson wrote: > "Morten W. Petersen" <morphex@gmail.com> writes: [...] >> Are there any cases for macros where they couldn't be replaced by >> functions? Like it would be many more lines of code to do something >> similar in C code. > > I'm probably misunderstanding the question, because the obvious answer > is that you've just seen an example of a macro that cannot be replaced > by a function, inline or otherwise. (Conceivably you could write an > inline function that takes a function pointer as an argument, with the > function acting as the body of the loop -- but the function would have > to be defined separately, and its body would not be in the scope of the > loop.) OK. I still don't see any "magic" that can't be replaced by simple C (inline) functions or some trivial alterations of how the program is written. >> A point about the macros is that they are different than regular C >> code, and because of that an added point of complexity / confusion. > > And added capabilities. OK. >> So a new programmer wouldn't have to learn macros in a variant of >> C that drops that support. And another template language could >> be used for simple or not so simple substitutions. > > C already has a template language, the preprocessor. What is the > advantage of replacing that with a *different* template language? > > Even if you decide to do that, there's no real need to incorporate it > into the language. Tools that generate C code are already quite common, > and can be invoked automatically by any build system. Well, the way I see it, macros have three main uses; one is compile-time defines, checks and so on, the other is that they can guarantee "inline- like" behavior of code, and the third that for example a text string can be defined once and used in different places. Points one and two can be handled by the compiler, while somewhat simple search and replace features might be something a developer wants to have. I have some experience with (X)HTML/CSS/JS templating systems, where a lot is generated on the fly, and it is a very useful feature to have. -Morten
Back to comp.lang.c | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
configure() -- a new C compiler preprocessor and code injection proposal "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-08-21 08:27 -0700
Re: configure() -- a new C compiler preprocessor and code injection proposal "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-08-21 20:15 -0700
Re: configure() -- a new C compiler preprocessor and code injection proposal "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-08-21 20:25 -0700
Re: configure() -- a new C compiler preprocessor and code injection proposal "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-08-21 20:34 -0700
Re: configure() -- a new C compiler preprocessor and code injection proposal "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-08-22 09:46 -0700
Re: configure() -- a new C compiler preprocessor and code injection proposal Philip Lantz <prl@canterey.us> - 2015-08-22 13:15 -0700
Re: configure() -- a new C compiler preprocessor and code injection proposal fir <profesor.fir@gmail.com> - 2015-08-22 13:25 -0700
Re: configure() -- a new C compiler preprocessor and code injection proposal Ian Collins <ian-news@hotmail.com> - 2015-08-23 09:06 +1200
Re: configure() -- a new C compiler preprocessor and code injection proposal "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-08-22 14:47 -0700
Re: configure() -- a new C compiler preprocessor and code injection proposal Bartc <bc@freeuk.com> - 2015-08-22 23:09 +0100
Re: configure() -- a new C compiler preprocessor and code injection proposal "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-08-22 15:21 -0700
Re: configure() -- a new C compiler preprocessor and code injection proposal gordonb.qvmey@burditt.org (Gordon Burditt) - 2015-08-23 17:21 -0500
Re: configure() -- a new C compiler preprocessor and code injection proposal "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-08-23 16:53 -0700
Re: configure() -- a new C compiler preprocessor and code injection proposal gordonb.bkbkd@burditt.org (Gordon Burditt) - 2015-08-23 19:44 -0500
Re: configure() -- a new C compiler preprocessor and code injection proposal "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-08-23 19:08 -0700
Re: configure() -- a new C compiler preprocessor and code injection proposal gordonb.rnzzf@burditt.org (Gordon Burditt) - 2015-08-23 22:29 -0500
Re: configure() -- a new C compiler preprocessor and code injection proposal "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-08-23 20:43 -0700
Re: configure() -- a new C compiler preprocessor and code injection proposal gordonb.594yb@burditt.org (Gordon Burditt) - 2015-08-24 07:09 -0500
Re: configure() -- a new C compiler preprocessor and code injection proposal "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-08-24 05:30 -0700
Re: configure() -- a new C compiler preprocessor and code injection proposal Gordon Burditt <gordon@hammy.burditt.org> - 2015-08-24 07:39 -0500
Re: configure() -- a new C compiler preprocessor and code injection proposal "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-08-24 05:43 -0700
Re: configure() -- a new C compiler preprocessor and code injection proposal David Kleinecke <dkleinecke@gmail.com> - 2015-08-24 18:11 -0700
Re: configure() -- a new C compiler preprocessor and code injection proposal "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-08-25 03:18 -0700
Re: configure() -- a new C compiler preprocessor and code injection proposal David Brown <david.brown@hesbynett.no> - 2015-08-25 14:31 +0200
Re: configure() -- a new C compiler preprocessor and code injection proposal "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-08-25 05:36 -0700
Re: configure() -- a new C compiler preprocessor and code injection proposal Richard Damon <Richard@Damon-Family.org> - 2015-08-24 22:01 -0400
Re: configure() -- a new C compiler preprocessor and code injection proposal "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-08-25 03:22 -0700
Re: configure() -- a new C compiler preprocessor and code injection proposal Bartc <bc@freeuk.com> - 2015-08-25 12:12 +0100
Re: configure() -- a new C compiler preprocessor and code injection proposal "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-08-25 04:26 -0700
Re: configure() -- a new C compiler preprocessor and code injection proposal Bartc <bc@freeuk.com> - 2015-08-25 13:09 +0100
Re: configure() -- a new C compiler preprocessor and code injection proposal "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-08-25 05:20 -0700
Re: configure() -- a new C compiler preprocessor and code injection proposal Bartc <bc@freeuk.com> - 2015-08-25 13:50 +0100
Re: configure() -- a new C compiler preprocessor and code injection proposal "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-08-25 06:08 -0700
Re: configure() -- a new C compiler preprocessor and code injection proposal gazelle@shell.xmission.com (Kenny McCormack) - 2015-08-25 14:34 +0000
Re: configure() -- a new C compiler preprocessor and code injection proposal "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-08-25 07:53 -0700
Re: configure() -- a new C compiler preprocessor and code injection proposal jt@toerring.de (Jens Thoms Toerring) - 2015-08-25 12:53 +0000
Re: configure() -- a new C compiler preprocessor and code injection proposal "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-08-25 06:19 -0700
Re: configure() -- a new C compiler preprocessor and code injection proposal David Brown <david.brown@hesbynett.no> - 2015-08-25 15:47 +0200
Re: configure() -- a new C compiler preprocessor and code injection proposal "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-08-25 07:23 -0700
Re: configure() -- a new C compiler preprocessor and code injection proposal David Brown <david.brown@hesbynett.no> - 2015-08-25 16:41 +0200
Re: configure() -- a new C compiler preprocessor and code injection proposal "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-08-25 08:08 -0700
Re: configure() -- a new C compiler preprocessor and code injection proposal "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-08-24 05:54 -0700
Re: configure() -- a new C compiler preprocessor and code injection proposal Bartc <bc@freeuk.com> - 2015-08-24 09:17 +0100
Re: configure() -- a new C compiler preprocessor and code injection proposal gazelle@shell.xmission.com (Kenny McCormack) - 2015-08-22 22:22 +0000
Re: configure() -- a new C compiler preprocessor and code injection proposal "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-08-22 15:31 -0700
Re: configure() -- a new C compiler preprocessor and code injection proposal David Brown <david.brown@hesbynett.no> - 2015-08-23 23:13 +0200
Re: configure() -- a new C compiler preprocessor and code injection proposal fir <profesor.fir@gmail.com> - 2015-08-22 15:40 -0700
Re: configure() -- a new C compiler preprocessor and code injection proposal "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-08-22 16:00 -0700
Re: configure() -- a new C compiler preprocessor and code injection proposal fir <profesor.fir@gmail.com> - 2015-08-22 16:05 -0700
Re: configure() -- a new C compiler preprocessor and code injection proposal Ian Collins <ian-news@hotmail.com> - 2015-08-23 11:07 +1200
Re: configure() -- a new C compiler preprocessor and code injection proposal "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-08-22 16:15 -0700
Re: configure() -- a new C compiler preprocessor and code injection proposal "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-08-22 15:01 -0700
Re: configure() -- a new C compiler preprocessor and code injection proposal Bartc <bc@freeuk.com> - 2015-08-22 23:16 +0100
Re: configure() -- a new C compiler preprocessor and code injection proposal "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-08-22 15:24 -0700
Re: configure() -- a new C compiler preprocessor and code injection proposal gordonb.i2ffz@burditt.org (Gordon Burditt) - 2015-08-22 17:40 -0500
Re: configure() -- a new C compiler preprocessor and code injection proposal "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-08-22 15:55 -0700
Re: configure() -- a new C compiler preprocessor and code injection proposal Ian Collins <ian-news@hotmail.com> - 2015-08-23 11:13 +1200
Re: configure() -- a new C compiler preprocessor and code injection proposal "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-08-22 16:19 -0700
Re: configure() -- a new C compiler preprocessor and code injection proposal "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-08-22 16:29 -0700
Re: configure() -- a new C compiler preprocessor and code injection proposal Richard Damon <Richard@Damon-Family.org> - 2015-08-22 21:04 -0400
Re: configure() -- a new C compiler preprocessor and code injection proposal gordonb.501pe@burditt.org (Gordon Burditt) - 2015-08-23 18:25 -0500
Re: configure() -- a new C compiler preprocessor and code injection proposal "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-08-23 17:18 -0700
Re: configure() -- a new C compiler preprocessor and code injection proposal David Brown <david.brown@hesbynett.no> - 2015-08-24 10:41 +0200
Re: configure() -- a new C compiler preprocessor and code injection proposal David Brown <david.brown@hesbynett.no> - 2015-08-23 22:55 +0200
Re: configure() -- a new C compiler preprocessor and code injection proposal gordonb.ca5vg@burditt.org (Gordon Burditt) - 2015-08-23 18:43 -0500
Re: configure() -- a new C compiler preprocessor and code injection proposal David Brown <david.brown@hesbynett.no> - 2015-08-24 10:57 +0200
Re: configure() -- a new C compiler preprocessor and code injection proposal "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-08-24 05:40 -0700
Re: configure() -- a new C compiler preprocessor and code injection proposal David Brown <david.brown@hesbynett.no> - 2015-08-24 15:07 +0200
Re: configure() -- a new C compiler preprocessor and code injection proposal "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-08-24 06:29 -0700
Re: configure() -- a new C compiler preprocessor and code injection proposal David Brown <david.brown@hesbynett.no> - 2015-08-24 15:56 +0200
Re: configure() -- a new C compiler preprocessor and code injection proposal "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-08-24 07:18 -0700
Re: configure() -- a new C compiler preprocessor and code injection proposal David Brown <david.brown@hesbynett.no> - 2015-08-24 17:22 +0200
Re: configure() -- a new C compiler preprocessor and code injection proposal Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-08-24 14:36 +0100
Re: configure() -- a new C compiler preprocessor and code injection proposal "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-08-24 06:49 -0700
Re: configure() -- a new C compiler preprocessor and code injection proposal "Morten W. Petersen" <morphex@gmail.com> - 2015-08-23 12:55 +0200
Re: configure() -- a new C compiler preprocessor and code injection proposal "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-08-23 04:58 -0700
Re: configure() -- a new C compiler preprocessor and code injection proposal Bartc <bc@freeuk.com> - 2015-08-23 13:03 +0100
Re: configure() -- a new C compiler preprocessor and code injection proposal "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-08-23 05:20 -0700
Re: configure() -- a new C compiler preprocessor and code injection proposal Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-08-23 16:59 +0100
Re: configure() -- a new C compiler preprocessor and code injection proposal "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-08-23 09:34 -0700
Re: configure() -- a new C compiler preprocessor and code injection proposal Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-08-23 20:10 +0100
Re: configure() -- a new C compiler preprocessor and code injection proposal gazelle@shell.xmission.com (Kenny McCormack) - 2015-08-23 16:36 +0000
Re: configure() -- a new C compiler preprocessor and code injection proposal "Morten W. Petersen" <morphex@gmail.com> - 2015-08-23 14:27 +0200
Re: configure() -- a new C compiler preprocessor and code injection proposal Bartc <bc@freeuk.com> - 2015-08-23 13:35 +0100
Re: configure() -- a new C compiler preprocessor and code injection proposal "Morten W. Petersen" <morphex@gmail.com> - 2015-08-23 15:08 +0200
Re: configure() -- a new C compiler preprocessor and code injection proposal Keith Thompson <kst-u@mib.org> - 2015-08-23 14:27 -0700
Re: configure() -- a new C compiler preprocessor and code injection proposal "Morten W. Petersen" <morphex@gmail.com> - 2015-08-31 19:24 +0200
Re: configure() -- a new C compiler preprocessor and code injection proposal James Kuyper <jameskuyper@verizon.net> - 2015-08-31 13:53 -0400
Re: configure() -- a new C compiler preprocessor and code injection proposal "Morten W. Petersen" <morphex@gmail.com> - 2015-08-31 19:59 +0200
Re: configure() -- a new C compiler preprocessor and code injection proposal Bartc <bc@freeuk.com> - 2015-08-31 19:10 +0100
Re: configure() -- a new C compiler preprocessor and code injection proposal Keith Thompson <kst-u@mib.org> - 2015-08-31 11:27 -0700
Re: configure() -- a new C compiler preprocessor and code injection proposal James Kuyper <jameskuyper@verizon.net> - 2015-08-31 15:40 -0400
Re: configure() -- a new C compiler preprocessor and code injection proposal Keith Thompson <kst-u@mib.org> - 2015-08-31 11:22 -0700
Re: configure() -- a new C compiler preprocessor and code injection proposal "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-08-31 12:18 -0700
Re: configure() -- a new C compiler preprocessor and code injection proposal David Brown <david.brown@hesbynett.no> - 2015-09-01 10:09 +0200
Re: configure() -- a new C compiler preprocessor and code injection proposal Keith Thompson <kst-u@mib.org> - 2015-09-01 08:12 -0700
Re: configure() -- a new C compiler preprocessor and code injection proposal David Brown <david.brown@hesbynett.no> - 2015-09-01 22:19 +0200
Re: configure() -- a new C compiler preprocessor and code injection proposal Tim Rentsch <txr@alumni.caltech.edu> - 2015-09-06 14:47 -0700
Re: configure() -- a new C compiler preprocessor and code injection proposal David Brown <david.brown@hesbynett.no> - 2015-08-23 23:13 +0200
Re: configure() -- a new C compiler preprocessor and code injection proposal "Morten W. Petersen" <morphex@gmail.com> - 2015-08-31 22:27 +0200
Re: configure() -- a new C compiler preprocessor and code injection proposal supercat@casperkitty.com - 2015-08-31 15:00 -0700
Re: configure() -- a new C compiler preprocessor and code injection proposal "Morten W. Petersen" <morphex@gmail.com> - 2015-09-01 00:56 +0200
Re: configure() -- a new C compiler preprocessor and code injection proposal James Kuyper <jameskuyper@verizon.net> - 2015-08-31 20:11 -0400
Re: configure() -- a new C compiler preprocessor and code injection proposal "Morten W. Petersen" <morphex@gmail.com> - 2015-09-01 12:26 +0200
Re: configure() -- a new C compiler preprocessor and code injection proposal James Kuyper <jameskuyper@verizon.net> - 2015-09-01 13:37 -0400
Re: configure() -- a new C compiler preprocessor and code injection proposal David Brown <david.brown@hesbynett.no> - 2015-09-01 22:18 +0200
Re: configure() -- a new C compiler preprocessor and code injection proposal James Kuyper <jameskuyper@verizon.net> - 2015-09-01 16:31 -0400
Re: configure() -- a new C compiler preprocessor and code injection proposal "Morten W. Petersen" <morphex@gmail.com> - 2015-09-04 07:15 +0200
Re: configure() -- a new C compiler preprocessor and code injection proposal James Kuyper <jameskuyper@verizon.net> - 2015-09-04 07:28 -0400
Re: configure() -- a new C compiler preprocessor and code injection proposal James Kuyper <jameskuyper@verizon.net> - 2015-08-31 20:02 -0400
Re: configure() -- a new C compiler preprocessor and code injection proposal David Brown <david.brown@hesbynett.no> - 2015-09-01 09:41 +0200
Re: configure() -- a new C compiler preprocessor and code injection proposal "Morten W. Petersen" <morphex@gmail.com> - 2015-09-01 12:24 +0200
Re: configure() -- a new C compiler preprocessor and code injection proposal David Brown <david.brown@hesbynett.no> - 2015-09-01 14:14 +0200
Re: configure() -- a new C compiler preprocessor and code injection proposal "Morten W. Petersen" <morphex@gmail.com> - 2015-09-04 07:22 +0200
Re: configure() -- a new C compiler preprocessor and code injection proposal James Kuyper <jameskuyper@verizon.net> - 2015-09-04 07:38 -0400
Re: configure() -- a new C compiler preprocessor and code injection proposal Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-09-01 13:14 +0100
Re: configure() -- a new C compiler preprocessor and code injection proposal James Kuyper <jameskuyper@verizon.net> - 2015-09-01 11:07 -0400
Re: configure() -- a new C compiler preprocessor and code injection proposal gordonb.vg6n6@burditt.org (Gordon Burditt) - 2015-08-23 19:29 -0500
Re: configure() -- a new C compiler preprocessor and code injection proposal Bartc <bc@freeuk.com> - 2015-08-24 09:32 +0100
Re: configure() -- a new C compiler preprocessor and code injection proposal David Brown <david.brown@hesbynett.no> - 2015-08-24 11:43 +0200
Re: configure() -- a new C compiler preprocessor and code injection proposal Bartc <bc@freeuk.com> - 2015-08-24 11:01 +0100
Re: configure() -- a new C compiler preprocessor and code injection proposal David Brown <david.brown@hesbynett.no> - 2015-08-24 12:24 +0200
Re: configure() -- a new C compiler preprocessor and code injection proposal Bartc <bc@freeuk.com> - 2015-08-24 12:06 +0100
Re: configure() -- a new C compiler preprocessor and code injection proposal David Brown <david.brown@hesbynett.no> - 2015-08-24 14:21 +0200
Re: configure() -- a new C compiler preprocessor and code injection proposal Ian Collins <ian-news@hotmail.com> - 2015-08-24 07:48 +1200
Re: configure() -- a new C compiler preprocessor and code injection proposal "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-08-23 12:56 -0700
Re: configure() -- a new C compiler preprocessor and code injection proposal Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-08-23 13:45 +0100
Re: configure() -- a new C compiler preprocessor and code injection proposal Bartc <bc@freeuk.com> - 2015-08-23 14:38 +0100
Re: configure() -- a new C compiler preprocessor and code injection proposal "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-08-23 06:43 -0700
Re: configure() -- a new C compiler preprocessor and code injection proposal Bartc <bc@freeuk.com> - 2015-08-23 15:00 +0100
Re: configure() -- a new C compiler preprocessor and code injection proposal "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-08-23 07:54 -0700
Re: configure() -- a new C compiler preprocessor and code injection proposal Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-08-23 19:28 +0100
Re: configure() -- a new C compiler preprocessor and code injection proposal mark.bluemel@gmail.com - 2015-08-24 00:31 -0700
Re: configure() -- a new C compiler preprocessor and code injection proposal Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-08-23 16:17 +0100
Re: configure() -- a new C compiler preprocessor and code injection proposal Bartc <bc@freeuk.com> - 2015-08-23 16:30 +0100
Re: configure() -- a new C compiler preprocessor and code injection proposal Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-08-23 19:44 +0100
Re: configure() -- a new C compiler preprocessor and code injection proposal "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-08-23 06:40 -0700
Re: configure() -- a new C compiler preprocessor and code injection proposal Ben Bacarisse <ben.usenet@bsb.me.uk> - 2015-08-23 16:29 +0100
Re: configure() -- a new C compiler preprocessor and code injection proposal gordonb.kj6kb@burditt.org (Gordon Burditt) - 2015-08-23 19:13 -0500
Re: configure() -- a new C compiler preprocessor and code injection proposal "Rick C. Hodgin" <rick.c.hodgin@gmail.com> - 2015-09-04 05:10 -0700
csiph-web