i'm an amateur programmer that just started learning C. i like most of the
features, specially the c preprocessor that it comes packed with. it's an
extremely portable way of implementing metaprogramming in C.
though i've always thought it lacked a single feature -- an "evaluation"
feature.
s
i'm an amateur programmer that just started learning C. i like most of the
features, specially the c preprocessor that it comes packed with. it's an
extremely portable way of implementing metaprogramming in C.
though i've always thought it lacked a single feature -- an "evaluation"
feature.
s
Date: Wed, 28 Dec 2011 10:57:28 +0100
> From: da...@westcontrol.com
> To: ren_zokuke...@hotmail.com
> CC: gcc@gcc.gnu.org
> Subject: Re: FW: a nifty feature for c preprocessor
>
> On 28/12/2011 07:48, R A wrote:
> >
> > i'm an amateur programmer that just started
> And if you want portable pre-processing or code generation, use
> something that generates the code rather than inventing tools and
> features that don't exist, nor will ever exist. It is also quite common
> to use scripts in languages like perl or python to generate tables and
> other pre-calcu
sorry:
2) it takes very little penalty, otherwise.
that all being said, i really don't think it's a hard feature to implement
like i said, just whenever there is an 1) evaluation in the conditional
directives or 2) #define is called, look for "eval", if there, evaluate the
expression, then substitute token.
the rest of the needs no tamperi
> The gcc developers, and everyone else involved in the development of C
> as a language, are perhaps not superhuman - but I suspect their combined
> knowledge, experience and programming ability outweighs yours.
given. but do you have a consensus of the community that this feature is not
worth
> I personally do not feel it is worth the effort. It's easy to use a
> more powerful macro processor, such as m4, to generate your C code. The
> benefit of building a more powerful macro processor into the language
> proper seems minimal.
>
> This particular extension seems problematic when cross
for some reason they blocked my very last email, but i tried CC'ing it again,
maybe this time they'll let it through. i'm forwarding it to you, since we
agree on some points. if it doesn't make it to the mailing list, you might want
to forward it, then... or not.
thnx
-
---
> Date: Thu, 29 Dec 2011 16:30:04 -0800
> Subject: Re: a nifty feature for c preprocessor
> From: james.denn...@gmail.com
> To: david.br...@hesbynett.no
> CC: ren_zokuke...@hotmail.com; gcc@gcc.gnu.org
.
>
> I'd tend to agree; we ought to move functionality
i meant "general purpose" macro processor. sorry.
alright, here's another example why eval is a good idea:
#define A 17
#define B 153
#define N1 ((A + B)/2) /* intended was (17 + 153)/2 */
#undef A
#define A 230
#define N2 ((A + B)/2) /* intended was (230 + 153)/2 */
printf("%u %u", N1, N2);
acore.com
> To: ren_zokuke...@hotmail.com
> CC: gcc@gcc.gnu.org
> Subject: Re: a nifty feature for c preprocessor
>
> On 12/31/2011 4:44 AM, R A wrote:
> >
> > alright, here's another example why eval is a good idea:
> >
> > #define A 17
> > #define B 153
13 matches
Mail list logo