Re: [DOCS] Code examples

2007-09-04 Thread Peter Eisentraut
Am Dienstag, 4. September 2007 02:39 schrieb Tom Lane:
> C code that's been hacked until it passes for SGML isn't compilable.

I don't understand this point.  Why would SGML care what the C code looks 
like?

-- 
Peter Eisentraut
http://developer.postgresql.org/~petere/

---(end of broadcast)---
TIP 2: Don't 'kill -9' the postmaster


Re: [DOCS] Code examples

2007-09-04 Thread Tom Lane
Peter Eisentraut <[EMAIL PROTECTED]> writes:
> Am Dienstag, 4. September 2007 02:39 schrieb Tom Lane:
>> C code that's been hacked until it passes for SGML isn't compilable.

> I don't understand this point.  Why would SGML care what the C code looks 
> like?

&, <, and > need to be hacked so that SGML doesn't barf on them.
Unfortunately, all three symbols are a bit commonplace in C code.

Now admittedly this can be fixed with moderately simple
search-and-replaces, but it's still another obstacle in the path of
someone who actually wishes to use the code for its intended purpose,
or even someone who would like to find out if the examples aren't
broken.

regards, tom lane

---(end of broadcast)---
TIP 6: explain analyze is your friend


Re: [DOCS] Code examples

2007-09-04 Thread Alvaro Herrera
Tom Lane escribió:
> Peter Eisentraut <[EMAIL PROTECTED]> writes:
> > Am Dienstag, 4. September 2007 02:39 schrieb Tom Lane:
> >> C code that's been hacked until it passes for SGML isn't compilable.
> 
> > I don't understand this point.  Why would SGML care what the C code looks 
> > like?
> 
> &, <, and > need to be hacked so that SGML doesn't barf on them.
> Unfortunately, all three symbols are a bit commonplace in C code.

Maybe we could set things up so that there are actual files which are
programatically preprocessed to SGML to be included in the docs?  That
way, the docs always reflect the actual file, which by itself is
compilable.  The SGML source would only contain something like
 or something like that.

Is that feasible?

-- 
Alvaro Herrera http://www.amazon.com/gp/registry/CTMLCN8V17R4
"No necesitamos banderas
 No reconocemos fronteras"  (Jorge González)

---(end of broadcast)---
TIP 4: Have you searched our list archives?

   http://archives.postgresql.org


Re: [DOCS] Code examples

2007-09-04 Thread Peter Eisentraut
Am Dienstag, 4. September 2007 16:11 schrieb Tom Lane:
> &, <, and > need to be hacked so that SGML doesn't barf on them.
> Unfortunately, all three symbols are a bit commonplace in C code.

I assume that someone who wants to try out the code would copy it from the 
HTML, not out of the SGML source.

But in any case you can avoid the escaping like so:



Grep for existing uses.

The idea of including the C files directly could also work.

-- 
Peter Eisentraut
http://developer.postgresql.org/~petere/

---(end of broadcast)---
TIP 9: In versions below 8.0, the planner will ignore your desire to
   choose an index scan if your joining column's datatypes do not
   match


Re: [DOCS] Code examples

2007-09-04 Thread Tom Lane
Alvaro Herrera <[EMAIL PROTECTED]> writes:
> Maybe we could set things up so that there are actual files which are
> programatically preprocessed to SGML to be included in the docs?  That
> way, the docs always reflect the actual file, which by itself is
> compilable.  The SGML source would only contain something like
>  or something like that.

Well, if we have actual contrib modules (which is still a good idea
so that they get tested on a regular basis), I don't see any need to
copy the code into the docs at all.  The docs should just say "a working
example can be found in contrib/whatever".

regards, tom lane

---(end of broadcast)---
TIP 5: don't forget to increase your free space map settings


Re: [DOCS] Code examples

2007-09-04 Thread Oleg Bartunov

On Tue, 4 Sep 2007, Tom Lane wrote:


Alvaro Herrera <[EMAIL PROTECTED]> writes:

Maybe we could set things up so that there are actual files which are
programatically preprocessed to SGML to be included in the docs?  That
way, the docs always reflect the actual file, which by itself is
compilable.  The SGML source would only contain something like
 or something like that.


Well, if we have actual contrib modules (which is still a good idea
so that they get tested on a regular basis), I don't see any need to
copy the code into the docs at all.  The docs should just say "a working
example can be found in contrib/whatever".


I thin Tom is right. We already have many user's dictionaries which 
would be worth to distribute.




regards, tom lane



Regards,
Oleg
_
Oleg Bartunov, Research Scientist, Head of AstroNet (www.astronet.ru),
Sternberg Astronomical Institute, Moscow University, Russia
Internet: [EMAIL PROTECTED], http://www.sai.msu.su/~megera/
phone: +007(495)939-16-83, +007(495)939-23-83

---(end of broadcast)---
TIP 6: explain analyze is your friend