Received: from localhost (unknown [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id 149619F95D9 for ; Mon, 3 Sep 2007 21:40:22 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-maia, port 10024) with ESMTP id 09972-04 for ; Mon, 3 Sep 2007 21:40:05 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id 7F1A89F95D8 for ; Mon, 3 Sep 2007 21:40:17 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.1/8.14.1) with ESMTP id l840dsgc006063; Mon, 3 Sep 2007 20:39:54 -0400 (EDT) To: Peter Eisentraut cc: pgsql-docs@postgresql.org, Decibel! , Oleg Bartunov , Pavel Stehule Subject: Re: Code examples In-reply-to: <200709040229.29591.peter_e@gmx.net> References: <162867790709021328i7771aa9jfe79268bccbf123d@mail.gmail.com> <18259.1188773171@sss.pgh.pa.us> <20070903171858.GV38801@decibel.org> <200709040229.29591.peter_e@gmx.net> Comments: In-reply-to Peter Eisentraut message dated "Tue, 04 Sep 2007 02:29:28 +0200" Date: Mon, 03 Sep 2007 20:39:54 -0400 Message-ID: <6062.1188866394@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200709/3 X-Sequence-Number: 4401 Peter Eisentraut writes: > Decibel! wrote: >> Couldn't we come up with some method of specifying code examples in >> the docs and then having the doc build process actually run those >> examples and put that into the doc build? > While that seems very tempting, I think you need manual review to check > whether the examples make didactic sense. For example, I seem to > recall that we had to change some examples about how operator > precendence or type casting gives unexpected results several times over > the years because the unexpected results had turned into expected > results in response to new features. If you'd just produce the > documentation examples automatically, you'd be left with quite > embarrassing nonsense in there. Well, both my point and Jim's was that trying to compile and run the code would help to expose such silliness. In the case at hand, there's another consideration: the examples are large and are (I believe) intended as working skeletons for real code development. They'd be a lot more useful for that purpose if they were available as actual contrib modules. C code that's been hacked until it passes for SGML isn't compilable. regards, tom lane