The following program fails; it produces the session shown below. Any
help greatly appreciated.
Dale
=PROGRAM==
#include
static void *do_guile (void *)
{
for (;;) ;
return nullptr;
}
static void *run_thread (void *)
{
re
/Mcron/ is a GNU package which runs unattended jobs in the operating
system at dynamically computed times; it is 99% Guile but currently
shrouded in a thin veneer of C code for historical reasons, which
have by now vanished.
The Guile /getopt-long/ module parses a command lineʼs arguments for
opti
>From b08d1cc7dc03d5e69dfd1f93e50617b81230b5e3 Mon Sep 17 00:00:00 2001
From: Dale Mellor
Date: Sun, 19 Apr 2020 18:00:04 +0100
Subject: [PATCH 1/4] test: augment testing of (ice-9 getopt-long) module
Adding some 28 new tests which explore some undefined (or at least
implied) behaviour of
>From 57da5a3ae02008c4c66da21055749e51342fdd7e Mon Sep 17 00:00:00 2001
From: Dale Mellor
Date: Sun, 19 Apr 2020 18:00:33 +0100
Subject: [PATCH 2/4] test *broken*: augmented tests of (ice-9 getopt-long)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8
>From 7d169c24c0fdbbaa56c646985dd2861b12e2bca5 Mon Sep 17 00:00:00 2001
From: Dale Mellor
Date: Sun, 19 Apr 2020 18:00:48 +0100
Subject: [PATCH 3/4] (ice-9 getopt-long): substantially re-written to pass all
the new tests
All of the original tests also still pass. Also the entire guile bu
>From 6acbbb37a2f9a1968fcdbc8f3be3c805d28ef901 Mon Sep 17 00:00:00 2001
From: Dale Mellor
Date: Sun, 19 Apr 2020 18:01:06 +0100
Subject: [PATCH 4/4] (ice-9 getopt-long): update commentary and doc-strings
Emphasise importance of predicate part of specification of options with
optional val
Modelled after GNU libc's argp command-line parser, and building on
(ice-9 getopt-long), this new module allows a one-stop specification
of how the command line options should work,
(process-command-line (command-line)
application "my-app"
version "1.0"
usage
* module/srfi/srfi-9/gnu.scm: Added some doc strings.
---
module/srfi/srfi-9/gnu.scm | 8 +++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/module/srfi/srfi-9/gnu.scm b/module/srfi/srfi-9/gnu.scm
index 219bcdebb..0b9024e75 100644
--- a/module/srfi/srfi-9/gnu.scm
+++ b/module/
Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ 02110-1301 USA
+
+;;; Author: Dale MellorMay, 2020
+
+;;; Commentary:
+
+;;; Where the Guile (ice-9 getopt-long) module, modelled after the GNU C
+;;; libraryʼs ‘getopt_long’ function, allows an application to
* doc/ref/Makefile.am: introduce mod-command-line-processor.texi
* doc/ref/mod-command-line-processor.texi: new file
* doc/ref/guile.texi: changed flow of docs
* doc/ref/mod-getopt-long.texi: changed flow of docs
* doc/ref/srfi-modules.texi: changed flow of docs
---
doc/ref/Makefile.am
Franklin Street, Fifth Floor, Boston, MA 02110-1301
USA
+;;; Author: Thien-Thi Nguyen --- August 2001
+;;; Dale Mellor <> --- April 2020
+
+
(use-modules (test-suite lib)
(ice-9 getopt-long)
(ice-9 regex))
@@ -49,6 +52,31 @@
(deferr option-must-be-spe
x27;((apples(single-char #\a))
- (blimps(single-char #\b) (value #t))
- (catalexis (single-char #\c) (value #t
+ (blimps(single-char #\b) (value #t))
+ (catalexis (single-char #\c) (valu
McManus
+;;; Rewritten by Thien-Thi Nguyen
+;;; Rewritten by Dale Mellor 2020-04-14
;;; Commentary:
;;; This module implements some complex command line option parsing, in
-;;; the spirit of the GNU C library function `getopt_long'. Both long
+;;; the spirit of the GNU C li
All of the original tests also still pass. Also the entire guile build
actually depends on the correct functioning of this module, so we can be
quite confident that nothing has been broken.
* module/ice-9/getopt-long.scm: Substantially re-written.
---
module/ice-9/getopt-long.scm | 476 +++
Note that this patch breaks an existing test (since 2001), namely
(option-ref (getopt-long
(list "prog" "-f4")
'((foo
(value optional)
(single-char #\f))
(bar)))
'foo #f)
bails out with
prog: no such opti
For information, all these patches are applied in the GIT repository and
GUIX channel described at https://rdmp.org/dmbcs/guile#download.
/Mcron/ is a GNU package which runs unattended jobs in the operating
system at dynamically computed times; it is 99% Guile but currently
shrouded in a thin veneer of C code for historical reasons, which
have by now vanished.
The Guile /getopt-long/ module parses a command lineʼs arguments for
opti
@@
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
USA
+;;; Author: Thien-Thi Nguyen --- August 2001
+;;; Dale Mellor --- April 2020
+
+
(use-modules (test-suite lib)
(ice-9
quot;--="
@@ -295,9 +303,40 @@
(pass-if "normal 2" (test8 "-ab" "bang" "-c" "couth"))
(pass-if "normal 3" (test8 "-ac" "couth" "-b" "bang"))
- (pass-if-fatal-exception "bad ordering ca
All of the original tests also still pass. Also the entire guile build
actually depends on the correct functioning of this module, so we can be
quite confident that nothing has been broken.
* module/ice-9/getopt-long.scm: Substantially re-written.
---
module/ice-9/getopt-long.scm | 459 +
McManus
+;;; Rewritten by Thien-Thi Nguyen
+;;; Rewritten by Dale Mellor 2020-04-14
;;; Commentary:
;;; This module implements some complex command line option parsing, in
-;;; the spirit of the GNU C library function `getopt_long'. Both long
+;;; the spirit of the GNU C li
Too often the message 'connect: no such file or directory' appears deep
in network code, and it is very hard to figure out where it is coming
from. At least seeing the path (for example, in the case of a UNIX
socket) will help the user to debug their code.
* libguile/socket.c: extra error handli
24 matches
Mail list logo