guile-devel
[Top][All Lists]
Advanced

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

(debug-options 'full) is broken


From: Mark H Weaver
Subject: (debug-options 'full) is broken
Date: Tue, 09 Jun 2009 15:27:43 -0400

According to node "User level options interfaces" of api-options.texi,
(debug-options 'full) should print a list of options, but it fails
with "ERROR: unbound variable: option-name".  The other options
interfaces (eval-options, read-options, print-options, traps) are
broken as well.

The problem is here, in boot-9.scm:

(defmacro define-option-interface (option-group)
  (let* ((option-name car)
         (option-value cadr)
         (option-documentation caddr)

         ;; Below follow the macros defining the run-time option interfaces.

         (make-options (lambda (interface)
                         `(lambda args
                            (cond ((null? args) (,interface))
                                  ((list? (car args))
                                   (,interface (car args)) (,interface))
                                  (else (for-each
                                         (lambda (option)
                                           (display (option-name option))
                                           (if (< (string-length
                                                   (symbol->string (option-name 
option)))
                                                  8)
                                               (display #\tab))
                                           (display #\tab)
                                           (display (option-value option))
                                           (display #\tab)
                                           (display (option-documentation 
option))
                                           (newline))
                                         (,interface #t)))))))
[...etc...]

How was this supposed to work?  How were the local bindings of
option-name, option-value, and option-documentation supposed to be
referenced from within the expansion of this non-hygienic macro?

    Mark


> Guile Scheme interpreter 0.5 on Guile 1.9.0
> Copyright (C) 2001-2008 Free Software Foundation, Inc.
> 
> Enter `,help' for help.
> scheme@(guile-user)> (debug-options 'full)
> 
> Backtrace:
> In unknown file:
>    ?: 0* [#<vm b7b876b8> #<program b7a9aef0 at standard input:0:0 ()>]
>    ?: 1* [debug-options full]
>    ?: 2* [for-each #<program 861bda0 (option)> (# # # # ...)]
>    ?: 3* [# #]
> 
> ERROR: In procedure module-lookup:
> ERROR: unbound variable: option-name
> scheme@(guile-user)> 




reply via email to

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