Re: [OT] General purpose Expression Parser



Richard Heathfield wrote:
Ioannis Vranos said:
Ben Pfaff wrote:
Ioannis Vranos <ivranos@xxxxxxxxxxxxxxxxxxxxxxxxx> writes:

I think template functions and structs could be introduced in
C.
You can already use them in C++. There is no need for them in C.
So, whatever we can use in C++ needs not be provided in C. In other
words you are saying that C is obsolete.

CUSTOMER: "I'd like a knife and fork, please."
WAITER: "Here you are, sir."
CUSTOMER: "Wait a moment - this fork has no sharp edge."
WAITER: "That's right."
CUSTOMER: "But this knife has a lovely edge on it. Why can't the fork be like that?"
WAITER: "Because it's a fork."
CUSTOMER: "This knife has serrations along the blade to improve its grip during the cut. Why can't the fork have serrations?"
WAITER: "Because it's a fork. If you want to cut, use the knife."
CUSTOMER: "So what you're saying is that the fork is useless? I don't need it?"
WAITER: "No, what I'm saying is that I don't get paid enough to deal with people like you."


This fictional conversation has nothing to do with the value of function/struct templates in terms of *elegance (simplicity)*, *efficiency*, *type safety* as a newer and better tool, replacing generic functions currently implemented with void * and conditions, and macros.


As an example of C++ features adoption, consider function-prototypes adopted and provided in C89 as well as other features I do not remember now.
.



Relevant Pages