unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
* manual examples - self contained or not?
@ 2012-02-19 16:42 Ian Price
  2012-02-19 17:50 ` Nala Ginrut
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Ian Price @ 2012-02-19 16:42 UTC (permalink / raw)
  To: guile-devel


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"




^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2012-02-22 21:35 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-19 16:42 manual examples - self contained or not? Ian Price
2012-02-19 17:50 ` Nala Ginrut
2012-02-21 21:14   ` Neil Jerram
2012-02-21 22:04     ` Andy Wingo
2012-02-19 21:02 ` Noah Lavine
2012-02-19 21:18 ` Andy Wingo
2012-02-22 21:35 ` Ludovic Courtès

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).