Unbound variable: cond-expand-provide

2012-05-03 Thread Sunjoong Lee
Hello,

I thought cond-expand-provide be available in everywhere but saw a compile
error, "ERROR: In procedure module-lookup: Unbound variable:
cond-expand-provide". I don't know why this is happening; do you have any
idea or comments? Thanks in advance.

test-load in attatched archive file is a script to load srfi-64.scm. This
is very simple like this:

#!/usr/bin/guile \
-e main -s
!#
;;; Set %load-path
(eval-when
 (compile load eval)
 (let ((%current-filename (current-filename)))
   (if %current-filename
   (let ((%current-path (dirname %current-filename)))
 (if (not (memq %current-path %load-path))
 (add-to-load-path %current-path))
;;; Fake main for "-e main" option of Guile
(define (main . args)
  (let ((module (resolve-module '(test-load
(apply (module-ref module 'main) args)))
;;; Module
(define-module (test-load)
  #:use-module (srfi srfi-64)
  #:export (main))
;;; Real main
(define (main args) #f)

In srfi-64.scm, I had used "(cond-expand-provide (current-module)
'(srfi-64))" like other srfi modules.

Frist execution of above script is fine:
  $ ./test-load
  ;;; note: auto-compilation is enabled, set GUILE_AUTO_COMPILE=0
  ;;;   or pass the --no-auto-compile argument to disable.
  ;;; compiling /home/sunjoong/test-load/./test-load
  ;;; compiling /home/sunjoong/test-load/srfi/srfi-64.scm
  ;;; compiled
/home/sunjoong/.cache/guile/ccache/2.0-LE-4-2.0/home/sunjoong/test-load/srfi/srfi-64.scm.go
  ;;; compiled
/home/sunjoong/.cache/guile/ccache/2.0-LE-4-2.0/home/sunjoong/test-load/test-load.go

In second execution, I saw "Unbound variable: cond-expand-provide":
  $ ./test-load
  Backtrace:
  In ice-9/boot-9.scm:
   149: 17 [catch #t # ...]
   157: 16 [#]
  In unknown file:
 ?: 15 [catch-closure]
  In ice-9/boot-9.scm:
63: 14 [call-with-prompt prompt0 ...]
  In ice-9/eval.scm:
   407: 13 [eval # #]
  In ice-9/boot-9.scm:
  2111: 12 [save-module-excursion #]
  3653: 11 [#]
  In unknown file:
 ?: 10 [load-compiled/vm
"/home/sunjoong/.cache/guile/ccache/2.0-LE-4-2.0/home/sunjoong/test-load/test-load.go"]
  In /home/sunjoong/test-load/./test-load:
20: 9 [#]
  In ice-9/boot-9.scm:
  2667: 8 [define-module* (test-load) #:filename ...]
  2642: 7 [resolve-imports (((srfi srfi-64)))]
  2580: 6 [resolve-interface (srfi srfi-64) #:select ...]
  2505: 5 [# # ...]
  2772: 4 [try-module-autoload (srfi srfi-64) #f]
  2111: 3 [save-module-excursion #]
  2783: 2 [#]
  In unknown file:
 ?: 1 [primitive-load-path "srfi/srfi-64" #f]
  In srfi/srfi-64.scm:
85: 0 [#]

  srfi/srfi-64.scm:85:2: In procedure #:
  srfi/srfi-64.scm:85:2: In procedure module-lookup: Unbound variable:
cond-expand-provide


test-load.tar.gz
Description: GNU Zip compressed data


Re: Unbound variable: cond-expand-provide

2012-05-03 Thread Sunjoong Lee
I found the cause of "ERROR: In procedure module-lookup: Unbound variable:
cond-expand-provide" but don't know how to resolve it yet.

srfi-64.scm is a portable code and it use cond-expand; I had
used cond-expand-provide in cond-expand like this:
  (cond-expand (guile (cond-expand-provide (current-module) '(srfi-64

If (cond-expand-provide (current-module) '(srfi-64)) be outside
of cond-expand, there would be a no problem. Hum...

2012/5/4 Sunjoong Lee 

> Hello,
>
> I thought cond-expand-provide be available in everywhere but saw a compile
> error, "ERROR: In procedure module-lookup: Unbound variable:
> cond-expand-provide". I don't know why this is happening; do you have any
> idea or comments? Thanks in advance.
>