M
Michael Foukarakis
[...]Gene a crit :
Generating code from templates like this is pretty standard in larger
code bases. But I've generally seen a short script in a language like
awk or perl used to transform the template instead of C. I think what
you've done in C represents one line of Perl, for example.
I do not think so, if you look carefully at the code you will see that
it does more than what you believe. And in any case, I do not want to
force the users of the library to install another programming language
and all the associated hassle...Nobody relies on one programming language for everything. If one
doesn't know sed/awk, (s)he's doomed anyway.
I never got the hang of sed and I find awk very limited (lack of
anchored patterns). I use perl for what i used to use awk for. It *is*
a bit of pain to have to download it and it is gigantic for what I
want. Serves me right for using Windows.
Again: replace sed/awk with anything else. My example is not
important, the principle is.
impressive. On a desk top 2.3k is down in the noise.
no one is compelling you to use it. The void* appraoch is less
typesafe. Usually pretty ugly too.
could we have some specific criticism. If his code is broken or unsafe
we'd like to know why.
Ben Bacarisse pointed out quite a few errors. I think they're enough
to illustrate the point.
no one is twisting your arm
What the hell. Why are you getting so wound up? I'm asking a direct
question and your only response is an asinine comment? Let me clarify
my intentions to your amusing little mind:
I'm asking because I'm INTERESTED.
"C Unleashed" (if I recall corrctly) uses a generic approach (though
less sophisticated tahn Jacob's)
type safety. A quick an easy way to produce efficeint container code.
Finally, a real answer. Comment below.
well if he's done it plainly isn't inadequate
C is not fully capable of introspection. This is a fact. It is the
reason behind the following:
- the extra preprocessing step(s) in producing the "template library".
- the inability to deal with some cases (see above posts) or avoiding
significant storage costs for such types.
, hence the inadequacy. My question still stands - what is the real
benefit offered here, because it's not usability, user friendliness,
or "being generic", all of which are crucial in development and usage
of containers and libraries in general.
as opposed to what?
I'm not interested in the obvious.
I disagree
Why? Is there a point to libraries that are being implemented without
the intention of ever being used?
I think you've already made your mind up.
No, I haven't, that's why I'm asking questions. If you won't help me,
why don't you just go find your lost manhood elsewhere.