On 5 Jul 2001, David N. Welton wrote:
> > It should be compatible with dtcl's, except:
> >
> > <?= $variable ?> is the same as <? hputs $variable ?>
> > <?dtcl code ?> is the same as <? code ?>
> These would be good things to #define.
They're hardcoded, for now :P
Actually, I discussed that with a friend of mine and we bet that it's
impossible to write it in 1 night. I won ;>
Anyway, I'll have to look thru the code and fix some things.
> > The first thing is that it does NOT create Tcl code, it's only
> > purpose is to create a list of elements in the page.
> That's ok.
> > There's also a quick-hack testing code :>
> You should try it with example.ttml, that is a fairly 'difficult' file
> to parse and run. If it can do that, it's pretty complete. It seems
> to go into some kind of infinite loop when I run it on example.ttml.
Hehehe, forgot to mention that one. The 'test' binary is in fact an
infinite loop to test for memory leaks.
Today, I wrote a small AOLserver so to test it. And it works - except for
no 'hputs' command and similar stuff.
> > The code was tested and should have no memory leaks and no bugs -
> > after all, this is just a small piece of code. I didn't have time to
> > test binary data, though. I didn't use any str*() function, but only
> > mem*() ones, so this code should work on binary files as well.
>
> Good... a few comments:
>
> #ifdef USE_AOLSERVER_DEBUG
> Ns_Log(Notice,"ParserData delete.0");
> #endif
>
> Couldn't you just put a Parser_Debug function to get rid of all those
> ifdef's?
These were temporary. Too many SEGV at the beginning, I'll have to look
thru the code...
> Style: white space is good, IMO.
>
> if ((rc=Dp_ParserData_Alloc())!=NULL) {
>
> should look like
>
> if ((rc = Dp_ParserData_Alloc()) != NULL) {
>
> and so on. Tcl and Apache's C code is a pretty good place to start
> from, style wise.
Hehehe. Yyou should see my handwriting, it's a bigger mess than my C/Tcl
code...
I really have
> Comments should be C style comments.
I can't bare the fact that C style comments cannot be nested... And
/* */'ing the code is my habit, I can't turn to
#ifdef UNDEFINEDDEFINE
#endif
Ok, I'll check out the code and probably change it a bit...
> I'll have a look at my own parser, too, and see what it would take to
> extract *just* the parsing code.
Actually, I was thinking of choosing which one is faster. I'd have to
write a part for creating pure Tcl code, probably reuse of your code...
I'd hate to mess around with your project, but maybe my code (which
uses memchr() instead of byte-by-byte browsing) is faster, so it would be
wiser to use mine.
Also, I'd like to hear opinions from people on this list if <?= and <?dtcl
could be useful for someone except me?
--
Wojtek Kocjan
[EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]