guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: manual examples - self contained or not?


From: Nala Ginrut
Subject: Re: manual examples - self contained or not?
Date: Mon, 20 Feb 2012 01:50:46 +0800

well, I don't believe in copy-paste code too.
But my vote would be "at least I can trust the official manual"...

On Mon, Feb 20, 2012 at 12:42 AM, Ian Price <address@hidden> wrote:

Hi guilers,

is there an "official" policy on whether or not examples in the manual
should be self contained?

On IRC, kudkudyak was confused about read-line not being found when he
tried to run one of the socket examples. Naturally, I pointed out that
this is because read-line is in (ice-9 rdelim).

Some manual examples, however, do include imports
https://www.gnu.org/software/guile/manual/html_node/Hash-Table-Reference.html
includes srfis 1 and 13.  An example in
https://www.gnu.org/software/guile/manual/html_node/Dynamic-FFI.html
includes (rnrs bytevectors).

With the obvious exception of examples whose entire purpose is to show
off the module system, and similar, I think we should adopt a consistent
policy one way or the other, and adapt all the examples to it.

My vote would be for self-contained: it can be copied directly into a
file or REPL and executed, and IMO reduces confusion. I already try to
do this when posting any examples on paste.lisp.org or in a gist.

Other people may feel differently, as it is relatively easy to search
the manual for missing procedures and, as cky put it, "I don't believe
in copypasta coding".

--
Ian Price

"Programming is like pinball. The reward for doing it well is
the opportunity to do it again" - from "The Wizardy Compiled"




reply via email to

[Prev in Thread] Current Thread [Next in Thread]