This concerns an August 28 build of guile master. I have a simple syntax definition:
(define-syntax dotimes (syntax-rules () ((dotimes (<var> <count>) <body> ...) (let ((count <count>)) (let loop ((<var> 0)) (if (< <var> count) (begin <body> ... (loop (+ <var> 1))) #f)))) ((dotimes (<var> <count> <return>) <body> ...) (let ((count <count>)) (let loop ((<var> 0)) (if (< <var> count) (begin <body> ... (loop (+ <var> 1))) <return>)))))) If I store it in a file "dotimes.scm" and use the script "tryme" #! /bin/sh # -*- scheme -*- exec guile -s "$0" $* !# (load "dotimes.scm") (dotimes (indx 5) (display indx) (newline)) I get the following output: $ ./tryme ;;; note: autocompilation is enabled, set GUILE_AUTO_COMPILE=0 ;;; or pass the --no-autocompile argument to disable. ;;; compiling ./tryme ;;; compiled /home2/barry/.cache/guile/ccache/1.9-0.D-LE-8/home2/barry/work/tryme.go ;;; compiling dotimes.scm ;;; compiled /home2/barry/.cache/guile/ccache/1.9-0.D-LE-8/home2/barry/work/dotimes.scm.go ERROR: In procedure module-lookup: ERROR: unbound variable: indx Also (from a clean cache) $ guile ;;; note: autocompilation is enabled, set GUILE_AUTO_COMPILE=0 ;;; or pass the --no-autocompile argument to disable. ;;; compiling /home/util64/guile/share/guile/1.9/ice-9/readline.scm ;;; compiled /home2/barry/.cache/guile/ccache/1.9-0.D-LE-8/home/util64/guile/share/guile/1.9/ice-9/readline.scm.go Guile Scheme interpreter 0.5 on Guile 1.9.2 Copyright (C) 2001-2008 Free Software Foundation, Inc. Enter `,help' for help. scheme@(guile-user)> (load "tryme") ;;; compiling tryme ;;; compiled /home2/barry/.cache/guile/ccache/1.9-0.D-LE-8/home2/barry/work/tryme.go ;;; compiling dotimes.scm ;;; compiled /home2/barry/.cache/guile/ccache/1.9-0.D-LE-8/home2/barry/work/dotimes.scm.go ERROR: In procedure module-lookup: ERROR: unbound variable: indx scheme@(guile-user)> And from a clean cache: $ guile ;;; note: autocompilation is enabled, set GUILE_AUTO_COMPILE=0 ;;; or pass the --no-autocompile argument to disable. ;;; compiling /home/util64/guile/share/guile/1.9/ice-9/readline.scm ;;; compiled /home2/barry/.cache/guile/ccache/1.9-0.D-LE-8/home/util64/guile/share/guile/1.9/ice-9/readline.scm.go Guile Scheme interpreter 0.5 on Guile 1.9.2 Copyright (C) 2001-2008 Free Software Foundation, Inc. Enter `,help' for help. scheme@(guile-user)> (load "dotimes.scm") ;;; compiling dotimes.scm ;;; compiled /home2/barry/.cache/guile/ccache/1.9-0.D-LE-8/home2/barry/work/dotimes.scm.go scheme@(guile-user)> $ ./tryme ;;; note: autocompilation is enabled, set GUILE_AUTO_COMPILE=0 ;;; or pass the --no-autocompile argument to disable. ;;; compiling ./tryme ;;; compiled /home2/barry/.cache/guile/ccache/1.9-0.D-LE-8/home2/barry/work/tryme.go ERROR: In procedure module-lookup: ERROR: unbound variable: indx $ But (also with a clean cache): $ guile ;;; note: autocompilation is enabled, set GUILE_AUTO_COMPILE=0 ;;; or pass the --no-autocompile argument to disable. ;;; compiling /home/util64/guile/share/guile/1.9/ice-9/readline.scm ;;; compiled /home2/barry/.cache/guile/ccache/1.9-0.D-LE-8/home/util64/guile/share/guile/1.9/ice-9/readline.scm.go Guile Scheme interpreter 0.5 on Guile 1.9.2 Copyright (C) 2001-2008 Free Software Foundation, Inc. Enter `,help' for help. scheme@(guile-user)> (load "dotimes.scm") ;;; compiling dotimes.scm ;;; compiled /home2/barry/.cache/guile/ccache/1.9-0.D-LE-8/home2/barry/work/dotimes.scm.go scheme@(guile-user)> (load "tryme") ;;; compiling tryme ;;; compiled /home2/barry/.cache/guile/ccache/1.9-0.D-LE-8/home2/barry/work/tryme.go 0 1 2 3 4 #f scheme@(guile-user)> $ ./tryme 0 1 2 3 4 $ -- Barry Fishman